Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use warnings;
- use Data::Dumper;
- use LWP::UserAgent;
- #trianing time handle
- my $browser = LWP::UserAgent->new(
- agent => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36',
- max_redirect => 1,
- timeout => 3,
- );
- my $IP = "http://34.87.";
- my $information = 'ipscan.txt';
- sub scanIP {
- print "\n Entre frist decimal IP:";
- chop (my $frist = <stdin>);
- for ( $frist ; $frist <254; $frist++) {
- my $IP = "http://34.87.$frist";
- for ( my $i = 1; $i<254; $i++) {
- my $resp = $browser->get("$IP.$i");
- if ($resp->is_error) {
- print "error :$IP.$i\n";
- print $resp->status_line. "\n" ;
- }
- else {
- print "connection fail $i \n" ;
- if ($resp->is_success && $resp->status_line =~200 ) {
- print $resp->status_line ;
- if ($resp->content =~ /xampp/) {
- print "found xamppp\n";
- open (INPUT, '>>' .$information) or die ("[!] Can't create the file to store genName \n"); {
- print INPUT "$IP.$i \n";
- print "$IP.$i is good \n";
- close (INPUT);
- }
- }
- else {
- print "passed \n ";
- }
- }
- else {
- print "passed \n";
- }
- }
- }
- }
- }
- scanIP();
- sleep(20);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement