Advertisement
AssazziN

Scan Directory

Mar 19th, 2013
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.59 KB | None | 0 0
  1. use LWP::UserAgent;
  2. print "Scan Directory\n[+] Target \"www.xxx.xxx\" : ";
  3. chomp($domain=<STDIN>);
  4. unless ($domain=~/http:\/\//) {
  5.     $domain='http://'.$domain;
  6. }
  7. print "Scan Directory : ",$domain,"\n";
  8. $agent=LWP::UserAgent->new;
  9. $agent->max_redirect(0);
  10. open(FILE,"dir.txt");
  11. @dir=<FILE>;
  12. close(FILE);
  13. foreach (@dir) {
  14.     chomp;
  15.     $url=$domain.'/'.$_;
  16.     $response=$agent->head($url);
  17.     print "[] Scan : $url";
  18.     unless ($response->status_line=~/^404|^302/) {
  19.         print "   .....   ",$response->status_line;
  20.     }
  21.     print "\n";
  22. }
  23.  
  24. #http://comfreedom.blogspot.com/2011/02/perl-scan-directory.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement