Code: Select all
$ nmblookup -A [HOST_IP]
Code: Select all
Looking up status of 192.168.1.7
PHONOSRV-TEST <00> - B <ACTIVE>
PHONOTHEK <00> - <GROUP> B <ACTIVE>
PHONOSRV-TEST <03> - B <ACTIVE>
PHONOSRV-TEST <20> - B <ACTIVE>
PHONOTHEK <1e> - <GROUP> B <ACTIVE>
MAC Address = 00-0C-29-60-71-61
Code: Select all
$ sudo nmap -n -sn 192.168.1.0/24 | grep "scan report" | cut -d ' ' -f 5
It returns a list of IPs of hosts that are currently turned on and connected to that subnet.
Using BASH-Foo, you can use the following command to scan and resolve in one step:
Code: Select all
$ for IP in $(sudo nmap -n -sn 192.168.100.0/24 | grep "scan report" | cut -d ' ' -f 5); do nmblookup -A $IP; done