SSH Scanner & Banner Grabber



Bom Dia Senhores!!
- Segue uma ótima aplicação para encontrar serviços SSH ativos .

#!/usr/bin/perl
$found = 0;
$num = 0;
use IO::Socket::INET;
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;
}
$port=22;
$file="OutSSH.txt";
while(1==1){
$target = &ipgen();
my $sock = new IO::Socket::INET (
PeerAddr => $target,
PeerPort => $port,
Proto => 'tcp',
Timeout => '2',
);
system("cls");
$num = $num+1;
print q{
  ____ ____  _   _  
/ ___/ ___|| | | |  ___  ___ __ _ _ __
\___ \___ \| |_| | / __|/ __/ _` | '_ \
  ___) |__) |  _  | \__ \ (_| (_| | | | |
|____/____/|_| |_| |___/\___\__,_|_| |_|
  SSH Scanner & Banner Grabber
};
print "Found:$found Scanning Port:$port\n";
print "IPs Scanned:$num\n";
if($sock){
$sssh = IO::Socket::INET->new(PeerAddr=>$target,PeerPort=>$port,Timeout=>"2");
    if ($sssh) {
   while (<$sssh>) {
  $banner=$_;
  close($sssh);
  }
    }
if (!defined($banner)){
$banner="Dead Port";
}
$found = $found+1;
open(DAT, ">>$file") || die("Cannot Open Output File");
print DAT "$target : $banner\n";
close(DAT);
}
close($sock);
}
SSH Scanner & Banner Grabber SSH Scanner & Banner Grabber Reviewed by Kembolle Amilkar on quinta-feira, dezembro 13, 2012 Rating: 5

Nenhum comentário