-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspawn-if-processName.cna
39 lines (31 loc) · 1023 Bytes
/
spawn-if-processName.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
#Simple PoC Aggressor Script to Perform Different Actions for Different Beacons
#Add 'get explorer' function incase we need it:
sub getexplorerpid {
bps($1, lambda({
local('$pid $name $entry');
foreach $entry (split("\n", $2)) {
($name, $null, $pid) = split("\\s+", $entry);
if ($name eq "explorer.exe") {
[$callback: $1, $pid];
}
}
}, $callback => $2));
}
#Perform action based on process/listner
on beacon_initial {
$metadata = beacon_data($1);
if ($metadata['process'] eq "[PROCESS]") {
if($metadata['listener'] eq "[LISTENER]"){
[DO COMMANDS];
}
else if($metadata['listener'] eq "[LISTENER]"){
[DO COMMANDS];
}
}
if ($metadata['process'] eq "[PROCESS]") {
[DO COMMANDS];
}
if ($metadata['process'] eq "[PROCESS]") {
[DO COMMANDS];
}
}