Posted at

How to check DHCP server information

More than 1 year has passed since last update.


Prerequiste


  • nmap

yum install nmap

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.nara.wide.ad.jp
* elrepo: ftp.yz.yamagata-u.ac.jp
* epel: ftp.jaist.ac.jp
* epel-debuginfo: ftp.jaist.ac.jp
* epel-source: ftp.jaist.ac.jp
* extras: ftp.nara.wide.ad.jp
* updates: ftp.yz.yamagata-u.ac.jp
Resolving Dependencies
--> Running transaction check
---> Package nmap.x86_64 2:6.40-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

Installing:
nmap x86_64 2:6.40-7.el7 base 4.0 M

Transaction Summary
Install 1 Package

Total download size: 4.0 M
Installed size: 16 M
Is this ok [y/d/N]: y
Downloading packages:
nmap-6.40-7.el7.x86_64.rpm | 4.0 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 2:nmap-6.40-7.el7.x86_64 1/1
Verifying : 2:nmap-6.40-7.el7.x86_64 1/1
Installed:
nmap.x86_64 2:6.40-7.el7
Complete!


How to check


  • nmap --script broadcast-dhcp-discover

nmap --script broadcast-dhcp-discover

Starting Nmap 6.40 ( http://nmap.org ) at 2018-04-13 09:47 JST
Pre-scan script results:
| broadcast-dhcp-discover:
| IP Offered: XXX.XXX.XXX.XXX
| DHCP Message Type: DHCPOFFER
| Server Identifier: YYY.YYY.YYY.YYY
| IP Address Lease Time: 0 days, 0:05:00
| Subnet Mask: 255.255.255.0
| Time Offset: 32400
| Router: ZZZ.ZZZ.ZZZ.ZZZ
| Domain Name Server:
| Domain Name:
| Broadcast Address:
|_ NTP Servers:
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.23 seconds