Skip to content

Instantly share code, notes, and snippets.

@avraampiperidis
Created June 18, 2013 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avraampiperidis/5809127 to your computer and use it in GitHub Desktop.
Save avraampiperidis/5809127 to your computer and use it in GitHub Desktop.
nmap scan
#!/usr/bin/perl
# usage .txt file with ip - hostnames one per line
#requires root
my @ports = (20, 21, 22, 80, 443, 445); #add tcp ports here.
print "\nService version 7 status\n";
print "\===============================\n";
while (defined($ipaddr = <>)) {
chomp ($ipaddr);
print "$ipaddr:\n\n";
$nmap = "echo QUIT | nmap -sS -O $ipaddr $ports";
system ("$nmap");
print "=================================================\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment