###########################

# [pl] SSH Scanner perl script

###########################

#!/usr/bin/perl
#########################################
#
#    /!\ C O M M A N D S /!\
#
#       perl scanner.pl
#
#  Check ssh.txt for ssh devices.
#
#
#    /!\ C R E D I T S /!\
#
#   Chris Poole | @codingplanets
#
#  Not intended for illegal use.
#########################################
use IO::Socket;
sub ipgen(){
my $range1 = 223;
my $range2 = 254;              
$oct1 = int(rand($range1)) + 1;
$oct2 = int(rand($range2)) + 1;
$oct3 = int(rand($range2)) + 1;
$oct4 = int(rand($range2)) + 1;

if($oct1 == 127 || $oct1 == 172 || $oct1 == 192 || $oct1 == 10){
$ip = &ipgen();
}else{
$ip = "$oct1.$oct2.$oct3.$oct4";
}
return $ip;  
}
print " ____________________________________\n";
print "|                                    |\n";
print "|            R A N D O M             |\n";
print "|                                    |\n";
print "|        S S H  S C A N N E R        |\n";
print "|____________________________________|\n";
print " ____________________________________\n";
print "|                                    |\n";
print "|          C O D E D  B Y            |\n";
print "|                                    |\n";
print "|     Chris Poole | codingplanets    |\n";
print "|____________________________________|\n";

while(1==1){
$target = &ipgen();
print "[!] Scanning -> $target \n";
my $sock = new IO::Socket::INET (
                 PeerAddr => $target,
                 PeerPort => '22',
                 Proto => 'tcp',
                 Timeout => '3',
                 );
if($sock){
print "[!] SUCCESS -> $target \n";
open(DAT, ">>ssh.txt") || die("Cannot Open Output File");
print DAT "SUCCESS: $target \n";
close(DAT);
}
close($sock);
}

###########################

# Iranian Exploit DataBase = http://IeDb.Ir [2016-12-17]

###########################