Chapter2
Chapter2
A Denial of Service (DoS) attack is a cyberattack that aims to make a server, network, or service
unavailable by overwhelming it with excessive traffic or exploiting vulnerabilities. The goal is to
disrupt normal operations so that legitimate users cannot access the service.
DoS attacks can be categorized into volumetric attacks, protocol-based attacks, and application-
layer attacks.
2️⃣Protocol-Based Attacks
3️⃣Application-Layer Attacks
1
Distributed Denial of Service (DDoS) Attack
A DDoS attack is a large-scale version of a DoS attack, where multiple machines (often botnets)
coordinate to flood a target.
Example:
○ GitHub was hit by a 1.35 Tbps DDoS attack using memcached amplification.
2. Dyn DNS (2016) - Internet Disruption
○ Attackers used the Mirai botnet to launch a DDoS attack on Dyn DNS, affecting
major websites like Twitter, Netflix, and Reddit.
3. Estonia (2007) - Nation-State Attack
A classic Denial-of-Service (DoS) attack using the flood ping command involves
overwhelming a target with a massive number of ICMP Echo Request (ping) packets, consuming
network bandwidth and system resources, ultimately making the target unresponsive.
2
1. Flood Ping (ICMP Flood) in Linux
A common method for executing a flood ping attack in Linux is using the ping command with
the -f flag:
ping -f <target>
Windows does not have a built-in flood ping option, but you can send continuous pings with
large packet sizes:
A more flexible tool than ping is hping3, which allows customized packet rates and spoofed IP
addresses:
3
Network admins can prevent or mitigate flood ping attacks using:
✅ Firewalls & Rate Limiting: Block excessive ICMP requests (e.g., with iptables or pf).
✅ ICMP Filtering: Disable or limit ICMP responses on servers (sysctl -w
net.ipv4.icmp_echo_ignore_all=1).
✅ DDoS Protection Services: Use Cloudflare, AWS Shield, or Akamai to detect and block
ICMP floods.
⚠️Ethical Warning: Executing a ping flood attack on unauthorized systems is illegal and can
result in criminal charges. Use these techniques only for network testing and security
research on systems you own or have permission to test.
4
Source address spoofing
Source address spoofing refers to the practice of manipulating the source IP address in the
header of network packets to make it appear as if the packets originated from a different machine
or location. This is commonly done in Denial-of-Service (DoS) or Distributed Denial-of-
Service (DDoS) attacks, where an attacker sends packets with a fake source address to hide their
identity or to amplify the attack.
1. Crafting the Packet: The attacker creates a packet and modifies the source IP address
to any address they want (often a random or legitimate-looking address, or a victim's
address).
2. Sending the Packet: The attacker sends the packet to the target server or network, which
will respond to the forged source address (if not properly configured to block spoofed
packets).
○ Anonymity: It hides the true identity of the attacker, making it difficult for
defenders to trace the source of the attack.
○ Amplification Attacks: In certain attacks (e.g., Smurf Attacks), spoofing can
make the attack more powerful, as the target sends responses to the spoofed
address, potentially leading to a flood of traffic directed at the victim.
○ DDoS Amplification: Attackers may use source address spoofing to make the
attack look like it’s coming from multiple locations.
1. Smurf Attack:
○ The attacker sends ICMP Echo Requests (ping) with a spoofed source address
of the victim's IP, directed at a broadcast address (e.g., 255.255.255.255).
○ Devices on the network send ICMP Echo Replies to the victim's IP, amplifying
the traffic.
2. DNS Amplification Attack:
○ An attacker sends a DNS query with a spoofed source IP of the victim to a DNS
server.
○ The DNS server responds to the victim with large DNS records, overwhelming
the victim’s resources.
3. TCP SYN Flood with Spoofed Source Address:
○ In a SYN flood, the attacker sends a SYN request to a server with a spoofed
source address.
5
○ The server responds with a SYN-ACK, but because the source IP is spoofed, the
server waits for a reply that never comes, leading to resource exhaustion.
1. Ingress Filtering:
○ ISPs (Internet Service Providers) and network administrators use ingress filtering
to block packets that come from a source address not allocated to the network or
the specific internal network.
○ This helps prevent spoofed packets from entering or leaving the network.
2. Egress Filtering:
○ This involves filtering outbound traffic to ensure that packets leaving the network
do not have a source IP address that belongs to a different network.
○ It’s a common way to prevent botnets or infected machines inside a network from
spoofing external sources.
3. Reverse Path Forwarding (RPF):
○ Modern firewalls and DDoS protection systems (e.g., Cloudflare, AWS Shield)
can help identify and block suspicious or spoofed traffic patterns.
5. Anti-Spoofing Tools:
○ Tools like BGP prefix filtering, rtrmd5, and NetFlow help detect and mitigate
attacks based on spoofed addresses.
Ethical Consideration
While source address spoofing is a common technique in cyberattacks, it is illegal and unethical
to perform such attacks without explicit permission from the system or network owner. Engaging
in unauthorized spoofing or DDoS attacks can lead to severe legal consequences.
Source address spoofing can be a significant threat to network security, but there are measures to
mitigate its effects and safeguard networks against such attacks.
6
IP Spoofing with TCP
IP Spoofing with TCP refers to the practice of manipulating the source IP address in a TCP
packet's header, making it appear as if the packet is coming from a different source. This can be
used to hide the true identity of the attacker or to launch attacks such as TCP SYN Flooding or
Man-in-the-Middle (MitM) attacks.
When the target machine receives the packet, it believes it came from a legitimate source and
may respond accordingly (e.g., with a SYN-ACK response in a three-way handshake). However,
because the source address is spoofed, the victim may not be able to receive the response,
causing issues like resource exhaustion or misdirected traffic.
○ The SYN Flood attack is a form of DoS attack where an attacker sends SYN
packets to a target server with a spoofed source IP address.
○ The server responds with SYN-ACK to the spoofed IP address, but because the
address is fake, the server waits for the handshake to complete, causing the server
to exhaust resources (half-open connections).
○ This attack is a type of flooding that can overwhelm the server or network device.
○ Example:
hping3 -S -p 80 --spoof <victim_IP> <target_IP>
○ -S sends SYN packets.
○ -p 80 targets port 80 (HTTP).
○ --spoof <victim_IP> sets the source IP to the victim's IP.
7
○ TCP IP spoofing can also be used to intercept communications between two
devices by impersonating one of the parties (usually through ARP spoofing or
DNS poisoning).
○ Once the attacker successfully spoofs the source IP and intercepts TCP traffic,
they can alter the data being sent or eavesdrop on sensitive communication.
3. Session Hijacking
○ The attacker uses TCP IP spoofing to inject packets into an ongoing session
between a client and server. If the attacker can predict the sequence numbers in
the session, they can impersonate the client or server and hijack the session,
potentially gaining unauthorized access.
4. Distributed Denial-of-Service (DDoS) Attacks
○ Attackers can use multiple sources (often via botnets) to send spoofed TCP
packets to the target, overwhelming the server with requests and making it unable
to process legitimate traffic.
○ Ingress filtering blocks packets entering a network that have a source IP address
that does not match the expected source (based on routing).
○ Egress filtering ensures that packets leaving a network do not have a source
address that is not valid for the network.
2. SYN Cookies:
○ SYN cookies are used to protect servers from SYN flood attacks by avoiding the
allocation of resources until the full TCP handshake is completed. This reduces
the risk of resource exhaustion in the case of spoofed SYN packets.
3. TCP Sequence Number Randomization:
○ Rate limiting on the server side can reduce the impact of DoS and DDoS attacks.
○ Use services like Cloudflare, AWS Shield, or Google Cloud Armor to help
mitigate traffic spikes caused by IP spoofing attacks.
6. Secure Sockets Layer (SSL) or Transport Layer Security (TLS):
8
○ TLS encryption helps to ensure the integrity and authenticity of data in transit.
Even if an attacker can spoof the IP address, decrypting or altering the encrypted
data is infeasible.
Using TCP IP spoofing to attack systems or networks without authorization is illegal in many
countries and can result in severe legal consequences, including criminal charges. Always ensure
that any testing or experimentation with IP spoofing is conducted in a controlled environment,
with permission from the network owner.
Conclusion
IP spoofing with TCP is a powerful technique for launching various types of cyberattacks, such
as DoS, DDoS, session hijacking, and Man-in-the-Middle attacks. However, with the right
defense mechanisms, networks can be hardened to prevent the damaging effects of these attacks.
Proper filtering, encryption, and intrusion detection are essential for protecting systems from IP
spoofing attacks.
9
TCP three-way handshake
The TCP three-way handshake is a process used to establish a reliable connection between a
client and a server in the Transmission Control Protocol (TCP). It ensures that both devices
are ready for communication and can reliably exchange data. The handshake consists of three
steps:
1. SYN (Synchronize) →
○ The client initiates the connection by sending a SYN (synchronize) packet to the
server.
○ This packet contains an initial sequence number (ISN) that will be used for data
transfer.
2. SYN-ACK (Synchronize-Acknowledge) ←
Example:
Client: SYN (Seq = x) → Server
Server: SYN-ACK (Seq = y, Ack = x+1) ← Client
Client: ACK (Seq = x+1, Ack = y+1) → Server
Why is it necessary?
10
Half-open connection
A half-open connection in TCP occurs when one side of a connection believes it is open, while
the other side has already closed or is unreachable. This can lead to resource wastage and
security vulnerabilities.
Now, the server thinks the connection is open, but the client is gone. The server might
continue to wait for data or retransmit packets, leading to unnecessary resource usage.
Other cases:
● Keep-alive probes: Some servers send periodic probes to check if the client is still there.
● Timeouts: If no response is received within a certain period, the connection is closed.
● RST (Reset) packets: If the other end sends an unexpected response (e.g., rejecting an
unknown connection), TCP resets the connection.
11
SYN Flood Attack
A SYN flood attack is a type of Denial of Service (DoS) attack that exploits the TCP three-
way handshake to overwhelm a server and make it unavailable. The attacker sends a massive
number of SYN (synchronize) requests but never completes the handshake, causing the server
to waste resources and eventually crash or become unresponsive.
1. The attacker sends multiple SYN packets to the target server, pretending to initiate
connections.
2. The server responds with SYN-ACK, expecting the final ACK from the client.
3. The attacker never sends the final ACK (or spoofs the source IP, making it
unreachable).
4. The server keeps the half-open connections in memory, consuming resources.
5. When enough half-open connections accumulate, legitimate users can’t connect,
causing denial of service.
1. SYN Cookies:
12
○ Limit the number of half-open connections per IP.
○ Drop excessive SYN packets from suspicious sources.
4. Intrusion Detection Systems (IDS):
13
SYN Cookies
SYN cookies are a technique used to defend against SYN flood attacks, which are a type of
Denial of Service (DoS) attack that targets the TCP handshake process. In a SYN flood attack,
an attacker sends a large number of SYN (synchronize) requests to a server, often with spoofed
source addresses, in order to overwhelm the server’s resources and prevent it from establishing
legitimate connections.
○ SYN flood attacks can exhaust the server’s TCP connection table (which tracks
half-open connections), leading to resource depletion and making it impossible
for legitimate clients to establish connections.
○ The server must allocate memory to each incoming connection request until the
handshake is completed. If the final ACK never arrives (due to the attack), these
resources are consumed without any actual connection being established.
4. SYN Cookie Mechanism:
○ SYN cookies are a way for the server to handle incoming SYN requests without
allocating memory or resources for half-open connections.
○ When the server receives a SYN request:
1. Instead of maintaining a connection state (waiting for the ACK), the server
generates a cookie (a special value) based on the client's IP address, port
number, and hash function. This cookie is included in the SYN-ACK
response to the client.
2. The client receives the SYN-ACK with the cookie and responds with an
ACK packet.
3. The server verifies the cookie in the ACK packet and, if the cookie is
valid, it establishes the connection and allocates resources.
5. The server only allocates resources if the ACK is received, and if the ACK is missing or
invalid (as in the case of a SYN flood), the server does not waste memory on half-open
14
connections.
When a server is under attack or receiving a legitimate SYN request, the process of handling the
connection proceeds as follows:
1. SYN Request:
○ A client or attacker sends a SYN request to the server to initiate the TCP
connection.
2. Server Response with SYN-ACK (Cookie Generation):
○ Instead of storing the connection state, the server creates a SYN cookie based on
the following parameters:
■ The IP address of the client.
■ The port number of the client.
■ A timestamp to prevent replay attacks.
■ A random secret value (used in the hash function to generate the cookie).
3. The server responds with a SYN-ACK message that contains the SYN cookie in the
sequence number field.
○ The client responds with an ACK packet, which contains the SYN cookie (in the
sequence number field) as part of the acknowledgment.
5. Server Verifies the Cookie:
15
○ Upon receiving the ACK, the server checks the validity of the SYN cookie by
recalculating it using the same parameters (client IP, port, timestamp, secret, etc.).
○ If the cookie matches, the server knows this is a legitimate connection attempt and
establishes the connection, allocating resources for the full TCP session.
6. Connection Establishment:
○ The server completes the handshake and creates the connection only after
successfully validating the ACK and the cookie.
○ SYN cookies are designed to mitigate SYN flood attacks, but they do not protect
against other types of DoS or DDoS attacks (such as those targeting application-
layer vulnerabilities).
Conclusion:
SYN cookies provide a powerful and efficient way to defend against SYN flood attacks, which
are a type of DDoS attack designed to exhaust server resources by sending large numbers of
SYN requests. By using cookies that encode connection information in the sequence number of
the SYN-ACK response, SYN cookies prevent the server from allocating resources until the final
ACK is received, helping to mitigate resource depletion. However, while SYN cookies are
effective against SYN flood attacks, they have certain limitations and do not provide protection
against all types of attacks or advanced network-based threats.
16
17
TCP SYN Spoofing Attack
A TCP SYN Spoofing Attack is a type of Denial of Service (DoS) or Distributed Denial of
Service (DDoS) attack that exploits the TCP three-way handshake. It involves sending SYN
packets with fake (spoofed) source IP addresses, causing the target server to exhaust resources
and become unavailable.
1. Attack Initiation
○ The attacker sends a large number of SYN packets with fake (spoofed) source
IP addresses to the target server.
2. Server Response
○ The server responds with SYN-ACK to the spoofed IP addresses (which don’t
actually exist or belong to real machines).
3. No ACK Received
○ Since the spoofed IPs never sent the original SYN request, they do not respond
with an ACK.
○ The server keeps waiting and holds these half-open connections in memory.
4. Resource Exhaustion
○ As the number of half-open connections increases, the server runs out of available
connection slots.
○ Legitimate users cannot connect, causing a Denial of Service (DoS).
SYN Flood The attacker sends many SYN packets Overloads the server with half-open
without completing the handshake. connections.
18
4. Thousands of such connections fill up the server's backlog queue.
1. SYN Cookies
○ Encodes connection state in SYN-ACK responses, so the server does not allocate
resources until a real client replies.
2. Rate Limiting & Firewall Rules
○ A reverse proxy (e.g., Cloudflare, AWS Shield) can absorb SYN floods and
mitigate attacks.
19
Ping of Death
The Ping of Death is a type of Denial-of-Service (DoS) attack where an attacker sends
maliciously crafted ICMP Echo Request packets (ping) to a target system with the goal of
causing the target system to crash, freeze, or reboot.
● ICMP Packet Size Limit: In the original Internet Protocol (IP) specification, the
maximum size of an ICMP packet (including both the header and data) was 65,535 bytes.
However, the standard ICMP packet size was much smaller, typically just a few bytes.
● Malicious Ping Packet: The attacker crafts an ICMP Echo Request packet with a
payload that exceeds the normal size limit (e.g., larger than 65,535 bytes). This oversized
packet is sent to the target system.
● Buffer Overflow: Older systems (especially those with outdated software or poor
packet-handling routines) would attempt to process the oversized ICMP packet, leading
to a buffer overflow in the system’s memory. This could result in a system crash,
reboot, or vulnerability exploitation.
● System Crash/Freeze: The target system may become unresponsive or crash because it
cannot handle the oversized ICMP packet.
● Denial of Service (DoS): The affected system may experience downtime, making
services or applications unavailable to legitimate users.
● Security Vulnerabilities: In some cases, the attack could exploit vulnerabilities in the
system's handling of oversized packets, potentially allowing remote code execution or
other attacks.
The attacker sends an ICMP Echo Request packet to the target system with a payload size larger
than 65,535 bytes, which causes the system to misinterpret the packet and attempt to process it.
1. Patch Management: Modern operating systems and network devices have been patched
to prevent the Ping of Death attack by enforcing proper checks on packet sizes and
ensuring that oversized packets are discarded.
2. Packet Filtering: Firewalls and intrusion detection/prevention systems (IDS/IPS) can be
configured to detect and block oversized ICMP packets.
3. ICMP Rate Limiting: Limiting the rate of ICMP Echo Requests helps prevent flood
attacks, including the Ping of Death.
20
4. Blocking ICMP Echo Requests: In high-security environments, blocking ICMP traffic
entirely can mitigate potential DoS attacks, though this may impact network
troubleshooting.
Historical Context
The Ping of Death was a significant security concern in the 1990s, particularly affecting older
versions of Windows, Mac OS, and Unix-based systems. However, most modern systems are
now protected against this attack due to patches and improvements in packet-handling.
Conclusion
The Ping of Death is a legacy Denial-of-Service (DoS) attack that exploits flaws in how certain
systems handled oversized ICMP packets. Although it is largely mitigated in modern systems, it
serves as an example of how protocol vulnerabilities can be exploited for malicious purposes.
Today, network administrators use a variety of methods, such as firewalls, IDS, and packet
filtering, to defend against such attacks.
21
Flooding Attacks
Flooding attacks exploit the capacity limits of a system, network infrastructure, or service,
causing resource exhaustion, which prevents legitimate users from accessing the service. These
attacks are often simple to execute but can have a devastating impact on the target.
○ ICMP Echo Request (ping) packets are sent in rapid succession to the target.
○ The goal is to exhaust the target's resources or bandwidth, leading to the target
becoming overwhelmed and unresponsive.
○ Ping of Death is a variation of this, where oversized ICMP packets are sent.
2. SYN Flood:
○ The attacker sends a large number of SYN packets (initial requests for a TCP
connection) to the target without completing the TCP handshake (i.e., no final
ACK is sent).
○ This results in the target's connection queue being filled with half-open
connections, consuming system resources and eventually causing a service
disruption.
○ It is a form of TCP Flood.
3. UDP Flood:
○ The attacker sends UDP packets (usually to random ports) to the target without
waiting for a response.
○ Since UDP is a connectionless protocol, the target system must process each
incoming packet and may attempt to reply with ICMP Destination Unreachable
messages, consuming additional bandwidth and resources.
○ This results in bandwidth exhaustion and denial of service.
4. HTTP Flood:
○ This attack floods a target web server with HTTP requests, typically targeting
web pages that are resource-intensive to process (e.g., dynamic content,
databases).
○ The goal is to exhaust the server’s CPU, memory, or bandwidth by forcing it to
process more requests than it can handle.
○ This attack can be more difficult to mitigate because it appears like legitimate
web traffic.
22
5. DNS Flood:
○ In this attack, the attacker sends a large number of DNS queries to the target
server.
○ The goal is to exhaust the DNS server’s resources and potentially cause it to fail,
preventing legitimate users from resolving domain names.
6. NTP Amplification Attack:
○ A Smurf attack is a type of ICMP flood where the attacker sends ICMP Echo
Requests (pings) to a broadcast address with a spoofed source IP (usually the
victim's IP).
○ All devices on the network that receive the ping will reply to the victim,
effectively amplifying the attack.
● Resource Exhaustion: The target system can run out of CPU, memory, or bandwidth,
making it unable to process legitimate requests.
● Service Disruption: Legitimate users cannot access the service or website due to the
overwhelming traffic.
● Downtime: Critical services may experience downtime as the target system struggles to
process the flood of requests.
● Financial Losses: In cases of businesses, service disruptions can lead to revenue loss,
customer dissatisfaction, and damage to reputation.
○ Rate limiting and traffic filtering can block or restrict excessive traffic from
sources identified as part of a flood attack.
○ Ingress filtering can be applied to block packets with spoofed source addresses.
2. Intrusion Detection and Prevention Systems (IDS/IPS):
○ IDS/IPS systems monitor network traffic for unusual patterns and can
automatically block malicious traffic when an attack is detected.
3. Content Delivery Networks (CDN) and DDoS Protection Services:
23
○ Services like Cloudflare, Akamai, and AWS Shield can absorb and mitigate
massive flooding attacks by distributing the traffic across a large network of
servers.
○ They help to filter malicious traffic and offload the burden from the target’s
origin server.
4. Load Balancers:
○ Websites can use CAPTCHAs to ensure that requests are coming from humans
and not automated scripts.
○ Rate limiting can help control the frequency of requests from a single IP address,
making it more difficult for attackers to flood the system with excessive traffic.
6. Network Monitoring:
○ Continuous network monitoring can help detect signs of a flooding attack early,
allowing administrators to take action before the system becomes overwhelmed.
Conclusion
Flooding attacks are a major threat to network and service availability, leveraging high volumes
of traffic or requests to overwhelm the target’s resources. While they can be devastating,
effective traffic filtering, DDoS protection services, and network monitoring can significantly
reduce the impact of such attacks and protect critical infrastructure from being knocked offline.
24
Distributed Denial of Service Attacks
The nature of the attack makes it harder to mitigate, as the attack traffic often looks like
legitimate traffic coming from a variety of sources, making it difficult to distinguish malicious
traffic from regular user requests.
DDoS attacks can be broadly classified into three categories based on the methods they use to
target the victim:
○ UDP Flood: An attacker sends a large number of UDP packets to random ports
on the target machine, overwhelming it.
○ ICMP Flood (Ping Flood): The attacker sends a flood of ICMP Echo Request
packets (ping), consuming both the target’s network bandwidth and its resources.
○ DNS Amplification Attack: The attacker exploits publicly accessible DNS
servers to amplify traffic, sending it to the victim, causing massive bandwidth
consumption.
2. Protocol-Based Attacks: These attacks target specific protocols used for communication
between systems, often exploiting weaknesses in protocol design or implementation to
exhaust resources on the target system:
25
○ SYN Flood: The attacker sends numerous SYN requests (part of the TCP
handshake) to the target without completing the handshake, causing the target to
allocate resources for each half-open connection.
○ Smurf Attack: The attacker sends ICMP Echo Requests to a broadcast address,
with the victim's IP as the source. All devices in the network will respond to the
victim, amplifying the attack.
○ Fragmentation Attacks: Attackers send fragmented packets that are difficult for
the target system to reassemble, consuming CPU and memory resources as the
system attempts to process them.
3. Application Layer Attacks: These attacks target vulnerabilities in the application layer,
where typical network defenses are less effective. Application layer attacks aim to
exhaust the resources of web servers or applications:
○ HTTP Flood: The attacker sends a high volume of HTTP requests to a web
server, making it process more requests than it can handle. This attack can mimic
legitimate traffic, making it difficult to detect.
○ Slowloris: The attacker keeps many connections open to the target web server and
sends incomplete HTTP requests, keeping the server’s connection pool occupied
without completing the request. This causes the server to exhaust its resources.
● Distributed: Unlike a DoS attack, which originates from a single source, a DDoS attack
uses multiple devices spread across different locations (often from around the world).
● Large-scale Traffic: DDoS attacks often involve enormous amounts of data, sometimes
in the terabits per second (Tbps) range, making it hard for the target’s network
infrastructure to cope.
● Hard to Trace: The use of multiple sources makes it difficult to pinpoint the attacker.
The attack appears as a legitimate surge in traffic from multiple compromised machines,
often making it hard to distinguish malicious traffic from normal user traffic.
26
1. Traffic Filtering:
○ Firewalls and Intrusion Prevention Systems (IPS): Use firewalls and IPS to
filter out traffic from known malicious sources or to limit the rate of incoming
traffic from a single IP address.
○ Web Application Firewalls (WAF): WAFs can help filter malicious traffic
specifically aimed at web servers and applications, particularly for application-
layer attacks.
2. Rate Limiting:
○ Set rate limits on incoming requests to prevent servers from being overwhelmed
by large numbers of requests. This can be especially useful for application-layer
DDoS attacks.
3. Content Delivery Networks (CDN):
○ CDNs like Cloudflare, Akamai, and Amazon CloudFront can absorb large-
scale DDoS traffic and offload requests to globally distributed servers, reducing
the strain on the origin server.
4. Traffic Scrubbing:
○ Overprovisioning network bandwidth can help absorb larger traffic spikes, but
this is only a temporary solution and might not protect against the most powerful
DDoS attacks.
7. DDoS Protection Services:
○ Services like Cloudflare, AWS Shield, and Google Cloud Armor provide
DDoS protection tailored to various types of attacks, including advanced
mitigation strategies like real-time traffic analysis and attack recognition.
8. Traffic Analysis and Monitoring:
Conclusion
27
DDoS attacks are powerful, disruptive threats that target network resources, web services, and
applications by overwhelming them with massive amounts of traffic. The distributed nature of
DDoS attacks makes them difficult to defend against, but there are a variety of mitigation
strategies and tools, including firewalls, rate limiting, CDNs, and specialized DDoS protection
services, that can help reduce their impact and keep services available during an attack.
28
Botnets
1. Infection (Compromise): The first step in creating a botnet is infecting devices with
malicious software, known as malware (such as viruses, worms, Trojans, or rootkits).
This malware allows attackers to remotely control the compromised devices (bots).
3. Botnet Operations:
○ Once a device is infected, it waits for instructions from the botnet's operator to
carry out malicious activities.
○ Bots in a botnet typically remain dormant until the botnet operator activates them
for specific tasks.
○ Botnets are used to send spam emails, which may contain phishing links to trick
users into revealing personal information or credentials. Botnets can send millions
of emails, making it difficult to block the traffic.
3. Data Theft and Information Gathering:
29
○ Some botnets are designed to steal sensitive information from infected devices,
such as login credentials, credit card numbers, or other private data. These botnets
can harvest data from users across different platforms.
4. Cryptojacking:
○ Botnets can be used for cryptojacking, where the infected devices are used to
mine cryptocurrencies for the botnet operator without the device owner’s
knowledge. This activity drains the device’s resources, slowing it down and
potentially damaging it over time.
5. Spreading Malware:
○ Botnets can be used to spread more malware to other devices, expanding the
botnet and increasing the attacker’s control over more devices.
6. Proxy Networks:
○ Some botnets are used to create proxy networks that hide the true location of the
botnet operator. These proxies can mask the attacker’s identity and help them
perform other malicious activities with anonymity.
Types of Botnets
1. Centralized Botnet:
○ The botnet has a single central command and control (C&C) server. This
server sends commands to all the bots in the network. A flaw in the C&C server
can lead to the entire botnet being disrupted if it’s taken down.
2. Decentralized (Peer-to-Peer) Botnet:
○ Instead of a central C&C server, a P2P botnet has a distributed structure where
bots communicate directly with one another. If one bot goes down, the others can
still function and maintain the botnet's operations. These types of botnets are
harder to disrupt because they don’t rely on a single point of failure.
3. IoT Botnets:
Notable Botnets
● Mirai Botnet: One of the most well-known botnets, Mirai, primarily targeted IoT
devices, infecting devices with weak security like cameras, routers, and DVRs. It was
responsible for some of the largest DDoS attacks in history, including the attack on Dyn,
which affected major websites like Twitter, Netflix, and Reddit.
30
● Emotet: Originally a banking Trojan, Emotet evolved into a botnet that distributes other
forms of malware, including ransomware and information stealers. Emotet has been used
in large-scale phishing campaigns, and it was one of the most notorious botnets in recent
years until law enforcement dismantled it in 2021.
● Zeus Botnet: One of the most infamous banking Trojan botnets, Zeus was used to steal
banking credentials and personal information. It was responsible for stealing millions of
dollars from users and businesses. Zeus has been replaced by its successor, Zbot.
○ Many botnet infections occur through weak or default passwords on IoT devices.
Change the default passwords to strong, unique passwords for all devices
connected to the internet.
4. Firewalls and Intrusion Detection Systems (IDS):
○ Use firewalls and IDS/IPS to detect unusual traffic patterns and prevent the
infected device from sending malicious traffic.
5. Network Segmentation:
○ Segment networks to prevent the spread of botnet malware from one device to
others on the same network. For example, isolate IoT devices from critical
business systems.
6. Botnet Detection Systems:
○ Use specialized systems that analyze network traffic for signs of botnet activity
(such as unusual traffic spikes or unusual communication between devices).
7. DDoS Mitigation Services:
31
○ Educate users on the risks of phishing attacks and how to avoid them. Train
users to recognize suspicious emails and websites that may be used to deliver
malware.
Conclusion
Botnets are a significant cybersecurity threat, as they can be used for a wide range of malicious
activities, including DDoS attacks, spam distribution, data theft, and cryptojacking. The
distributed nature of botnets makes them hard to dismantle, but with proper network security
measures, such as software updates, firewalls, and DDoS mitigation, organizations and users
can defend against these threats. Awareness of botnet risks, particularly in IoT devices, is
essential to preventing these attacks from compromising networks.
32
Hypertext Transfer Protocol Based Attacks
An HTTP-based attack is a type of cyberattack that specifically targets the HTTP protocol (the
foundation of data communication on the web) to disrupt or compromise web services, websites,
and web applications. These attacks can exploit vulnerabilities in web servers, applications, or
the underlying infrastructure, and often aim to degrade service performance, steal sensitive
information, or deface websites.
HTTP-based attacks are typically divided into several types, with different goals such as service
disruption, data theft, or taking control of user sessions.
○ SQL Injection occurs when an attacker injects malicious SQL code into an input
field of a web application that interacts with a database. This can allow attackers
to manipulate the database by executing unauthorized commands.
○ If not properly sanitized, user input is directly passed into SQL queries, allowing
the attacker to retrieve, modify, or delete data from the database, potentially
stealing sensitive information like passwords, emails, and credit card numbers.
3. Cross-Site Scripting (XSS):
○ XSS attacks occur when attackers inject malicious JavaScript code into web
pages, which is then executed in the browsers of users who visit the affected page.
This can lead to:
■ Session hijacking: Stealing a user's authentication token or cookie.
■ Phishing: Redirecting users to fake login pages.
■ Defacement: Altering the appearance of a webpage.
○ XSS attacks can be reflected (executed immediately when the user accesses the
malicious URL), stored (stored on the server and executed whenever the page is
loaded), or DOM-based (caused by client-side JavaScript vulnerabilities).
4. Cross-Site Request Forgery (CSRF):
33
■ A user logs into a banking site, and while still logged in, visits a malicious
website that submits a request to transfer funds from their account without
their knowledge.
○ The attacker exploits the fact that the user's browser automatically sends cookies
or session tokens along with the malicious request, believing the request is
legitimate.
5. Session Hijacking:
○ Session hijacking (or cookie hijacking) occurs when an attacker steals a user's
session cookie (which contains authentication credentials) to impersonate the
user. This can be done through techniques like XSS or Man-in-the-Middle
(MitM) attacks.
○ Once the attacker hijacks the session, they can access user accounts and perform
actions on behalf of the legitimate user.
6. Directory Traversal (Path Traversal):
○ RFI and LFI attacks occur when a web application improperly includes external
or local files based on user input. In RFI, the attacker supplies a URL pointing to
a remote file, while in LFI, the attacker provides the path to a file on the server.
○ If the application fails to properly sanitize input, attackers can include malicious
files that may execute arbitrary code or steal sensitive information.
■ RFI can result in the execution of remote malicious code on the server.
■ LFI can allow an attacker to view sensitive server files or even execute
arbitrary commands if combined with other vulnerabilities.
8. HTTP Response Splitting:
○ In an SSRF attack, the attacker tricks the server into making a request to a
restricted internal resource or an external server that the attacker controls.
34
○ This can lead to unauthorized access to internal services, data exfiltration, or even
triggering an attack on other systems within the network.
10. DNS Poisoning (Cache Poisoning):
● In this attack, the attacker manipulates DNS responses to redirect users to malicious
websites, typically by modifying the cache of a DNS server or the local DNS resolver.
● The attacker can perform DNS poisoning to redirect users to fake versions of websites,
enabling phishing attacks or man-in-the-middle attacks.
○ Use strong input validation to ensure that user inputs (e.g., in forms or URLs)
don’t contain harmful data. Input sanitization ensures that only safe, expected
inputs are processed by the server, preventing attacks like SQL injection or XSS.
2. Web Application Firewalls (WAF):
○ A WAF filters and monitors HTTP traffic to protect web applications from
common attacks, such as XSS, SQL injection, and HTTP floods. It can block
malicious requests based on predefined patterns or behaviors.
3. Secure Authentication and Session Management:
○ Use HTTPS to encrypt data in transit and protect it from being intercepted by
attackers. This helps mitigate Man-in-the-Middle (MitM) attacks, where an
attacker could alter or eavesdrop on HTTP requests.
5. Regular Security Audits:
○ Implement rate limiting to restrict the number of requests a user can make within
a given timeframe. This can help prevent HTTP floods and brute-force login
attempts. Use CAPTCHA to ensure that users are human and not bots.
7. Cross-Origin Resource Sharing (CORS) Policies:
○ Enforce strict CORS policies to control how resources on your server can be
accessed by external domains. This can help prevent cross-site request forgery
(CSRF).
35
8. Content Security Policy (CSP):
○ Implement CSP to mitigate the risk of XSS attacks by restricting the sources from
which scripts, styles, or other resources can be loaded.
9. Server Configuration Hardening:
Conclusion
HTTP-based attacks are common threats to web applications and servers, often exploiting
vulnerabilities in the HTTP protocol or the web application itself. These attacks can lead to
significant service disruptions, data breaches, or compromised user accounts. Effective security
practices, such as input validation, rate limiting, secure session management, and web
application firewalls (WAFs), can help mitigate the risk of these attacks and protect web
services from malicious activity.
36
HTTP Flood and Slowloris
An HTTP flood attack is a type of DDoS (Distributed Denial of Service) attack where an
attacker overwhelms a web server or application by sending a massive number of HTTP
requests. These requests appear legitimate because they follow the proper HTTP structure, but
the sheer volume of requests exhausts the server's resources, making the site slow or
unresponsive.
● Request Flooding: The attacker sends a large number of HTTP requests to a server,
targeting specific resources or the entire server. These can be GET or POST requests,
often designed to simulate the behavior of legitimate users.
● Resource Exhaustion: The goal is to exhaust server resources (like CPU, memory, or
bandwidth) by processing requests, leading to a denial of service.
● Amplification: In some cases, the attacker may use amplification techniques, where a
small request results in a large server response, increasing the attack's effectiveness.
1. Application Layer Attack: Unlike traditional network-layer attacks that target raw
bandwidth, HTTP floods target the application layer of the OSI model (Layer 7). This
makes it harder to distinguish from legitimate traffic, as all requests are valid HTTP
requests.
2. Slow and Steady: These attacks don’t require massive traffic bursts like other DDoS
attacks (e.g., UDP floods or SYN floods), and they can be sustained over long periods,
making them harder to defend against.
3. Exploitation of Web Applications: The attack often exploits specific web applications,
such as search pages, login forms, or any feature that requires a significant amount of
server resources.
● Web Application Firewall (WAF): A WAF can help filter malicious traffic and block
attack patterns based on HTTP request analysis.
● Rate Limiting: Limit the number of requests that a client can make within a certain time
frame, reducing the impact of an HTTP flood.
● CAPTCHA: Use CAPTCHA challenges to distinguish between legitimate users and
automated bots.
● Content Delivery Networks (CDNs): CDNs can help offload some of the traffic and
absorb the load on your main server.
● Traffic Analysis: Monitor incoming traffic for abnormal patterns (such as unusual spikes
in HTTP requests) and block suspicious sources.
37
Slowloris Attack
Slowloris is a specific type of Denial of Service (DoS) attack that targets web servers by
keeping connections open for as long as possible and sending partial HTTP requests. The attack
focuses on consuming server resources, such as available connections, by keeping connections
alive and slowly sending data, which prevents the server from handling legitimate requests.
1. Partial HTTP Requests: The attacker sends incomplete HTTP requests with headers
that are not properly terminated (e.g., missing the final \r\n to signify the end of the
request).
2. Slow Sending: The attacker sends these incomplete headers slowly, over a long period of
time, keeping the server's connection open. The server waits for the complete request,
effectively locking that connection.
3. Exhausting Connections: By initiating a large number of connections, each waiting for
the completion of the HTTP request, the attacker exhausts the server’s available
connection pool, causing the server to become unable to handle legitimate requests.
4. Server Hang: Slowloris keeps these connections open indefinitely, consuming server
resources without closing the connection, thereby preventing the server from accepting
new connections.
● Very Low Bandwidth Usage: Unlike typical DDoS attacks that generate large amounts
of traffic, Slowloris uses very little bandwidth because the attack doesn’t require sending
a lot of data. Instead, it exploits the time-based nature of HTTP connections.
● Effective Against Specific Web Servers: Slowloris is particularly effective against web
servers like Apache HTTP Server, which don’t handle half-open connections well.
● Stealthy: It is a low and slow attack that is hard to detect because it doesn’t generate
large traffic spikes and mimics legitimate behavior by using valid HTTP requests.
38
Comparison:
Traffic High (can generate a lot of traffic) Low (minimal bandwidth usage)
Volume
Conclusion:
Both HTTP Flood and Slowloris are types of DoS (Denial of Service) attacks that target web
servers by overwhelming them with HTTP traffic. HTTP Flood is a volume-based attack that
floods the server with many requests, while Slowloris is a low-bandwidth, slow attack that keeps
server connections open and exhausts its connection pool. Both attacks are challenging to detect
and defend against, requiring strategies such as rate limiting, connection management, and the
use of security solutions like WAFs and reverse proxies.
39
DoS VS DDoS
The difference between DoS (Denial of Service) and DDoS (Distributed Denial of Service)
attacks lies primarily in the source and scale of the attack.
A DoS attack is a type of attack where a single attacker attempts to disrupt or make a service
unavailable to its intended users. The attacker typically floods the target system or network with
an overwhelming amount of traffic or requests, exhausting resources like bandwidth, CPU, or
memory.
1. Single Attacker: A DoS attack originates from a single source, such as one computer or
network.
2. Limited Scale: Since the attack comes from one machine, it generally has a smaller
impact compared to a DDoS attack.
3. Simple Execution: DoS attacks are relatively easier to execute and don't require a large
infrastructure of compromised devices.
A DDoS attack is a more advanced form of a DoS attack, where multiple systems, often
distributed across the globe, work together to flood a target system or network with an
overwhelming amount of traffic. These systems are typically compromised machines, such as
those in a botnet.
1. Multiple Attackers: A DDoS attack involves many attacking systems, often thousands
or even millions of compromised devices (like IoT devices, computers, or servers)
acting in coordination.
2. Large-Scale Impact: Because the attack originates from multiple sources, it is far more
difficult to mitigate and can cause greater disruption and higher traffic volumes than a
typical DoS attack.
3. Botnets: DDoS attacks often use botnets—networks of infected devices controlled by a
single entity (the attacker) to launch the attack.
40
Common Methods Used in DDoS Attacks:
● Flooding Attacks: These include high-volume attacks like HTTP floods, UDP floods,
SYN floods, etc.
● Amplification Attacks: The attacker exploits certain protocols (like DNS or NTP) to
amplify the volume of traffic sent to the target.
● Reflection Attacks: The attacker sends requests to a third-party server with the target’s
IP address, causing the server to send a response to the target instead of the attacker.
Scale Limited to the capacity of the Large-scale, distributed, and more difficult
attacking machine to mitigate
Impact Smaller, but still disruptive Larger, more damaging, and harder to
defend against
Detection Easier to detect, as it's from a Harder to detect, as traffic comes from
single source many sources
Mitigation Easier to block traffic from a More challenging to mitigate due to the
single IP distributed nature
Conclusion:
41
● DoS attacks come from a single attacker and are easier to detect and mitigate, but they
can still disrupt services if the target isn't properly protected.
● DDoS attacks, on the other hand, come from multiple sources, making them more
powerful and harder to stop, as the traffic originates from many different machines,
often spread across various geographic locations.
Both types of attacks aim to make a service or website unavailable, but DDoS attacks are
generally more destructive due to their scale and distributed nature.
42
Reflection Attacks
Reflection attacks typically exploit UDP-based protocols that do not require a handshake or
verification of the originator’s address, making it easy for an attacker to spoof their IP address
and direct responses to a victim without revealing their own identity.
2. Third-Party Server Response: The third-party server receives the request, processes it,
and sends a response back to the target system using the victim's IP address as the
destination.
4. Traffic Overload: The victim is now flooded with large responses from multiple third-
party servers, exhausting resources like bandwidth and processing power, potentially
causing the target system to become slow or unavailable.
43
○ The attacker exploits the NTP protocol by sending a request with a spoofed
source IP to an NTP server.
○ The server responds to the spoofed IP (the victim's) with a large packet containing
a monlist command, which returns a list of recent clients of the server.
○ The amplification factor for NTP is very high, as a small query can result in a
large response (up to 500 times the size of the request).
3. Chargen Reflection Attack:
○ SSDP is used for discovering devices on a local network (e.g., Universal Plug and
Play – UPnP).
○ Attackers can exploit UPnP devices that expose SSDP, sending malicious
requests to them and spoofing the victim's IP address.
○ The devices respond with large UDP packets to the victim’s IP, flooding their
network.
5. Memcached Reflection Attack:
● Spoofing: The attacker spoofs the victim's IP address so that responses are directed to
the target rather than the attacker.
● Amplification: Reflection attacks can be highly amplified, meaning a small request
results in a large response, making the attack much more effective with fewer resources.
● Hard to Trace: Because the source IP is spoofed, it is difficult to trace the attack back to
its origin, making it harder for defenders to block the attacker.
● Use of Vulnerable Servers: These attacks rely on misconfigured or vulnerable third-
party servers that can be tricked into sending unsolicited traffic.
44
1. Rate Limiting and Traffic Filtering:
○ Set rate limits on incoming requests and responses to reduce the impact of
reflection attacks. This can also help limit the size of traffic bursts.
○ Use traffic filtering techniques to block excessive or anomalous traffic that may
be coming from third-party servers.
2. Source IP Validation (Anti-Spoofing):
○ Disable unused or unnecessary services like Chargen, SSDP, or NTP that are
vulnerable to reflection attacks.
○ Ensure that only necessary services are exposed to the internet and configure them
properly.
4. Rate Limiting on DNS Servers:
○ DNS servers should be configured to limit the number of queries from a single
IP address in a short time span to avoid becoming part of a DDoS attack.
5. Securing NTP Servers:
○ Configure NTP servers to reject requests from unauthenticated clients and block
monlist commands that provide an attacker with the ability to amplify traffic.
6. Anycast Networks:
○ Use Anycast routing to distribute the traffic load across multiple data centers,
which can help absorb and mitigate large DDoS attacks.
7. Web Application Firewalls (WAF):
○ Use WAFs to monitor and block suspicious traffic patterns, including potential
reflection and amplification attacks.
8. Cloud-Based DDoS Protection Services:
○ Services like Cloudflare, AWS Shield, or Google Cloud Armor can help detect
and mitigate large-scale DDoS and reflection attacks by using distributed servers
to absorb traffic.
Conclusion:
Reflection attacks are a highly effective type of DDoS attack that leverages the resources of
vulnerable third-party servers to flood a target system with traffic. The attacker spoofs the
victim's IP address, making it difficult to trace and mitigate the attack. Common protocols
45
exploited in reflection attacks include DNS, NTP, SSDP, and Memcached. Defending against
these attacks requires proactive measures, such as source IP validation, rate limiting, and
securing vulnerable protocols.
46
DNS Amplification Attacks
A DNS amplification attack is a type of reflection attack in which an attacker exploits DNS
(Domain Name System) servers to flood a target system with a massive volume of traffic. This
attack uses DNS queries to generate a much larger response to overwhelm the target, often
leading to a DDoS (Distributed Denial of Service).
1. The attacker sends a small DNS request (e.g., a request for a domain's DNS record or a
nonexistent domain that results in a larger response) to an open DNS resolver. The
attacker spoofs the victim's IP address as the source of the request.
2. The DNS resolver then responds with a much larger DNS response to the victim's IP
address.
3. The victim receives large DNS responses, often much larger than the initial request,
overwhelming its network or server.
For example, a small request (like a query for the IP address of a domain) could generate a DNS
response up to 50 times larger, flooding the victim with traffic.
47
● Amplification Factor: DNS queries can be amplified significantly. A small request
(often just a few bytes) can cause a DNS server to respond with a much larger payload,
sometimes up to 50 times the original size.
● Exploitation of Open DNS Servers: Many DNS servers are misconfigured and left open
to the public. These open resolvers are susceptible to being used in DNS amplification
attacks, as they will respond to any DNS query, including those with spoofed source
addresses.
● Lack of Authentication: DNS servers generally do not verify the originating IP
address of incoming requests. This makes it easy for attackers to spoof their IP and direct
the response to the victim.
● Distributed Nature: Attackers can leverage botnets or a large number of machines to
send DNS queries, further amplifying the attack and making it more difficult to mitigate.
1. Reflection and Amplification: The attacker doesn’t need to directly send the traffic to
the target. The attack is reflected off DNS servers, and it is amplified because the
response is larger than the request.
2. Resource Exhaustion: The victim is flooded with large volumes of traffic, which can
exhaust their network bandwidth or server resources.
3. Difficult to Trace: Since the attacker spoofs the victim’s IP address, it is difficult to trace
the attack back to its source.
4. Exploits Open DNS Servers: It relies on open DNS resolvers, which are DNS servers
that accept and respond to queries from anyone on the internet.
● Web Servers and Applications: The primary target of these attacks is often web servers
or online services. The goal is to overwhelm these systems with traffic, causing
downtime or making them unresponsive.
● Network Infrastructure: DNS amplification attacks can also be used to attack network
infrastructure like firewalls and routers, which may have limited capacity for processing
incoming traffic.
○ Disable open resolvers: Ensure DNS servers do not allow recursive queries from
external, unauthorized sources.
48
○ Limit response size: Configure DNS servers to limit the size of responses,
reducing amplification potential.
○ Restrict access: Limit which IPs can query your DNS server using Access
Control Lists (ACLs) or firewall rules.
○ Use DNSSEC: DNS Security Extensions (DNSSEC) can help protect against
certain DNS-based attacks by providing cryptographic signatures for DNS
records. This may not prevent the amplification, but it can mitigate some DNS-
based spoofing.
2. Source Address Validation:
○ Rate limit DNS queries per IP address to prevent abuse and mitigate the volume
of requests from a single attacker.
○ Use firewalls, intrusion prevention systems (IPS), and DDoS protection
services to filter or block DNS amplification traffic.
4. Cloud-Based DDoS Protection:
○ Regularly monitor DNS traffic for any abnormal or sudden spikes, which could
indicate an ongoing DNS amplification attack. This helps in quickly identifying
and responding to an attack.
Conclusion:
A DNS amplification attack is a powerful DDoS technique that takes advantage of open and
misconfigured DNS servers to flood a victim with large volumes of traffic. By spoofing the
victim's IP address, the attacker can direct large DNS responses to overwhelm the victim’s server
or network. These attacks are highly effective due to the amplification factor and the use of
easily exploited open DNS servers.
Mitigation involves securing DNS servers, validating source IPs, and using rate limiting and
traffic filtering techniques to prevent DNS amplification attacks from reaching their target.
49
Smurf Attack
A Smurf attack is a type of Distributed Denial of Service (DDoS) attack that uses ICMP
(Internet Control Message Protocol) to overwhelm a target system with large volumes of
traffic. It is a reflection-based attack that involves sending ping requests to a network of devices
with the spoofed IP address of the victim as the source address. This results in those devices
responding to the victim, flooding the target with traffic, causing it to become slow or
unavailable.
○ The broadcast address sends the ping request to every host on the target
network. Every device that is configured to respond to an ICMP Echo Request
will reply, which generates amplified traffic.
3. Flooding the Target:
○ The devices on the network send ICMP Echo Replies (responses) to the victim’s
IP address.
○ The victim receives all the ICMP Echo Replies (pings) from potentially
thousands of devices, causing their network and systems to become overloaded
and unresponsive.
4. Amplification:
○ Smurf attacks are amplified because each ICMP Echo Request is broadcast to all
devices on the network, and each device responds with a much larger ICMP Echo
Reply. The amplification factor can be significant—an attacker can generate
traffic hundreds of times larger than the original request.
1. The attacker sends a single ICMP Echo Request (ping) to the broadcast address of a
large network (e.g., 192.168.1.255).
50
2. The source IP address of the request is spoofed to be the victim’s IP address (e.g.,
203.0.113.1).
3. Every device in the network that receives the broadcasted ping responds with an ICMP
Echo Reply to the victim's IP address.
4. The victim is flooded with ICMP Echo Replies from all the devices on the network,
overwhelming their bandwidth and resources.
1. Reflection: The attack is reflected off other devices (victim does not initiate the ping), so
it’s difficult to trace back to the attacker.
2. Amplification: The attacker exploits the amplification factor of broadcasting to send a
small amount of traffic but generate a large volume of response traffic to the victim.
3. Spoofing: The attacker spoofs the victim's IP address, making it appear as though the
victim is initiating the attack.
4. ICMP-based: The attack relies on the ICMP Echo Request/Reply mechanism, which is
generally used for network diagnostics (ping).
5. Exploits Broadcast Networks: The attack requires an accessible broadcast network,
where devices will respond to broadcast pings. This can be easily exploited if devices are
misconfigured to allow broadcast pings.
● Amplification Factor: The ICMP Echo Reply is typically much larger than the request.
For example, a 64-byte ICMP Echo Request can generate a 576-byte ICMP Echo Reply.
This amplification factor can vary depending on the number of devices in the target
network.
● By broadcasting to a large network (e.g., thousands of devices), an attacker can amplify
the size of the attack, flooding the victim with much larger traffic than the original
request would generate.
○ Ensure that IP-directed broadcasts are disabled on routers and switches. This
prevents packets from being sent to a broadcast address, which would result in all
devices on the network responding.
51
2. Filter Incoming Traffic:
○ Block ICMP Echo Requests and ICMP Echo Replies at the firewalls and
routers, especially for public-facing networks, to prevent the network from being
used in a smurf attack.
4. Limit ICMP Traffic:
○ Use rate limiting to control the number of ICMP requests allowed to pass
through the network, reducing the risk of overwhelming the network with pings.
5. Use DDoS Protection Services:
○ Configure routers to block IP packets with source addresses that are internal to
the network (i.e., prevent traffic from being accepted from the outside that claims
to come from an internal address).
7. Regular Network Audits:
○ Regularly audit networks for misconfigured devices or routers that may allow
broadcasting of traffic, making them susceptible to exploitation in Smurf attacks.
Conclusion:
A Smurf attack is an older, yet still effective, type of DDoS attack that exploits ICMP and
broadcasting to flood a victim with amplified traffic. By spoofing the victim's IP address and
sending pings to broadcast addresses, an attacker can overwhelm a target with traffic from many
devices, making it difficult to trace the origin of the attack.
52
ARP Poisoning
ARP poisoning (also known as ARP spoofing) is a type of man-in-the-middle attack in which
an attacker sends falsified ARP (Address Resolution Protocol) messages over a local area
network (LAN). The goal is to associate the attacker's MAC (Media Access Control) address
with the IP address of another device on the network, such as the gateway or a target system.
This effectively redirects traffic meant for the legitimate IP address to the attacker's device,
allowing the attacker to intercept, modify, or drop communications between devices on the
network.
○ In an ARP poisoning attack, the attacker forges ARP responses and sends them
to devices on the network, associating the attacker's MAC address with the
victim's IP address.
○ These false ARP messages are broadcast to devices in the network, causing them
to update their ARP tables (which store the IP-to-MAC mappings) with incorrect
information.
3. Traffic Interception:
○ Devices on the network then send traffic to the attacker’s device instead of the
legitimate device (e.g., the router or another machine on the network).
○ The attacker can intercept, modify, or drop the packets between the victim and
other network devices.
○ The attacker can also forward the traffic to the legitimate destination, making it
appear as though nothing is wrong, but they still have full control over the traffic.
4. Man-in-the-Middle (MITM) Attack:
○ ARP poisoning is often used in conjunction with MITM attacks, where the
attacker is placed between the victim and the intended recipient, allowing the
attacker to manipulate the communication.
53
1. MITM (Man-in-the-Middle) Attack:
○ If the attacker sends incorrect ARP responses causing devices to send traffic to a
non-existent MAC address, the victim can be cut off from the network or
communication can be disrupted.
3. Session Hijacking:
○ The attacker can intercept and potentially take control of an active session
between the victim and a server. If the attacker has poisoned the ARP cache and is
in the middle of a conversation, they can hijack the session.
4. Traffic Sniffing:
○ If the attacker is monitoring the traffic, they can capture sensitive information,
such as passwords, unencrypted communications, or other confidential data that
passes through the poisoned ARP routes.
1. No Authentication in ARP:
○ ARP does not have any authentication mechanisms to verify whether the ARP
response is valid. This makes ARP poisoning possible because devices trust ARP
responses without validation.
2. Localized Attacks:
○ Since ARP poisoning works at the data link layer (Layer 2), it is not easily
detected by traditional network monitoring tools like firewalls or routers, which
operate at higher layers.
4. Man-in-the-Middle Effect:
○ The attacker has the ability to listen in, alter, or drop the communication between
two devices, making it a powerful attack for both interception and modification.
54
Detecting ARP Poisoning:
○ Regularly monitor ARP tables on network devices for any unexpected IP-to-
MAC address mappings. If a device's IP address is mapped to multiple MAC
addresses, it could indicate poisoning.
2. Use ARP Spoofing Detection Tools:
○ Tools such as ARPwatch, XArp, or Cain and Abel can help detect ARP
poisoning by monitoring the ARP requests and responses and notifying network
administrators when suspicious activity occurs.
3. Use Static ARP Entries:
○ If feasible, set static ARP entries on critical devices like gateways or servers,
ensuring that devices will always associate the correct MAC address with the
specified IP address. This prevents ARP poisoning from affecting these systems.
4. Monitor Traffic with Sniffers:
○ Use network sniffers like Wireshark to monitor network traffic. Look for
unusual ARP traffic or duplicate ARP responses, which could indicate poisoning
attempts.
○ Set static ARP entries for critical devices in the network, such as the default
gateway or DNS servers, to prevent them from accepting dynamic ARP replies
from potential attackers.
2. Implement Packet Filtering:
○ Use packet filtering to prevent unauthorized ARP responses. This can be done
using firewalls or intrusion detection systems (IDS) that monitor ARP traffic
and block suspicious packets.
3. Use Encryption:
○ Segment the network into different VLANs or subnets to limit the scope of ARP
poisoning attacks. A compromised ARP table in one segment would be limited to
that segment rather than affecting the entire network.
55
5. Use Dynamic ARP Inspection (DAI):
○ For critical devices, use secure alternatives to ARP, such as Static MAC
Addresses or protocols like Neighbor Discovery Protocol (NDP) in IPv6, which
includes security mechanisms like Secure Neighbor Discovery (SEND) to
prevent spoofing.
Conclusion:
ARP poisoning is a powerful attack that can lead to man-in-the-middle attacks, session
hijacking, traffic sniffing, or Denial of Service (DoS). It exploits the lack of authentication in
the ARP protocol and relies on IP-to-MAC address mappings being falsified. While it is
primarily a local network threat, it can have significant consequences, especially in unencrypted
communications.
To mitigate ARP poisoning, organizations can use static ARP entries, network monitoring
tools, encryption, and secure network protocols. Additionally, network segmentation and
features like Dynamic ARP Inspection (DAI) can help reduce the risk of ARP poisoning in
large-scale networks.
56