21y4d / nmapAutomator

A script that you can run in the background!
MIT License
2.67k stars 790 forks source link

OS Guess with ping returns Unknown OS for domains #30

Closed 0xpurecha0s closed 3 years ago

0xpurecha0s commented 3 years ago

Before DNS changes were made nmapAutomator used to quickly guess the type of operating system based on the TTL from the server. This functionality still works for IP but doesn't in the case of domains. This is due to the response ping command in the checkPing() function.

Incase of an IP, TTL result is accurate. ping -c 1 -W 3 10.10.20.196 which when cleaned for TTL with ping -c 1 -W 3 10.10.20.196 | grep ttl | cut -d " " -f 6 | cut -d "=" -f 2 gives the accurate TTL 63 in this case but this doesn't return accurate TTL value incase of a domain ping -c 1 -W 3 chocolatefactory.thm | grep ttl | cut -d " " -f 6 | cut -d "=" -f 2 will return the ICMP sequence number 1 in this case. We can bypass this with a simple check to see if this is an IP address.

21y4d commented 3 years ago

Thanks for submitting the issue and the fix. Fix pull request has been merged.