Advertisement
Quantumzblue

Untitled

Jul 29th, 2019
2,713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 2.14 KB | None | 0 0
  1. use strict;
  2. use warnings;
  3. use Data::Dumper;
  4. use LWP::UserAgent;
  5. #trianing time handle
  6.  
  7. my $browser = LWP::UserAgent->new(
  8. agent => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36',
  9. max_redirect => 1,
  10. timeout => 3,
  11.                             );
  12. my $IP = "http://34.87.";
  13. my $information = 'ipscan.txt';
  14. sub scanIP {
  15. print "\n Entre frist decimal IP:";
  16. chop (my $frist = <stdin>);
  17. for ( $frist ; $frist <254; $frist++) {
  18. my $IP = "http://34.87.$frist";
  19.  
  20. for ( my $i = 1; $i<254; $i++) {
  21. my $resp = $browser->get("$IP.$i");
  22.  
  23. if ($resp->is_error) {
  24.   print "error :$IP.$i\n";
  25.   print $resp->status_line. "\n" ;
  26.  
  27.                                             }
  28.                                             else {
  29.                                               print "connection fail $i \n" ;
  30.                                               if ($resp->is_success && $resp->status_line =~200 ) {
  31.                                                 print $resp->status_line ;
  32.                                               if ($resp->content =~ /xampp/) {
  33.                                                 print "found xamppp\n";
  34.                                                 open (INPUT, '>>' .$information) or die ("[!] Can't create the file to store genName \n"); {
  35.                                                 print INPUT "$IP.$i \n";
  36.                                                 print  "$IP.$i is good \n";
  37.                                                 close (INPUT);
  38.                                               }
  39.                                              }
  40.                                               else {
  41.                                                 print "passed \n ";
  42.                                               }
  43.                                               }
  44.                                               else {
  45.                                                 print "passed \n";
  46.                                               }
  47.                                                   }
  48.                                       }
  49.  
  50.  
  51. }
  52. }
  53.  
  54.  
  55.  
  56. scanIP();
  57. sleep(20);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement