Com base em esta resposta , supondo que você tenha instalado o nmap ( sudo apt install nmap
):
sudo nmap --script broadcast-dhcp-discover
Adicione a opção -e $interface
se você tiver mais de uma interface de rede. (Por exemplo: nmap --script broadcast-dhcp-discover -e eth0
)
Exemplo de saída:
Starting Nmap 7.01 ( https://nmap.org ) at 2017-09-27 17:40 CEST
Pre-scan script results:
| broadcast-dhcp-discover:
| Response 1 of 1:
| IP Offered: 192.168.81.94
| DHCP Message Type: DHCPOFFER
| Server Identifier: 192.168.81.2
| IP Address Lease Time: 5m00s
| Subnet Mask: 255.255.255.0
| Router: 192.168.81.2
| Domain Name Server: 192.168.81.2
| Domain Name: example.lan
| NTP Servers: 192.168.81.10, 192.168.81.2
| NetBIOS Name Server: 192.168.81.10
|_ NetBIOS Node Type: 8
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.66 seconds
Ou esta saída em uma rede diferente, com o nmap v. 6:
Starting Nmap 6.00 ( http://nmap.org ) at 2017-09-27 17:42 CEST
Pre-scan script results:
| broadcast-dhcp-discover:
| IP Offered: 192.168.4.101
| DHCP Message Type: DHCPOFFER
| Server Identifier: 192.168.4.1
| IP Address Lease Time: 7 days, 0:00:00
| Subnet Mask: 255.255.255.0
| Time Offset: 7200
| Router: 192.168.4.1
| Domain Name Server: 208.91.112.53, 208.91.112.52
| Renewal Time Value: 3 days, 12:00:00
|_ Rebinding Time Value: 6 days, 3:00:00
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 1.15 seconds