Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- LFI Website Scanner v1.0
- (c)oded by Inj3ctor_M4
- */
- error_reporting(0);
- @set_time_limit(0);
- echo".____ ___________.___ _________
- | | \_ _____/| | / _____/ ____ _____ ____
- | | | __) | | \_____ \_/ ___\\__ \ / \
- | |___| \ | | / \ \___ / __ \| | \
- |_______ \___ / |___| /_______ /\___ >____ /___| /
- \/ \/ \/ \/ \/ \/
- \n";
- $target = $argv[1];
- $var = spider_url($target);
- preg_match_all ("/a[\s]+[^>]*?href[\s]?=[\s\"\']+".
- "(.*?)[\"\']+.*?>"."([^<]+|.*?)?<\/a>/",
- $var, $matches);
- $matches = array_unique($matches[1]);
- $list = array();
- foreach($matches as $var)
- {
- echo ($target.$var);
- $site = _Fix($target.$var);
- scanlfi($site);
- }
- function spider_url($url,$ref="")
- {
- if(function_exists("curl_init")){
- $ch = curl_init();
- $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; ".
- "Windows NT 5.0)";
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
- curl_setopt( $ch, CURLOPT_HTTPGET, 1 );
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
- curl_setopt( $ch, CURLOPT_FOLLOWLOCATION , 1 );
- curl_setopt( $ch, CURLOPT_FOLLOWLOCATION , 1 );
- curl_setopt( $ch, CURLOPT_URL, $url );
- curl_setopt( $ch, CURLOPT_REFERER, $ref );
- curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
- $html = curl_exec($ch);
- curl_close($ch);
- return $html;
- }
- }
- function scanlfi($url)
- {
- $findme = "failed to open stream|daemon";
- $gt = getsource($url.'__ma__');
- if(preg_match("/$findme/i",$gt))
- {
- echo" >> LFI Found\n";
- }else{echo" >> LFI Not Found\n";
- }
- }
- // By Lagripe-Dz
- function _Fix($site){ preg_match_all("#(.*?)?(.*?)=(.*?)#",$site,$res); return $res[2][0]."="; }
- function getsource($site){
- if (function_exists('curl_init')) {
- $ch = @curl_init($site);
- if ($proxy)
- @curl_setopt ($ch, CURLOPT_PROXY, $proxy);
- @curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
- @curl_setopt($ch, CURLOPT_HEADER, FALSE);
- @curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
- @curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
- $source = @curl_exec($ch);
- @curl_close($ch);
- return $source;
- }
- else {
- return @file_get_contents($site);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement