Jump to content
daatdraqq

Open port scanner (.pl)

Recommended Posts

Posted
#!/usr/bin/perl

use IO::Socket;
print q
{
r00ta - teh p0rt scannz0r
};
sleep 1;
print "[-] Insert Ip Address: ";
chomp($ip = <STDIN>);
if(!$ip) { print "\n[-] Error!!!"; exit }

print "\n[-] From Port: ";
chomp($from = <STDIN>);
if(!$from) { print "\n[-] Error!!!"; exit }

print "\n[-] To Port: ";
chomp($to = <STDIN>);
if(!$to) { print "\n[-] Error!!!"; exit }

print "\n[-] Ports Open: ";
for($ports = $from; $ports <= $to; $ports++)
{
$xyz = 1;
my $conn = IO::Socket::INET->new(Proto => "tcp",
PeerPort => $ports,
PeerAddr => $ip,
Timeout => 1
) || $xyz++;
close($conn);

chomp($gethost = getservbyport($ports,"tcp"));
if($xyz==1)
{
print "[$ports]\n" ;





}
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...