ICMP protocol for TCP/IP stack reinforcement of Unix operating systems

Source: Internet
Author: User

TCP/IP stackProcesses incoming and outgoing IP data packets, and routes the data packets to the application that processes the data. Due to its own defects, the openness of the network, and hacker attacks are the main reasons for the security of the interconnected network. TCP/IP, as a standard protocol set used by the Internet, is a key target for hackers to conduct network attacks.

ICMPIs a messenger dedicated to logical errors and diagnostics. RFC792 describes it in detail. Any IP network device can send, receive, or operate ICMP messages. Although the ICMP designers did not consider the security issues today, they have designed some basic principles that can make ICMP more effective.

To ensure that ICMP messages do not overwhelm the IP network, ICMP has no special priority and is always a common traffic.

ICMP messages are sent as responses to other ICMP messages. This mechanism is designed to prevent the occurrence of an error message from repeatedly producing another error message. Otherwise, it is really a big problem.

ICMP cannot be sent as a response to multicast or broadcast traffic.

ICMP attacks include:

The destination cannot arrive attack is a denial of service attack: the ICMP Destination cannot arrive at the message and provides a tool to notify the sender of the attempt to forward the message: because the host specified in the datagram destination address cannot be reached, the message cannot be transmitted.

Smurf attacks are denial-of-service attacks: Smurf attacks are a terrible form of denial-of-service attacks because of their amplification effect. Smurf attacks use ICMP to respond to messages.

1. Disable ICMP echo broadcast Activity

 
 
  1. AIX 5
  2.  
  3. # No-oDirected_broadcast=0 
  4.  
  5. FreeBSD 5-7
  6.  
  7. # Sysctl-wNet. inet. icmp. bmcastecho=0 
  8.  
  9. HP-UX 10
  10.  
  11. # Ndd-set/dev/ip ip_respond_to_echo_broadcast 0
  12.  
  13. # Ndd-set/dev/ip ip_forward_directed_broadcasts 0
  14.  
  15. Linux2.4-2.6 # sysctl-w net. ipv4.icmp _ echo_ig #Nore_broadcasts=1 
  16.  
  17. The OpenBSD3-4 is already the default setting
  18.  
  19. Solaris 8-10
  20.  
  21. # Ndd-set/dev/ip ip_respond_to_echo_broadcast 0
  22.  
  23. # Ndd-set/dev/ip ip6_respond_to_echo_multicast 0
  24.  
  25. # Ndd-set/dev/ip ip_forward_directed_broadcasts 0

Otherwise, your system may become a tool for Smurf attackers. The Smurf attack is named after the program that initially launched the attack "Smurf. In combination with IP Spoofing and ICMP reply, this attack method floods a large amount of network transmission to the target system, causing the target system to refuse to serve the normal system.

Smurf attacks flood the victim host by setting the reply address to the ICMP Response Request (ping) packet of the broadcast address of the victim network, eventually, all hosts on the network will reply to this ICMP Response Request, resulting in network congestion. The more complex Smurf changes the source address to a third-party victim, resulting in a third-party crash.

2. Disable ICMP route redirection

 
 
  1. AIX5  
  2.  
  3. #no -o ipig#noreredirects=1 
  4.  
  5. #no -o ipsendredirects=0 
  6.  
  7. FreeBSD 5-7  
  8.  
  9. #sysctl -w net.inet.ip.redirect=0 
  10.  
  11. #sysctl -w net.inet.ip6.redirect=0 
  12.  
  13. HP-UX 10  
  14.  
  15. #ndd -set /dev/ip ip_send_redirects  
  16.  
  17. 0#ndd -set /dev/ip ip_forward_directed_broadcasts 0  
  18.  
  19. Linux2.4-2.6  
  20.  
  21. #sysctl -w net.ipv4.conf.all.accept_redirects=0 
  22.  
  23. #sysctl -w net.ipv6.conf.all.accept_redirects=0 
  24.  
  25. #sysctl -w net.ipv4.conf.all.send_redirects=0 
  26.  
  27. #sysctl -w net.ipv6.conf.all.send_redirects=0 
  28.  
  29. OpenBSD3-4  
  30.  
  31. #sysctl -w net.inet.icmp.rediraccept=0 
  32.  
  33. #sysctl -w net.inet6.icmp6.rediraccept=0 Solaris 8-10  
  34.  
  35. #ndd -set /dev/ip ip_ig#nore_redirect 1  
  36.  
  37. #ndd -set /dev/ip ip6_ig#nore_redirect 1  
  38.  
  39. #ndd -set /dev/ip ip_send_redirects 0  
  40.  
  41. #ndd -set /dev/ip ip6_send_redirects 0 

Otherwise, your system may be vulnerable to route table errors.

3. Disable ICMP broadcast Detection

 
 
  1. AIX5
  2.  
  3. # No-oIcmpaddressmask=0 
  4.  
  5. FreeBSD 5-7
  6.  
  7. # Sysctl-wNet. inet. icmp. maskrepl=0 
  8.  
  9. HP-UX 10
  10.  
  11. # Ndd-set/dev/ip ip_respond_to_address_mask_broadcast 0
  12.  
  13. # Ndd-set/dev/ip ip_respond_to_timestamp_broadcast 0
  14.  
  15. Linux2.4-2.6
  16.  
  17. # Sysctl-wNet. ipv4.icmp _ echo_ignore_broadcasts=1 
  18.  
  19. The OpenBSD3-4 is already the default setting
  20.  
  21. Solaris8-10
  22.  
  23. # Ndd-set/dev/ip ip_respond_to_address_mask_broadcast 0
  24.  
  25. # Ndd-set/dev/ip ip_respond_to_timestamp_broadcast

The attack content of the ICMP protocol has been introduced to you, and we hope you have mastered it. We will continue to introduce it to you in future articles.

  1. UNIX System Security Crisis assessment
  2. Take targeted measures to ensure the security of Unix servers
  3. Analysis of the inevitability of Unix host System Security Vulnerabilities

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.