package NPC::Scan; use strict; sub scan { my @array = ("localhost", "127.0.0.1", "1.1.1.1", "192.168.0.1"); if (exists $array{$_[0]}) { scan1($_[0]); } else { print "$_[0] doesn't exist!\n"; } } sub scan1 { print "Starting Nmap 4.20 ( http://insecure.org ) at $time{'yyyy-mm-dd hh:mm tz'}\n"; if (($_[0] eq "localhost") || ($_[0] eq "127.0.0.1")) { sleep 2; print "Interesting ports on $_[0]\n"; print "Not shown: 1686 closed ports\n"; print "PORT STATE SERVICE\n"; print "22/tcp open ssh\n"; } goto term; }