print("
[+]Program starts--------------------------------[+]
[-]Explain: Automatically close after completion. Open url.txt to view the results [-]rn");
include('url.php');
error_reporting(E_ERROR);
set_time_limit(0);
a();
function Server($url){
$array = get_headers($url,1);
if(array_key_exists('Server',$array)){
if(!is_array($array['Server'])){
//$preg = "/nginx/";
$url = "URL: ".$url." Server type: ".$array['Server']."rn";
echo $url;
//if(preg_match($preg,$url)){
// echo $url;
w($url);
//}
}
}
}
function a(){
$url_list =file('list_url.txt');
//print_r($url_list);
foreach ($url_list as $url){
Server(trim($url));
}
}
function w($url){
$fileName = 'url.txt';
$handle = fopen($fileName,'a');
fwrite($handle,$url."rn");
}
?>
url.php
error_reporting(E_ERROR);
set_time_limit(0);
print("Start rn");
f();
//Get url function
function pregUrl($ip){
$url = @file_get_contents($ip);
//$url_list = file('data.txt');
$preg='/[a-zA-z]+://[0-9a-zA-z_]?.[0-9a-zA-z_]+[.a-z]+/';
if(preg_match_all($preg,$url,$match_all)){
foreach ($match_all as $value){
$value=array_values(array_unique($value));
foreach ($value as $key=>$ok){
$ok=trim($ok);
Print("Get website{$ok}rn");
write($ok);
}
// pregUrl($ok);
}
}
}
//Write function
function write($data){
$fileName='t00ls.txt';
$handle = @fopen($fileName,"a");
@fwrite($handle,$data."rn");
@fclose($handle);
}
//Start function
function f(){
$file = file('list_url.txt');
foreach ($file as $value){
$value = trim($value);
pregUrl($value);
}
}
//Remove duplicates
print("Acquisition of website completed rn");
unique();
function unique(){
$list_url = file('t00ls.txt');
$filename = 'list_url.txt';
$handle = fopen($filename, 'w');
$list_url = array_unique($list_url);
foreach($list_url as $data){
print("Writing to website ".$data);
fwrite($handle,$data);
}
}
?>