Skip to content

Instantly share code, notes, and snippets.

@gfoss
Created August 28, 2013 19:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gfoss/6370442 to your computer and use it in GitHub Desktop.
Save gfoss/6370442 to your computer and use it in GitHub Desktop.
OS-detection. Run this nmap command to count OS's and view the os.txt output file to see the results per-system.
$ sudo nmap -F -O [IP-RANGE] | grep "scan report\|Running: " > os.txt; echo "$(cat os.txt | grep Apple | wc -l) OS X devices"; echo "$(cat os.txt | grep Linux | wc -l) Linux devices"; echo "$(cat os.txt | grep Windows | wc -l) Windows devices"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment