• About
  • Policy
  • Contact

Phan Anh Buổi Sáng

  • Home
  • Kiến thức IT
    • PSD
    • Blogger
  • Translate
Google
Custom Search
Trang chủ » Code » Local Attack » Private host scan script

Private host scan script

Unknown Labels: Code, Local Attack Leave A Comment 20:46
Code:
<html>
<head>
<title></title>
</head>
<body>
<h1></h1>
<form action="?" method="GET">
<input type="text" name="host" value="<?PHP echo isset($_GET['host']) ? $_GET['host'] : 'www.example.com'; ?>" />
<input type="submit" value="mandale gas" />
</form>
<br><br>
<?PHP analizar($_GET['host']); ?>
</body>
</html>
<?PHP
//reversedns bing ()
//reversedns gigablast ()
//whoishostingthis ()
//google/bing/otros dorks
//dns lookups ()
//transferencias de zona
//brute force de subdominios ()
function analizar($host){
error_reporting(999999999);
error_reporting(0);
set_time_limit(0);

echo 'Host: '. htmlentities($host, ENT_QUOTES, 'UTF-8').'<br>';
echo '<table><tr><td>IP</td><td>Reverse</td><td>Long ip</td><td>ISP</td><td>Ciudad</td><td>Region</td><td>Pais</td></tr>';
$ip = gethostbynamel($host);
foreach ($ip as $this_ip){
$reverse = gethostbyaddr($this_ip);
if ( $reverse == $this_ip ) {
$reverse = '';
}
echo '<tr><td>'.htmlentities($this_ip, ENT_QUOTES, 'UTF-8').'</td>';
echo '<td>'.htmlentities($reverse, ENT_QUOTES, 'UTF-8').'</td>';
echo '<td>'.htmlentities(sprintf("%u", ip2long(trim($this_ip))), ENT_QUOTES, 'UTF-8').'</td>';
$temp = file_get_contents("http://www.melissadata.com/lookups/iplocation.asp?ipaddress=".$this_ip);
// print_R($temp);
preg_match("@<tr class='tdresul01'><td class='columresult'>ISP</td><td align='left'><b>([^&]+)&nbsp;</b></td></tr>@",$temp,$match);
echo '<td>' . htmlentities($match[1], ENT_QUOTES, 'UTF-8') . '</td>';
preg_match("@<tr><td class='columresult'>City</td><td align='left'><b>(.+)</b></td></tr>@",$temp,$match);
echo '<td>' . htmlentities($match[1], ENT_QUOTES, 'UTF-8') . '</td>';
preg_match("@<tr class='tdresul01'><td class='columresult'>State or Region</td><td align='left'><b>(.+)</b></td></tr>@",$temp,$match);
echo '<td>' . htmlentities($match[1], ENT_QUOTES, 'UTF-8') . '</td>';
preg_match("@<tr><td class='columresult'>Country</td><td align='left'><b>(.+)</b></td></tr>@",$temp,$match);
echo '<td>' . htmlentities($match[1], ENT_QUOTES, 'UTF-8') . '</td></tr>';
}
echo '</table><br>';

//dns
$resultado_dns = dns_get_record($host, DNS_ANY, $authdns);
foreach ($resultado_dns as $dns){
if ($dns["type"]=="A"){
echo "[".$dns["host"]."] ".$dns["type"]." => ".$dns["ip"]." (ttl ".$dns["ttl"].")".'<br>';
}elseif ($dns["type"]=="MX"){
echo "[".$dns["host"]."] ".$dns["type"]." => ".$dns["target"]." (".$dns["pri"].") (ttl ".$dns["ttl"].")".'<br>';
}elseif (($dns["type"]=="CNAME") or ($dns["type"]=="NS") or ($dns["type"]=="PTR")){
echo "[".$dns["host"]."] ".$dns["type"]." => ".$dns["target"]." (ttl ".$dns["ttl"].")".'<br>';
}elseif ($dns["type"]=="TXT"){
echo "[".$dns["host"]."] ".$dns["type"]." => ".$dns["txt"]." (ttl ".$dns["ttl"].")".'<br>';
}elseif ($dns["type"]=="HINFO"){
echo "[".$dns["host"]."] ".$dns["type"]." => CPU: ".$dns["cpu"]." OS: ".$dns["os"]." (ttl ".$dns["ttl"].")".'<br>';
}elseif ($dns["type"]=="SOA"){
echo "[".$dns["host"]."] ".$dns["type"]." => ".$dns["mname"]." - Email: ".$dns["rname"]." - Serial: ".$dns["serial"]." - Refresh: ".$dns["refresh"]." - Retry: ".$dns["retry"]." - Expire: ".$dns["expire"]." - Minimum-ttl: ".$dns["minimum-ttl"]." (ttl ".$dns["ttl"].")".'<br>';
}elseif ($dns["type"]=="AAA"){
echo "[".$dns["host"]."] ".$dns["type"]." => ".$dns["ipv6"]." (ttl ".$dns["ttl"].")".'<br>';
}elseif ($dns["type"]=="A6"){
echo "[".$dns["host"]."] ".$dns["type"]." => ".$dns["masklen"]." - ".$dns["ipv6"]." - ".$dns["chain"]." - "." (ttl ".$dns["ttl"].")".'<br>';
}elseif ($dns["type"]=="SRV"){
echo "[".$dns["host"]."] ".$dns["type"]." => ".$dns["pri"]." - ".$dns["weight"]." - ".$dns["target"].":".$dns["port"]." (ttl ".$dns["ttl"].")".'<br>';
}elseif ($dns["type"]=="NAPTR"){
echo "[".$dns["host"]."] ".$dns["type"]." => ".$dns["order"]." - ".$dns["pref"]." - ".$dns["flags"]." - ".$dns["services"]." - ".$dns["regex"]." - ".$dns["replacement"]." (ttl ".$dns["ttl"].")".'<br>';
}else{
echo "<br>";
}
}

foreach ($authdns as $this_authdns) {
echo "[".$dns["host"]."] ".$dns["type"]." => ".$dns["target"]." - ".$dns["class"]." (ttl ".$dns["ttl"].")".'<br>';
}

$temp = file_get_contents("http://www.whoishostingthis.com/".$host);
preg_match('@<a href="http://www.whoishostingthis.com/linkout/?.*";[^>]*?>([^<]+)</a>@i',$temp,$match);
echo '<br>Hosted by: ' . (isset($match[1]) ? $match[1] : 'Unknown') . '<br>';


//reverse dns (bing)
echo '<table><tr><td>IP</td><td>Bing (confirmados)</td><td>Bing(Sin confirmar)</td><td>GigaBlast (confirmados)</td><td>GigaBlast (sin confirmar)</td><td>Total (confirmados)</td><td>Total (sin confirmar)</td></tr>';
foreach ($ip as $this_ip) {
echo '<tr><td>'.$this_ip.'</td>';
//Bing
$offset = 0;
$confirmed_domains_bing = array();
$no_confirmed_domains_bing = array();
$url_dns = array();
$pasado = null;
do{
unset($url_dns);
$url = 'http://api.search.live.net/json.aspx?AppId=7066FAEB6435DB963AE3CD4AC79CBED8B962779C&Query=IP:'.$this_ip.'&Sources=web&Web.Offset='.$offset;
$data = json_decode(file_get_contents($url));

foreach($data->SearchResponse->Web->Results as $value){
$dms = parse_url($value->Url, PHP_URL_HOST);
if ( (!in_array ($dms, $confirmed_domains_bing)) and (!in_array ($dms, $no_confirmed_domains_bing)) ){
if ( in_array($this_ip, gethostbynamel($dms)) ) {
$confirmed_domains_bing[] = $dms;
}else{
$no_confirmed_domains_bing[] = $dms;
}
}
$url_dns[] = $dms;
}

if ($offset % 4 == 0 ) {
$actual = $url_dns;
}else{
$pasado = $url_dns;
}
$offset = $offset + 10;

}while ($actual != $pasado);

sort($confirmed_domains_bing);
sort($no_confirmed_domains_bing);
echo '<td><textarea cols="30" rows="15">'.sizeof($confirmed_domains_bing)."\n".htmlentities(implode("\n", $confirmed_domains_bing), ENT_QUOTES, 'UTF-8').'</textarea></td><td><textarea cols="30" rows="15">'.sizeof($no_confirmed_domains_bing)."\n".htmlentities(implode("\n", $no_confirmed_domains_bing), ENT_QUOTES, 'UTF-8').'</textarea></td>';

//Reverse dns Giga Blast
$offset = 0;
$confirmed_domains_gigablast = array();
$no_confirmed_domains_gigablast = array();
$pasado = null;
for($i=0; $i<10;$i++){
$links = file_get_contents('http://www.gigablast.com/search?q=ip:'.urlencode($this_ip).'&n=50&sc=0&dr=0&raw=1&nrt=110&spell=0&s='.($i*50));
$links = explode("\n", $links);
unset($links[0], $links[sizeof($links)]);
foreach ($links as $link) {
$dms = parse_url($link, PHP_URL_HOST);
if ( (!in_array ($dms, $confirmed_domains_gigablast)) and (!in_array ($dms, $no_confirmed_domains_gigablast)) ){
if ( in_array($this_ip, gethostbynamel($dms)) ) {
$confirmed_domains_gigablast[] = $dms;
}else{
$no_confirmed_domains_gigablast[] = $dms;
}
}
}
}

sort($confirmed_domains_gigablast);
sort($no_confirmed_domains_gigablast);
echo '<td><textarea cols="30" rows="15">'.sizeof($confirmed_domains_gigablast)."\n".htmlentities(implode("\n", $confirmed_domains_gigablast), ENT_QUOTES, 'UTF-8').'</textarea></td><td><textarea cols="30" rows="15">'.sizeof($no_confirmed_domains_gigablast)."\n".htmlentities(implode("\n", $no_confirmed_domains_gigablast), ENT_QUOTES, 'UTF-8').'</textarea></td>';

$confirmed_domains = array_unique(array_merge($confirmed_domains_bing, $confirmed_domains_gigablast));
sort($confirmed_domains);
$no_confirmed_domains = array_unique(array_merge($no_confirmed_domains_bing, $no_confirmed_domains_gigablast));
sort($no_confirmed_domains);
echo '<td><textarea cols="30" rows="15">'.sizeof($confirmed_domains)."\n".htmlentities(implode("\n", $confirmed_domains), ENT_QUOTES, 'UTF-8').'</textarea></td><td><textarea cols="30" rows="15">'.sizeof($no_confirmed_domains)."\n".htmlentities(implode("\n", $no_confirmed_domains), ENT_QUOTES, 'UTF-8').'</textarea></td></tr>';
}
echo '</table>';

//sub domain brute force
echo '<br><br>Bruteando subdominios:<br>';
$subdomains = file_get_contents('subdomains.txt');
$subdomains = explode("\n", $subdomains);
foreach($subdomains as $subdomain){
if(gethostbyname($subdomain.'.'.$host) != $subdomain.'.'.$host){
echo $subdomain.'.'.$host.'<br>';
}
}
}







?>

Bài viết liên quan

← Bài đăng mới hơn Bài đăng cũ hơn → Trang chủ
Powered by Blogger.

Các Bình Luận Gần Đây

Bài đăng phổ biến

  • N0B0dy v1 Shell
    Code: <style type="text/css"> .or3 { -moz-box-shadow:inset 0px 1px 0px 0px #f29c93; -webkit-box-shadow:inset 0px 1px 0px 0...
  • Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Đôi lúc em tránh ánh mắt của anh. vì dường như lúc nào em cũng hiểu thấu lòng anh Demo Cover Download PSD loading...
  • Backdoor Scanner
    Code: <?php /* ################################################################################# # [+] File Name : Devilzc0de Backdoor Sc...
  • Cảnh báo: Phising email lừa gạt cư dân Facebook
    Phishing email là loại email trá hình nhằm lừa gạt người sử dụng. Trong nhiều trường hợp đường dẫn tin tặc cung cấp chứa đầy vi rút. Đây l...
  • [xHydra] BruteForcing FTP - Website - Router con 14 Millones de Password
    INTRODUCCIÓN : Según  OWASP  el Brute Forcing consiste en enumerar sistemáticamente todos los posibles candidatos para la solución y compr...
  • Blogger templates bán áo thun đẹp chuẩn Responsive
    DEMO Test:  RESPONSIVE Responsive blogger templates thiết kế áo thun T-Shirt miễn phí bán trên trang TeeSpring và Sunfrogshirts.com Shell gi...
  • Joomla Shell Upload Vulnerability
    requirements: 1.mind use this google dork to find vulnerable joomla sites ##  google dork : inurl:index.php?option=com_fabrik after open the...
  • OsCommerce [Remote File Upload exploit Vulnerability]
    Code: <html> <head> <title>Oscommerce Online Merchant - Kill-9 CrEw</title> </head> <body> <div style...
  • CONFIGURATION File Killer Symlink Shell
    This is a CONFIGURATION File Killer Symlink Shell  coded by a member of Team Indishell. It is fully automated php shell and symlinks all the...
  • Mini CMD bypass shell
    Code: <?php echo '<form action="cmd.php" method="post"> <input type="text" name="cmd...

Pageviews from the past week

Chuyên mục

Bài đăng phổ biến

  • N0B0dy v1 Shell
    Code: <style type="text/css"> .or3 { -moz-box-shadow:inset 0px 1px 0px 0px #f29c93; -webkit-box-shadow:inset 0px 1px 0px 0...
  • Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Ảnh bìa chế Phía sau một cô gái - Soobin Hoàng Sơn - Zoy Thủ Thuật #Zoy
    Đôi lúc em tránh ánh mắt của anh. vì dường như lúc nào em cũng hiểu thấu lòng anh Demo Cover Download PSD loading...
  • Backdoor Scanner
    Code: <?php /* ################################################################################# # [+] File Name : Devilzc0de Backdoor Sc...
  • Cảnh báo: Phising email lừa gạt cư dân Facebook
    Phishing email là loại email trá hình nhằm lừa gạt người sử dụng. Trong nhiều trường hợp đường dẫn tin tặc cung cấp chứa đầy vi rút. Đây l...
  • [xHydra] BruteForcing FTP - Website - Router con 14 Millones de Password
    INTRODUCCIÓN : Según  OWASP  el Brute Forcing consiste en enumerar sistemáticamente todos los posibles candidatos para la solución y compr...
  • Blogger templates bán áo thun đẹp chuẩn Responsive
    Blogger templates bán áo thun đẹp chuẩn Responsive
    DEMO Test:  RESPONSIVE Responsive blogger templates thiết kế áo thun T-Shirt miễn phí bán trên trang TeeSpring và Sunfrogshirts.com Shell gi...
  • Joomla Shell Upload Vulnerability
    requirements: 1.mind use this google dork to find vulnerable joomla sites ##  google dork : inurl:index.php?option=com_fabrik after open the...
  • OsCommerce [Remote File Upload exploit Vulnerability]
    Code: <html> <head> <title>Oscommerce Online Merchant - Kill-9 CrEw</title> </head> <body> <div style...
  • CONFIGURATION File Killer Symlink Shell
    This is a CONFIGURATION File Killer Symlink Shell  coded by a member of Team Indishell. It is fully automated php shell and symlinks all the...
  • Mini CMD bypass shell
    Code: <?php echo '<form action="cmd.php" method="post"> <input type="text" name="cmd...
Google
Custom Search
Support: Facebook | Twitter | Google+ | Giới thiệu
Copyright © 2015 • Phan Anh Buổi Sáng • All Right Reserved. Template by Template Việt