Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # (c) sec4ever.com
- use LWP::UserAgent;
- use strict;
- use warnings;
- use threads;
- use Getopt::Long;
- our $ua = LWP::UserAgent->new;
- $ua->agent("msnbot/1.0 (+http://search.msn.com/msnbot.htm)");
- $ua->timeout(20);
- our $options = GetOptions (
- 's|server=s'=> \my $ip,
- 't|threads=i'=> \my $threads,
- );
- $| = 1;
- if($threads) {my $threads = $threads;}else{my $threads = 10;}
- my @threads = ();
- unless ($ip) {
- print "[+] Please enter server ip: ";
- my $ip = <stdin>;
- chomp($ip);
- }
- my @sites = rev_bing($ip);
- print "[+] Checking ".scalar(@sites)." sites from $ip\n";
- foreach my $site (@sites){
- push(@threads, threads->create (sub {
- my $type = type($site);
- if($type){
- print "[+] $site > $type\n";#"[-] $site > unknown";
- my $out = "$type-$ip.txt";
- save($out,$site);
- }else{
- print "[-] $site > unknown\n";
- my $out = "unknown-$ip.txt";
- save($out,$site);
- }
- save("sites-$ip.txt",$site);
- }));
- sleep(1) while(scalar threads->list(threads::running) >= $threads);
- }
- $_->join() foreach (threads->list());
- sub save {
- open ("SAVE",">>".$_[0]) or die $!."\n";
- print SAVE $_[1]."\n";
- close "SAVE";
- }
- sub type {
- my $site = shift;
- my $mainm = $ua->get("http://".$site."/") or die $!."\n";
- my $main = $mainm->content;
- my $mainh = $mainm->headers()->as_string;
- if ($main =~ /joomla|\/component\/|com\_/) {
- return "joomla";
- }elsif ($main =~ /wordpress|wp\-content|wp\-includes/)
- {
- return "wordpress";
- }
- elsif($mainh =~ /X-Meta-Generator: vBulletin/ || $main =~ /vbulletin_css/){
- return "vbulletin";
- }
- elsif($mainh =~ /Set-Cookie: mybb/ || $main =~ /wp\-content|\">MyBB<\/a>/){
- return "mybb";
- }
- elsif ($mainh =~ /Set-Cookie: WHMC/ || $main =~ /\">WHMCompleteSolution<\/a>/){
- return "whmcs";
- }
- else{
- return 0;
- }
- }
- sub rev_bing {
- my $ip = shift;
- my $page = 0;
- my (%group,@cont);
- while(1)
- {
- my $content = $ua->get("http://www.bing.com/search?q=ip::$ip&first=$page&FORM=PERE")->content;
- my $status = keys %group;
- while ( $content =~ /<cite>[:\/\/]*([\w\.\-]+)[\w+\/\.\-_:\?=]*<\/cite>/g) {
- $group{$1} = undef;
- }
- last if ($status == keys %group);
- $page += 10;
- }
- foreach my $s (keys %group) {push(@cont,sclean($s));}
- return(uniq(@cont));
- }
- sub sclean {
- my $site = shift;
- $site =~ s/^www\.//g if $site =~ /^www\./;
- return $site;
- }
- sub uniq {
- return keys %{{ map { $_ => 1 } @_ }};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement