Skip to content

Instantly share code, notes, and snippets.

@chadlavi
Created April 2, 2017 03:12
Show Gist options
  • Save chadlavi/8d0187b5fe79a663e0381fa1514d8830 to your computer and use it in GitHub Desktop.
Save chadlavi/8d0187b5fe79a663e0381fa1514d8830 to your computer and use it in GitHub Desktop.
bash one-liner to get IPs of all the machines on local network that have ssh running and open
nmap -sV -p 22 192.168.0.1-254 | grep 'open\s*ssh' -B 3 | grep 192 | awk '{print $NF}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment