Razan Project
Razan Project
Made BY : Supervised By :
- Abdalrheem Nail - Dr.Razn abduljawad
- Obaida mothanna
Chapter 1: Introduction
Section Description Page
Project Overview and Summarizes the goals and scope of the project. 2
Objectives
Importance of Understanding Highlights the significance of cybersecurity 3
Attack Methodologies and knowledge.
Defense Strategies
Ethical Considerations and Discusses the controlled and ethical approach taken 3
Legal Disclaimers during the project.
Chapter 2: Methodology
Section Description Page
Setup of Controlled Lab Details the environment setup for testing attacks and 4
Environment countermeasures.
Overview of Tools and Lists and explains tools like Hydra and Django Rate 5
Techniques Used limit used for testing.
Data Collection and Analysis Describes methods for logging, monitoring server 5
Methods responses, and assessing performance.
1|Page
Introduction
Project Overview and Objectives
This project investigates the process of simulating brute-force
attacks on web authentication systems to uncover
vulnerabilities and develop countermeasures. The primary goal
is to demonstrate how weak security practices can be exploited
and emphasize the importance of implementing robust
defenses to ensure system integrity and user protection.
2|Page
Ethical Considerations and Legal Disclaimers
To ensure ethical compliance, this project is conducted within a
controlled environment using a custom-built backend server.
This approach guarantees that all testing is authorized and free
of external risks.
Disclaimers:
All activities are performed for educational and cybersecurity
training purposes.
Unauthorized testing or use of these techniques is illegal and
unethical.
The project aims solely to foster awareness and improve
security practices.
This controlled setup aligns with ethical guidelines, ensuring the
project contributes positively to cybersecurity advancements.
3|Page
Methodology
4|Page
Overview of Tools and Techniques Used
Hydra: A powerful brute-forcing tool used to simulate attacks
on the login system. Hydra was configured to test multiple
password combinations against the server.
Python Scripts: Custom scripts were developed to automate
testing and analyze server responses during different security
configurations.
Django Rate limit: A Django package was employed to
implement rate-limiting, effectively mitigating brute-force
attempts.
Browser Developer Tools: Utilized for inspecting server
responses and verifying the presence of security mechanisms
such as CSRF tokens.
Data Collection and Analysis Methods
Attack Simulation Logs: Logs from Hydra and the server were
analyzed to identify successful and failed brute-force attempts.
Server Response Monitoring: Responses from the backend were
scrutinized to verify the behavior of implemented security
features.
Performance Metrics: The impact of added security measures
(e.g., time limits on login views) on server performance was
assessed.
5|Page
Attacks and countermeasures
The first attack:
In the initial phase, Hydra was used to gather information about
the server by brute-forcing the login credentials. Since the
server lacked CSRF protection initially, Hydra could easily test
multiple username-password combinations without facing
restrictions.
> .\hydra
6|Page
Countermeasures of first attack:
To counter this, CSRF tokens were added to the server. This
security measure ensured that every login request required a
unique CSRF token, which Hydra could not handle efficiently
because it lacked the ability to dynamically retrieve and use
these tokens.
7|Page
The second attack:
After implementing CSRF protection, we attempted to
weaponize the attack by incorporating Python scripts to fetch
CSRF tokens dynamically. These scripts automated the process
of extracting the token from the login page and submitting it
with each login attempt, effectively bypassing the initial
defense.
8|Page
Countermeasures of second attack:
To mitigate this, rate-limiting was introduced. By using the
Django Rate limit package, the server blocked excessive login
attempts from a single IP address, making brute-forcing with
tools or scripts impractical.
here we added decorator that set the login limit to three login
per minute.
This indicates the script failed the login attempts because the
decorator limits logins to three per minute, and the CSRF token
validation blocked unauthorized access.
9|Page
The resource:
1-Chatgpt the GOD of resource
https://chatgpt.com
2-Django Documentation. Cross Site Request Forgery
Protection. https://docs.djangoproject.com/
10 | P a g e