Advertisement
Guest User

Custom 404 Page Finder

a guest
Oct 16th, 2011
226
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. # Contact: mattdch0@gmail.com
  5. # Follow: @mattdch
  6. # www.localh0t.com.ar
  7. use HTTP::Request;
  8. use LWP::UserAgent;
  9.  
  10. if(!$ARGV[2])
  11.     {
  12.          print "\n\n[!] Use: perl $0 [WEBSITE] [DIRS FILE] [PATTERN OF CUSTOM 404 ERROR PAGE]\n";
  13.          print "Ex: perl $0 http://website.com hiddens_dirs.txt \"Error de 404\"\n\n";
  14.          exit (0);
  15.     }
  16.    
  17. my ($website, $list, $custom) = @ARGV;
  18.  
  19. $agent = LWP::UserAgent->new;
  20. $agent->agent("Google Bot");
  21.  
  22. if ( $website   !~   /^http:/ )
  23.   {
  24.       $website = "http://" . $website;
  25.   }
  26. print "\n[!] Scanning $website...\n";
  27. open(DIRS,"<".$list) || die "\n[-] File not found ($list)\n\n";
  28. foreach $dir(<DIRS>)
  29. {
  30.     $trydir = $agent->request(HTTP::Request->new(GET => $website."/".$dir));
  31.     $response = $trydir->content();
  32.     if ($response !~ /$custom/)
  33.     {
  34.         print "[+] Found!: $website/$dir";
  35.     }
  36. }
  37. close(DIRS);
  38. exit(0);
  39.  
  40. __END__
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement