Docsity

Analysis of Common Network Attack Methods, Appunti di Fondamenti di informatica

Toggle sidebar
bg1
Analysis of Common Network Attack Methods
1.1 TCP SYN Denial-of-Service Attack
Generally, establishing a TCP connection requires a three-way handshake:
1. The initiator sends a TCP SYN packet to the target computer;
2. Upon receiving the SYN packet, the target computer creates a TCP connection control
block (TCB) in memory and sends a TCP ACK packet back to the initiator, waiting for a
response;
3. Upon receiving the TCP ACK packet, the initiator responds with an ACK packet, thus
establishing the TCP connection.
Using this process, malicious attackers can launch a so-called TCP SYN
denial-of-service attack:
1. The attacker sends a TCP SYN packet to the target computer;
2. Upon receiving the packet, the target computer establishes a TCP connection control
block (TCB) and responds with an ACK packet, waiting for a response from the initiator;
3. The initiator, however, does not respond with an ACK packet to the target computer,
causing the target computer to remain in a waiting state. As can be seen, if the target
computer receives a large number of TCP SYN packets but does not receive a third ACK
response from the initiator, it will wait indefinitely. If there are many half-open
connections in this awkward state, it will exhaust the target computer's resources (TCB
control structure, which is generally finite) and prevent it from responding to normal TCP
connection requests.
1.2 ICMP Flood
Under normal circumstances, for network diagnostics, some diagnostic programs, such
as PING, will send ICMP ECHO response messages. The receiving computer, upon
receiving an ICMP ECHO, will respond with an ICMP ECHO Reply message. This
process requires CPU processing and can sometimes consume significant resources,
such as when processing network fragments. Therefore, if an attacker sends a large
number of ICMP ECHO messages to the target computer (creating an ICMP flood), the
target computer will be busy processing these ECHO messages and unable to continue
processing other network data packets. This is also a type of Denial-of-Service (DoS)
pf3
pf4
pf5
pf8
pf9
pfa

Anteprima parziale del testo

Scarica Analysis of Common Network Attack Methods e più Appunti in PDF di Fondamenti di informatica solo su Docsity!

Analysis of Common Network Attack Methods

1.1 TCP SYN Denial-of-Service Attack Generally, establishing a TCP connection requires a three-way handshake:

  1. The initiator sends a TCP SYN packet to the target computer;
  2. Upon receiving the SYN packet, the target computer creates a TCP connection control block (TCB) in memory and sends a TCP ACK packet back to the initiator, waiting for a response;
  3. Upon receiving the TCP ACK packet, the initiator responds with an ACK packet, thus establishing the TCP connection. Using this process, malicious attackers can launch a so-called TCP SYN denial-of-service attack:
  4. The attacker sends a TCP SYN packet to the target computer;
  5. Upon receiving the packet, the target computer establishes a TCP connection control block (TCB) and responds with an ACK packet, waiting for a response from the initiator;
  6. The initiator, however, does not respond with an ACK packet to the target computer, causing the target computer to remain in a waiting state. As can be seen, if the target computer receives a large number of TCP SYN packets but does not receive a third ACK response from the initiator, it will wait indefinitely. If there are many half-open connections in this awkward state, it will exhaust the target computer's resources (TCB control structure, which is generally finite) and prevent it from responding to normal TCP connection requests. 1.2 ICMP Flood Under normal circumstances, for network diagnostics, some diagnostic programs, such as PING, will send ICMP ECHO response messages. The receiving computer, upon receiving an ICMP ECHO, will respond with an ICMP ECHO Reply message. This process requires CPU processing and can sometimes consume significant resources, such as when processing network fragments. Therefore, if an attacker sends a large number of ICMP ECHO messages to the target computer (creating an ICMP flood), the target computer will be busy processing these ECHO messages and unable to continue processing other network data packets. This is also a type of Denial-of-Service (DoS)

attack. 1.3 UDP Flood Similar in principle to ICMP flood, attackers send a large number of UDP packets to the target computer, causing the target computer to be busy processing these UDP packets and unable to continue processing normal packets. 1.4 Port Scanning According to the TCP protocol specification, when a computer receives a TCP connection establishment request packet (TCP SYN), it processes it as follows:

  1. If the requested TCP port is open, it responds with a TCP ACK packet and establishes a TCP connection control structure (TCB);
  2. If the requested TCP port is not open, it responds with a TCP RST packet (the RST flag in the TCP header is set to 1), informing the initiating computer that the port is not open. Accordingly, if the IP protocol stack receives a UDP packet, it processes it as follows:
  3. If the destination port of the packet is open, the UDP packet is forwarded to the upper-layer protocol (UDP) for processing, without responding with any packet (except for packets that the upper-layer protocol responds to based on the processing result);
  4. If the destination port of the packet is not open, an ICMP unreachable message is responded to the initiator, informing the initiator computer that the port of the UDP packet is unreachable. Using this principle, an attacker's computer can determine which TCP or UDP ports are open on a target computer by sending appropriate packets. The process is as follows:
  5. Send TCP SYN or UDP packets with port numbers starting from 0 and incrementing sequentially (port numbers are 16-bit numbers, so the maximum is 65535, which is a limited number);
  6. If an RST packet is received for this TCP packet, or an ICMP unreachable packet is received for this UDP packet, it means that the port is not open;
  7. Conversely, if an ACK packet is received for this TCP SYN packet, or no ICMP packet is received for this UDP packet, it means that the TCP port is open, and the UDP port may be open (because some implementations may not respond to ICMP unreachable packets even if the UDP port is not open).

