Aug 28, 2014 09:26 AM
(This post was last modified: Mar 1, 2015 07:08 PM by Zinedine Zidane.)
Hey Everyone it's Zidane, today i coded a New XML-RPC Scanner, more faster, easy to scan
You can scan the whole world in 6H if you have a 100mbps private connection.
Requierments
- A Server with a good connection
- Perl installed
- a Brain
Modules
1st you need to install all modules to use the script
- HTML::Parser
- LWP::UserAgent
- LWP::Simple
- Parallel::ForkManager
- Net::IP
Set up the script
Source code
Usage perl scan.pl [Start IP] [End IP] [Threads] [.txt] [Delay]
Thanks to Vyp0r i recode his basic Scanner (http://pastebin.com/xYPux8dF)
Please do not forget to say "Thanks" if i helped you
You can scan the whole world in 6H if you have a 100mbps private connection.
Requierments
- A Server with a good connection
- Perl installed
- a Brain
Modules
1st you need to install all modules to use the script
- HTML::Parser
Code
wget http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/HTML-Parser-3.71.tar.gz
tar -xvf HTML-Parser-3.71.tar.gz
cd HTML-Parser-3.71
perl Makefile.PL
make
make install- LWP::UserAgent
Code
wget http://search.cpan.org/CPAN/authors/id/M/MS/MSCHILLI/libwww-perl-6.08.tar.gz
tar -xvf libwww-perl-6.08.tar.gz
cd libwww-perl-6.08
perl Makefile.PL
make
make install- LWP::Simple
Code
wget http://search.cpan.org/CPAN/authors/id/M/MS/MSCHILLI/libwww-perl-6.08.tar.gz
tar -xvf libwww-perl-6.08.tar.gz
cd libwww-perl-6.08
perl Makefile.PL
make
make install- Parallel::ForkManager
Code
wget http://search.cpan.org/CPAN/authors/id/S/SZ/SZABGAB/Parallel-ForkManager-1.06.tar.gz
tar -xvf Parallel-ForkManager-1.06.tar.gz
cd Parallel-ForkManager-1.06
perl Makefile.PL
make
make install- Net::IP
Code
wget http://search.cpan.org/CPAN/authors/id/M/MA/MANU/Net-IP-1.26.tar.gz
tar -xvf Net-IP-1.26.tar.gz
cd Net-IP-1.26
perl Makefile.PL
make
make installSet up the script
Source code
Code
#! /usr/bin/perl
use HTML::Parser; #HTML
use LWP::UserAgent; #http request
use LWP::Simple;
use Parallel::ForkManager; # threads
use strict;
use Net::IP; # range IP
use IO::Socket;
use Term::ANSIColor;
use vars qw( $PROG );
( $PROG = $0 ) =~ s/^.*[\/\\]//;
#Usage
if ( @ARGV == 0 ) {
print "Usage : ./$PROG [Start IP] [End IP] [Threads] [.txt] [Delay]\n Coded by Zidane For HF User\n";
exit;
}
my $threads = $ARGV[2]; #threads
my @ip_team = (); #IP
$|= 1;
my $ip = new Net::IP ("$ARGV[0] - $ARGV[1]") or die "Invalid IP Range.". Net::IP::Error() ."\n";
$SIG{'INT'} = sub {exit;};
my @folders = ("/wordpress/", "/wp/", "/blog/", "/"); # folders
my $stringsearch = "XML-RPC"; # string to search
my $filename = $ARGV[3]; # .txt
my $max_processes = $ARGV[2]; #threads
my $pm = Parallel::ForkManager->new($max_processes); # thread spawner
#Forking
while ($ip) {
push @ip_team, $ip++ ->ip();
if ( $threads == @ip_team ) { Scan(@ip_team); @ip_team = () }
}
Scan(@ip_team);
#Scan
sub Scan
{
my @Pids;
foreach my $ip (@_)
{
my $pid = fork();
die "Can't Fork $!\n" unless defined $pid;
if (0 == $pid)
{
alarm 1;
foreach (@folders) {
my $pid2 - $pm->start and next; #thread
alarm("$ARGV[4]");
my $url = "http://$ip" . "$_" . "xmlrpc.php";
my $ua = LWP::UserAgent->new;
print "\e[96m[!]Search \e[31m$url\n\e[0m";
my $response = $ua->get($url);
if ( !$response->is_success ) {
}
if (head($url)) {
my $parser = HTML::Parser->new( 'text_h' => [ \&text_handler, 'dtext' ] ); #text decoder
$parser->parse( $response->decoded_content );
sub text_handler {
chomp( my $text = shift );
if ( $text =~ /$stringsearch/i ) {
my $ui = $url;
$ui =~ s/xmlrpc.php/?feed=rss2/;
if (head($ui)) {
sub check {
$LOLGETIT=get($ui);
$LOLGETIT =~ /<item>.+?<link>(.+?)<\/link>.+?<\/item>/s;
if ($1) {
open (FILE, ">>$filename");
my $post = $1;
$ui =~ s{\Q?feed=rss2\E}{xmlrpc.php};
print FILE "$ui $post\n";
close (FILE);
print "\e[96m[+]Found : \e[32m$ui $post\e[0m\n";
exec($^X, "-e", "sleep 1,kill(0,$pid2)||kill -9,$pid2"); #kill process
}
}
check();
} else {
} }
}
} else {
}
$pm->finish;
}
exit
}
else
{
push @Pids, $pid
}
}
foreach my $pid (@Pids) { waitpid($pid, 0) }
}Usage perl scan.pl [Start IP] [End IP] [Threads] [.txt] [Delay]
Thanks to Vyp0r i recode his basic Scanner (http://pastebin.com/xYPux8dF)
Please do not forget to say "Thanks" if i helped you
“Don’t walk behind me; I may not lead. Don’t walk in front of me; I may not follow. Just walk beside me and be my friend.” Albert Camus



