How to do it...

Open a terminal and enter the following command:

# nmap --script broadcast -e <interface>  

Note that broadcast scripts can run without setting a specific target. All the NSE scripts that found information will be included in your scan results:

# nmap --script broadcast -e eth0    Pre-scan script results:    | broadcast-dhcp-discover:     |   Response 1 of 1:     |     IP Offered: 192.168.0.13    |     Subnet Mask: 255.255.255.0    |     Router: 192.168.0.1    |     Server Identifier: 192.168.0.1    |_    Domain Name Server: 200.79.231.5, 200.79.231.6    | broadcast-igmp-discovery:     |   192.168.0.3    |     Interface: ens33    |     Version: 2    |     Group: 224.0.0.251    |     Description: mDNS    |   192.168.0.3    |     Interface: ens33    |     Version: 2    |     Group: 239.255.255.250  | Description: ...

Get Nmap: Network Exploration and Security Auditing Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.