1.7 Attacks with TCP Packets Without Flags Normally, any TCP packet sets at least one of the five flags: SYN, FIN, ACK, RST, and PSH. The first TCP packet (a TCP connection request packet) sets the SYN flag, and subsequent packets set the ACK flag. Some protocol stacks, based on this assumption, lack a process for handling TCP packets without flags. Therefore, such a protocol stack may crash if it receives such a packet. Attackers exploit this feature to attack the target computer. 1.8 TCP Packet Attack with FIN Flag Set but No ACK Flag Set Normally, the ACK flag is set in all packets except the first one (SYN packet), including TCP connection teardown packets (packets with the FIN flag set). However, some attackers may send TCP packets with the FIN flag set but no ACK flag set to the target computer, potentially causing the target computer to crash. 1.9 The Death of PING The TCP/IP specification requires IP packet length to be within a certain range (e.g., 0-64K), but some attacking computers may send PING packets longer than 64K to the target computer, causing the target computer's IP protocol stack to crash. 1.10 Address Guessing Attack Similar to port scanning attacks, attackers send a large number of ICMP ECHO packets with changing target addresses to determine if the target computer exists. If a corresponding ECMP ECHO REPLY packet is received, it means the target computer exists, and further attacks can be launched against that computer. 1.11 Teardrop Attack Large IP packets need to be fragmented for transmission to meet the MTU (Maximum Transmission Unit) requirements of the link layer. For example, a 4500-byte IP packet, when transmitted over a link with an MTU of 1500, needs to be divided into three IP packets. The IP header contains an offset field and a fragmentation flag (MF). If the MF flag is set to 1, it indicates that the IP packet is a fragment of a larger IP packet, and the offset field indicates the position of this fragment within the entire IP packet. For example, when fragmenting a 4500-byte IP packet (MTU 1500), the offset field values for the three fragments are 0, 1500, and 3000, respectively. The receiving end can then successfully reassemble the IP packet based on this information.

If an attacker breaks this normal procedure by setting the offset field to an incorrect value —that is, by allowing overlapping or broken values—it could cause the target operating system to crash. For example, setting the offset to 0, 1300, and 3000. This is known as a teardrop attack. 1.12 IP Packets with Source Routing Options To implement additional functions, the IP protocol specification added an options field to the IP header. This field can selectively carry data to instruct intermediate devices (routers) or the final destination computer to perform additional processing on these IP packets. Source routing options are one such option. As the name suggests, the purpose of source routing options is to instruct intermediate devices (routers) how to forward the data packet, that is, to explicitly specify the packet's transmission path. For example, to explicitly route an IP packet through three routers R1, R2, and R3, the interface addresses of these three routers can be explicitly specified in the source routing options. Thus, regardless of the routing tables on the three routers, the IP packet will pass through R1, R2, and R3 sequentially. Furthermore, the source address and destination address of these IP packets with source routing options change continuously during transmission. Therefore, by properly configuring source routing options, attackers can forge legitimate IP addresses and infiltrate the network. 1.13 IP Packets with Record Routing Options The Record Routing Option is also an IP option. IP packets carrying this option have their interface addresses entered into the option field by each router they pass through. Thus, when these packets reach their destination, the option data records the entire path the packet traversed. Such packets make it easy to determine the path the packet took, allowing attackers to easily find vulnerabilities. 1.14 IP Packets with Unknown Protocol Fields The IP packet header contains a protocol field that indicates the protocol carried by the IP packet. For example, a value of 1 indicates ICMP, 6 indicates TCP, and so on. Currently, the assigned values for this field are all less than 100. Therefore, an IP packet with a protocol field greater than 100 may be invalid and could potentially corrupt the protocol stack of some computer operating systems.

