Created
July 5, 2017 07:30
-
-
Save mschmitt/5ff9c25f1e403ec3dd890b8d44a37aba to your computer and use it in GitHub Desktop.
Single line portscanner in Perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -MIO::Socket::INET -e 'open I,"</etc/services";while(<I>){ | |
(/^\s*($|#)/)&&next;($n,$p,@j)=split/\s+/;($p=~s/\/tcp//)||next; | |
$s=IO::Socket::INET->new(PeerAddr=>$ARGV[0], PeerPort=>$p,Proto=>'tcp')? | |
print"$n($p)-->Open\n":next}' 192.168.12.34 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment