COS30015-IT Security MinhHoangDuong Practical Assignment
COS30015-IT Security MinhHoangDuong Practical Assignment
Assignment number and title: Practical Project (Assignment 1) Due date: 05/09
Signature:
Marker's comments:
Total Mark:
Extension certification:
Due to ease of use, simple installation compared to LOIC, and capabilities with the attacking method the chosen
tool for this testing scenario is Slowloris.
4
Defensive tool
Tool/Activities Ease of Install Amount of Community Available
documentation Activity Features
Snort [14] • Required • Well • Open- • Packet
installation. documented. source. sniffing.
• Public official • Highly • Snort
documentation active rules.
based. community. • Network
• Many user- • Frequent intrusion
based guides update. prevention.
iptables [15] • Part of the • Well • Open- • Managing
Linux documented. source. incoming,
system. • Large public • Fairly and
• Based on official active outgoing
Firewall. documentation community. packets.
based. • Blocking,
• Many user- allowing
based guides traffic.
Wireshark [16] • Pre-installed • Well • Open- • Packet
in Kali Linux documented. source. sniffing,
• Simple • Large public • Highly tracking,
installation documentation active analyzing.
• Many user- community. • User-
based guides interface.
In the scenario, Iptables is also used for mitigation due to the ease of usage and availability. In addition,
Wireshark is used for monitoring, detection, and protocol, packet tracking due to its availability, ease of
installation, and ease of usage on the defender sides.
5. Scenario proposal
The scenario is based on a type of Layer 7 DoS attack known as Slowloris Attack.
Slowloris Attack[17] is a type of layer 7 DoS attack in which the attackers exploit the behavior of HTTP
communication. After establishing a reliable connection (TCP) between the host and the user, the user’s
machine will send a request host’s server, and the host’s server will open a thread for each incoming request.
Exploiting this process, the attacker will send a partial request without ending it, keeping the thread open and
maintaining a simultaneous connection between the host and the attacker. To prevent the server from timing
out, the attacker will periodically send an HTTP request header to keep the server up and prevent the target
from handling legitimate requests. The attacks were originally developed by Robert Hansen (RSnake) in
2009[20], and demonstrated by Sam Bowne at DEFCON 17 [18].
Based on the definition explained above, the attacker and defender aims are categorized as below:
• The attacker (VM1): Establishing HTTP communication with the host (VM2), keeping the
connection up, and preventing the host (VM2) from processing requests from the observer (VM3).
• The defender (VM2): Restoring the connection from the observer (VM3).
The proposed scenario is carried out in an isolated environment which is created with VMware Workstation
Pro, assuming each other has known their IP address and there will be no IP address spoofing.
VM1: 192.168.100.100.200/24
VM2: 192.168.100.183/24, VM3: 192.168.100.129/24
5
Pre-requisites:
• VMware Workstation on a host machine.
• Isolated connection between virtual machines.
• VM1 (Attacker): Kali Linux, Slowloris.
• VM2 (Target/Defender): Linux (Kali Linux), Wireshark, iptables.
• VM3 (Observer): Any OS (XPPro), Web browser (Internet Explorer), Wireshark.
• All the previously proposed tools are either pre-installed with the OS or installed before being
isolated from the internet/host machine.
Steps:
• Startup VM1, VM2 and VM3.
• Perform a Slowloris DoS attack from VM1 against VM2.
• Observe the effect in VM2 and VM3 (expecting an indefinitely slow connection between VM3’s
browser and the website hosted on VM2, multiple packets in Wireshark).
• Apply iptables rules to mitigate the attack.
• Observe the effect in VM2 and VM3 (expecting a recovered fast connection between the browsers).
6
o “-s <number of sockets>” is the flag to specify the number of sockets
used in the test. The intended sockets to be used in the test is 500.
o “-v” is the flag to enable “verbose mode” or to display more
information about the attack.
Figure 2.1.1: Executing “python3 slowloris.py <target IPv4> -s <number of socket> -v”
Figure 2.1.2: There were 500 sockets (0-499) being used in the attack.
o After establishing the sockets, the program will send the first “keeping
alive” HTTP header before entering a 15s “sleeping” period as the
explained tactic in the scenario proposal parts.
o While running, after every 15 seconds, the attacking script will display
a report about the number of remaining sockets and send out another
pack of “keeping alive” HTTP headers.
7
- The attacking process after applying the defense mechanism
o After applying the defense mechanism from the defender's perspective,
the attacking script started sending out “fail to create new socket: timed
out” messages, and eventually, the sockets count number dropped to 20
(the connection limit specified below) as the program tried to create
another 480 sockets for connection in the total of 500 sockets.
Figure 2.1.2: Connection timing out, creating 480 (500 – 20 = 480) new sockets message from the attacking script.
Figure 2.2.1: Traffic between the observer (VM3) and the defender (VM2).
8
- Wireshark observation during the attacks, before applying defense
mitigation.
o During the first stage of the attack, Wireshark displayed numerous TCP
establishment packets between the host (VM2) and the attacker (VM1).
Figure 2.2.2: TCP establishment between each the attacker (VM1: 192.168.100.200) sockets and the host (VM2:
192.168.100.183)
o After that is HTTP timeout requests which is an effort of the defender to
disconnect from the attacker as explained in the scenario proposal.
o Wireshark also captured the HTTP GET method which is mentioned in the
“keep alive” headers, as an effort of the attacker to keep the connection up
against network timing out.
Figure 2.2.3: a mix of HTTP and TCP protocol packets in the traffic between the attacker (VM1: 192.168.100.200)
sockets and the host (VM2: 192.168.100.183).
9
Figure 2.2.4: HTTP GET packet detected by Wireshark being sent from the attacker (VM1)
- Applying defense mechanism
o Iptables is a firewall-based tool that is pre-installed in many Linux
distributions. It allows for determining firewall rules that will control the tr
incoming, outgoing, and forwarding traffic, from and to that machine.
o Since this required modifying the firewall, the command must be run with
the highest privilege (root).
o The mitigation tactic is limiting the connection establishment packets
between each IP address and dropping all packets with invalid TCP Flags,
focusing mostly on the TCP establishment stages of the attacks.
The default setting, which applies during the first attack, allows all
inbound, outbound, and forwarding traffic to be processed. This could
potentially be harmful to the machine if a cyber-attack occurs.
Figure 2.2.5: Default Iptables’ rules, allowing all INPUT, OUTPUT, and FORWARD traffic to be processed.
11
- Establishing connection during the attack
o When establishing a connection while the server is under attack, the
browser remained loading for an undoubtedly long period of time,
displaying the message “Website found, waiting for reply”, proving that the
server is under Slowloris attack and the attacker had successfully kept the
server “busy” from replying to the legitimate request.
Figure 2.3.2: “Website found, waiting for reply” message at the bottom left.
o On the other hand, if the observer (VM3) tried pinging (ICMP) the host
(VM2) while the host was under attack and the webpage was waiting
for a reply, the host machine still replied to the ping message, proving
this type of attack only affect on the application layer (7).
Figure 2.3.3: ICMP ping works while the webpage is “waiting for reply”
12
- Establishing connection after VM2 applied defense mechanism
o The connection is recovered.
13
IV. Criteria 4: Evaluation
1. Attacking Evaluation
In this scenario, The Slowloris has been successfully demonstrated as an effective method against HTTP web
servers. This attack works by establishing many complete TCP connections between the attacker and the
defender's port 80 (HTTP) of the defender. After that, the attacker will start sending partial HTTP requests to
keep the connection up for an extended period, preventing it from responding to legitimate traffic.
The attacking method is highly effective in causing serious delays in response time, is low in bandwidth [17], and
is hard to detect (as explained above in Criteria 3). Even though the attacking script used in the demonstration is
not the original script written by Robert Hansen (RSnake), the tool is relatively more accessible to many cyber
enthusiasts given that it was written Python.
On the other hand, the effectiveness of the attack still depends on several factors including the server’s
configuration and technical specification. For example, a server that is configured to limit the number of
simultaneous connections and connection time is less vulnerable. In addition, the attack is considered less
effective against modern, well-configured servers that are designed to handle large amounts of requests.
2. MITRE TTPs
According to MITRE ATT&CK Matrix for enterprise, DoS and DDoS attacks are classified as the tactic of
Impact (TA0040)[3] followed by many types of techniques including Endpoint Denial of Service (T1499)[3] and
Network Denial of Service(T1498)[3]
The Slowloris attack could be classified as Endpoint Denial of Service: Application Exhaustion Flood
(T1499.003)[3].
Tactic
Impact (TA0040)
• Objective: The primary goal of the attack is to disrupt the availability and deny operation of
the service.
• Context: By maintaining multiple connections with the target, the attacker can keep the host
server from processing legitimate or any other type of request.
Technique
Endpoint Denial of Service: Application Exhaustion Flood (T1499.003)
• Description: Established complete TCP connection. Sending partial legitimate HTTP request to
keep the connection up, but the HTTP request is never finished.
• Context: Each thread-based web server hosting software such as Apache can only handle a
certain amount of requests and use a timeout when they wait for an incomplete HTTP request,
but it is set to 300 seconds by default. Therefore, establishing a large amount of connection and
keeping the connection up will prevent it from processing other legitimate requests, causing a
Denial of Service.
14
3. Defending/Mitigation Evaluation
The defense strategy implemented in this scenario is considered effective as limiting and restricting the number
of concurrent access and requests is considered a realistic approach for DoS attack mitigation. In addition, as the
mitigation method is applied through iptables into the firewall, the set-out rule is applied nearly immediately,
reducing damage for the defender, therefore, even though the defender is overwhelmed before applying the
security mechanism, it is a win for the defender as the attacker’s target has been blocked.
On the other hand, although iptables has successfully mitigated the impact of the slowloris attack, the
application may not be optimal for all environments. Realistically, many defense methods could be used against
the Slowloris attack including using well-known legitimate cloud cyber security providers like Cloudflare or
implementing event-based web server hosting software like nginx which is considered immune to this type of
cyber intrusion [21].
V. Reference
1. “Understanding Denial-of-Service Attacks | CISA,” Cybersecurity and Infrastructure Security Agency
CISA, Feb. 01, 2021. https://www.cisa.gov/news-events/news/understanding-denial-service-attacks
2. Sharadin, G. (2023, December 20). DDOS attack types & mitigation Methods | Imperva. Learning
Center. https://www.imperva.com/learn/ddos/ddos-attacks/
3. MITRE Corporation, "MITRE ATT&CK," https://attack.mitre.org (accessed Sep. 5, 2024).
4. “DDoS threat report for 2024 Q2,” The Cloudflare Blog, Aug. 27, 2024.
https://blog.cloudflare.com/ddos-threat-report-for-2024-q2/
5. Netscout, “Global DDOS Threat Intelligence Reports | NETSCOUT,” Latest Cyber Threat
Intelligence Report, Apr. 12, 2024. https://www.netscout.com/threatreport/global-highlights/
6. C. S. E. Canada, “Protecting your organization against denial of service attacks -
ITSAP.80.100 - Canadian Centre for Cyber Security,” Canadian Centre for Cyber Security,
Jul. 29, 2022. https://www.cyber.gc.ca/en/guidance/protecting-your-organization-against-
denial-service-attcks-itsap80100
7. GeeksforGeeks, “Slowloris DDOS attack tool in Kali Linux,” GeeksforGeeks, Nov. 25, 2022.
https://www.geeksforgeeks.org/slowloris-ddos-attack-tool-in-kali-linux/?ref=oin_asr1
8. “t50 | Kali Linux Tools,” Kali Linux. https://www.kali.org/tools/t50/
9. S. Kottler, “February 28th DDOS incident report - the GitHub blog,” The GitHub Blog, Mar.
01, 2018. https://github.blog/news-insights/company-news/ddos-incident-report/
10. G. Yaltirakli [gkbrk], “GitHub - gkbrk/slowloris: Low bandwidth DOS tool. Slowloris rewrite
in Python.,” GitHub, 2015. https://github.com/gkbrk/slowloris
11. “The 2016 DYN attack and its lessons for IoT security,” MS&E 238 Blog, Standford
Management Science and Engineering, Jul. 30, 2017.
https://mse238blog.stanford.edu/2018/07/clairemw/the-2016-dyn-attack-and-its-lessons-for-
iot-security/ (accessed Aug. 30, 2024).
12. W. Turton, “This is why half the internet shut down today,” Gizmodo, Oct. 21, 2016.
https://gizmodo.com/this-is-probably-why-half-the-internet-shut-down-today-1788062835
13. “StrATCOM | NATO Strategic Communications Centre of Excellence Riga, Latvia.”
https://stratcomcoe.org/publications/hybrid-threats-2007-cyber-attacks-on-estonia/86
14. CrowdStrike and Lenaerts-Bergmans Bart, “Snort explained: Understanding Snort rules and
use cases,” crowdstrike.com, Apr. 24, 2023. https://www.crowdstrike.com/cybersecurity-
101/threat-intelligence/snort-rules/ (accessed Aug. 30, 2024).
15. Khess, “Sysadmin tools: How to use iptables,” Enable Sysadmin, Jan. 12, 2023.
https://www.redhat.com/sysadmin/iptables
16. R. Sharpe, E. Warnicke, and U. Lamping, “Wireshark User’s Guide,” wireshark.org.
https://www.wireshark.org/docs/wsug_html_chunked/
15
17. V. Markova, “The Slowloris Attack: How it works and how to protect your website - ClouDNS
blog,” ClouDNS Blog, Jan. 24, 4AD. https://www.cloudns.net/blog/the-slowloris-attack-how-
it-works-and-how-to-protect-your-website/
18. Bowne, S., 2009. Hijacking Web 2.0 Sites with SSLstrip and SlowLoris -- Sam Bowne and
RSnake (Robert Hansen) at Defcon 17. [video] Vimeo. Available at:
https://vimeo.com/7618090 [Accessed 4 September 2024].
19. R. Hansen [RSnake], “GitHub - XCHADXFAQ77X/SLOWLORIS: Slowloris HTTP DoS
RSnake,” GitHub. https://github.com/XCHADXFAQ77X/SLOWLORIS?tab=readme-ov-file
20. Ivicti. (2023, May 29). Slowloris attack. https://www.invicti.com/learn/slowloris-attack
21. I. Muscat, “Mitigate slow HTTP GET/POST vulnerabilities in the Apache HTTP server |
Acunetix,” Acunetix, Jun. 06, 2019. https://www.acunetix.com/blog/articles/slow-http-dos-
attacks-mitigate-apache-http-server/
16