Quick Scanner (Host/Port)

Posted by root Sun, 28 Sep 2008 19:09:00 GMT

#!/usr/bin/ruby

host_port = ARGV[0]
host = host_port.split(':').first
port = host_port.split(':').last

puts %x[nmap -p #{port} #{host}]
Or just:
#!/usr/bin/ruby

host, port = ARGV[0].split(':')

puts %x[nmap -p #{port} #{host}]
Usage (cli and given that the script is named scan_proxy):
./scan_proxy 202.105.182.87:808

Posted in ,  | Tags  | no comments | no trackbacks