Guest User

Custom 404 Page Finder

a guest
Oct 16th, 2011
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.92 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # Custom 404 Page Finder
  3. # written by localh0t
  4. # Follow: @mattdch
  5. # www.localh0t.com.ar
  6. use HTTP::Request;
  7. use LWP::UserAgent;
  8.  
  9. if(!$ARGV[2])
  10.     {
  11.          print "\n\n[!] Use: perl $0 [WEBSITE] [DIRS FILE] [PATTERN OF CUSTOM 404 ERROR PAGE]\n";
  12.          print "Ex: perl $0 http://website.com hiddens_dirs.txt \"Error de 404\"\n\n";
  13.          exit (0);
  14.     }
  15.    
  16. my ($website, $list, $custom) = @ARGV;
  17.  
  18. $agent = LWP::UserAgent->new;
  19. $agent->agent("Google Bot");
  20.  
  21. if ( $website   !~   /^http:/ )
  22.   {
  23.       $website = "http://" . $website;
  24.   }
  25. print "\n[!] Scanning $website...\n";
  26. open(DIRS,"<".$list) || die "\n[-] File not found ($list)\n\n";
  27. foreach $dir(<DIRS>)
  28. {
  29.     $trydir = $agent->request(HTTP::Request->new(GET => $website."/".$dir));
  30.     $response = $trydir->content();
  31.     if ($response !~ /$custom/)
  32.     {
  33.         print "[+] Found!: $website/$dir";
  34.     }
  35. }
  36. close(DIRS);
  37. exit(0);
  38.  
  39. __END__
  40.  
  41.  
Advertisement
Add Comment
Please, Sign In to add comment