Find other illegal DHCP servers in the Intranet

Source: Internet
Author: User
Very useful Dongdong, platinum brother's work. Today I need to post a blog to facilitate searching. haha .... because the DHCP protocol is Layer 2, the source and destination IP addresses of the illegal DHCP server in the network cannot be found. If there are multiple DHCP servers in the network at the same time, however, if your switch does not prevent the release of the DHCP protocol, this network is very dangerous (this is also the case in my community. If I set up something useful, platinum's work. Today I need to post a blog to facilitate searching. haha ....

 

 

Because the DHCP protocol is Layer 2, the source and destination IP addresses of the illegal DHCP server in the network cannot be found.


If there are multiple DHCP servers in the network at the same time, and your switch does not prevent the release of the DHCP protocol, this network is very dangerous (this is also the case in my community, if DHCP is set up, I will see/var/lib/dhcp/dhcpd. leases sees many assigned IP addresses)

We can use tcpdump to capture packets to determine the MAC of the other Party. If MAC is available, it will be easy.

Under normal circumstances, tcpdump captures three layers of packages. Only the IP header and other four-layer headers (such as TCP/UDP) can be seen)

Tcpdump has a-e parameter.

-E Print the link-level header on each dump line.

This is the key, and another key part is port, because the dhcp protocol will use UDP/67. It's easy to understand these two points. Capture packets and check the MAC.

If you have a MAC address, you can use arp-n to view its IP address. Next, block the MAC address on the gateway and let him "surrender". ^_^

[Root @ platinum root] # tcpdump-e-I eth1-nn port 67-c 3 2> & 1 | awk '/bootp/{print $2 "-->" $3 }'
0: 0c: 85: ad: e5: af --> ff: ff
E7: 0a: 19: 80: 03: 09 --> 0: 0c: 85: ad: e5: af
0: 0c: 85: ad: e5: af --> e7: 0a: 19: 80: 03: 09
[Root @ platinum root] #

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.