The LAND attack exploits the TCP connection establishment three-way handshake process. It attacks a target computer by sending a TCP SYN packet (connection establishment request packet). Unlike a normal TCP SYN packet, the source and destination IP addresses of the LAND attack packet are the same—the target computer's IP address. Upon receiving this SYN packet, the target computer sends an ACK packet to the source address of the packet and establishes a TCP connection control structure (TCB). Since the source address of the SYN packet is itself, the ACK packet is sent to itself. If an attacker sends enough SYN packets, the target computer's TCB (Transmission Control Block) may be exhausted, eventually leading to service failure. This is also a type of DoS attack. 1.18 Script/ActiveX Attacks A script is an executable script, typically written in a scripting language such as Java Script or VB Script. These scripts require a dedicated interpreter to translate them into computer instructions before running on the local computer. The advantage of this type of script is that it allows for the completion of a large amount of functionality with a small amount of programming. An important application of this type of script is embedding it within web pages to perform functions that static web page markup languages (HTML) cannot accomplish, such as local calculations, database queries and modifications, and the extraction of system information. While these scripts offer convenience and powerful functionality, they also provide attackers with convenient attack methods. If an attacker writes malicious scripts and embeds them in web pages, once these pages are downloaded locally, the computer executes these scripts with the current user's privileges. This means the script can use any privileges the current user has, making the damage incredibly powerful. This is known as a script attack. ActiveX is a type of control object built on Microsoft's Component Object Model (COM), which is essentially the foundation of the Windows operating system. Simply put, these control objects consist of methods and properties; methods are operations, and properties are specific data. These control objects can be loaded by applications, which can then access their methods or properties to perform specific functions. COM provides a binary compatibility model (binary compatibility means that program modules are independent of the compilation environment and even the operating system). However, it's important to note that these object controls cannot execute themselves because they don't have their own process space. They can only be loaded by other processes, which then call their methods and properties. In this case, the controls run in the process space of the loading process, similar to loadable modules in an operating system, such as DLL libraries. ActiveX controls can be embedded in web pages. When a browser downloads these pages to its local machine, it also downloads the embedded ActiveX controls. These

controls can then run in the local browser's process space (ActiveX controls do not have their own process space and can only be loaded and called by other processes). Therefore, the destructive power of ActiveX controls depends on the user's privileges. If a malicious attacker writes an ActiveX control containing malicious code and embeds it in a web page, and a user downloads and executes it, the destructive effect can be enormous. This is known as an ActiveX attack. 1.19 Smurf Attack ICMP ECHO request packets are used for network diagnostics. When a computer receives such a message, it responds with an ICMP ECHO REPLY to the source address of the message. Normally, the computer does not check the source address of the ECHO request. Therefore, if a malicious attacker sets the source address of the ECHO to a broadcast address, the computer will use the broadcast address as the destination address when responding with a REPLY, thus requiring all computers on the local network to process these broadcast messages. If an attacker sends a sufficient number of ECHO request messages, the resulting REPLY broadcast messages can overwhelm the entire network. This is known as a smurf attack. Besides setting the source address of ECHO messages to a broadcast address, an attacker might also set the source address to a subnet broadcast address, potentially affecting computers on that subnet. 1.20 Virtual Terminal Exhaustion (VTY) Attack This is an attack targeting network devices such as routers and switches. These network devices typically have TELNET user interfaces for remote management, allowing users to manage them via TELNET. Generally, the number of TELNET user interfaces on these devices is limited, for example, 5 or 10. If an attacker simultaneously establishes 5 or 10 TELNET connections to the same network device, all the remote management interfaces will be occupied. Legitimate users attempting to remotely manage these devices will fail due to the TELNET connection resources being exhausted. 1.21 Routing Protocol Attacks Network devices often use dynamic routing protocols to exchange routing information. These protocols perform functions such as establishing routing tables and distributing routing information. Common routing protocols include RIP, OSPF, IS-IS, and BGP. While these protocols facilitate the management and transmission of routing information, they also have some vulnerabilities. If an attacker exploits these privileges of the routing protocols to attack the network, it may cause routing table corruption in network devices

The IS-IS routing protocol, or Intermediate System to Intermediate System, is a routing protocol proposed by ISO for routing ISO CLNS network services. This protocol is also link-state based, similar in principle to OSPF. The IS-IS routing protocol has been extended to run in IP networks, routing IP packets. This routing protocol also synchronizes its link-state database by establishing neighbor relationships and collecting local link-state data from routers. The neighbor relationship establishment process is simpler than OSPF, and it omits some OSPF-specific features, making the protocol simpler, clearer, and more scalable. Attacks against this protocol are similar to those against OSPF. By using simulation software to establish neighbor relationships with routers running the protocol, and then transmitting a large number of Link-State Data Units (LSPs) to the attacking router, inconsistencies can occur in the link-state databases of all routers in the network (because the link-state databases of all routers in the network need to be synchronized to the same state). This results in a routing table that does not match the actual situation, leading to network outages. Similar to OSPF, this type of attack can be largely prevented if the router running this routing protocol has IS-IS Protocol Unit (PDU) HMAC authentication enabled.