Skip to content

Instantly share code, notes, and snippets.

@bixu
Last active August 29, 2015 14:09
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 bixu/641b0d22f3353b846726 to your computer and use it in GitHub Desktop.
Save bixu/641b0d22f3353b846726 to your computer and use it in GitHub Desktop.
scan for open public ssh ports on your hosts
#!/bin/bash
ip_list=$(knife joyent server list | awk '{print $7}' | cut -d"," -f 1 | grep -v "10.*\|192.168.*\|172.16.*")
for ip in $ip_list
do nmap -A -T4 -F $ip
done | grep "Nmap scan report\|ssh"
@bixu
Copy link
Author

bixu commented Nov 13, 2014

If you're not using knife and the knife-joyent gem/plugin for knife, then you'll probably want to customize line 3.

You should be able to run this directly from this Gist by doing https://gist.githubusercontent.com/bixu/641b0d22f3353b846726/raw/public_ssh_scan.sh | bash -s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment