Master's Thesis Project by Osamah Amer (2026)
Welcome to the central repository for the Phishing Defense Lab. This project is a controlled environment designed to simulate and analyze modern Adversary-in-the-Middle (AiTM) attacks, specifically focusing on how reverse proxies like Evilginx2 interact with different authentication levels.
To get the lab up and running, you need to set up the database first, then launch the backend and frontend.
Before running the code, create the environment for your data:
- Create Database: Use your PostgreSQL terminal to create a database named
phishing_lab_db. - Run Schema: Create the necessary tables including
usersandtoken_blacklist. - Add Admin: Insert a default user for immediate access:
INSERT INTO users (email, password, name) VALUES ('admin@lab.com', 'password123', 'White Hat Hacker');
- Navigate to the
/backendfolder:cd backend. - Install dependencies:
npm install. - Configure your environment: Create a
.envfile with your database credentials. - Launch:
npm run dev.
- Open a new terminal and navigate to the
/clientfolder:cd client. - Install dependencies:
npm install. - Launch the interface:
npm run dev. - Access the lab at:
http://localhost:5173.
This laboratory is split into two main sections:
- Backend API: Built with Node.js/Express. Manages secure sessions, JWT generation, and the server-side revocation logic.
- Client Interface: A modern React 19 dashboard that acts as the "victim" application, featuring real-time security state management.
- Level 1 (Legacy/Cookies): Simulates legacy authentication using
application/x-www-form-urlencodedpayloads and HttpOnly cookies. - Level 2 (Modern/Tokens): Simulates modern SPA authentication using
application/jsonpayloads and JWT tokens stored in LocalStorage. - MFA Module: Analyzes how TOTP adds a critical layer of defense against real-time session hijacking.
- Active Session Revocation (Blacklisting): Implements a centralized server-side blacklist for both JWTs and Cookies. This ensures that session termination is absolute, neutralizing stolen tokens even before their expiration.
- Hybrid Protocol Support: Successfully handles diverse data streams (URL-encoded vs JSON) to simulate heterogeneous corporate environments and test middleware resilience.
- HttpOnly Session Protection: Level 1 utilizes strict cookie attributes to mitigate XSS-based session theft, isolating the research focus to AiTM/Proxy-based attacks.
- Synchronized Termination Logic: A robust "Terminate Session" protocol that purges client-side storage while simultaneously revoking the session identifier on the server.
- Evilginx & Proxy Fingerprinting: Detecting reverse proxies via header analysis.
- HTTP Header Security: Identifying unauthorized
X-Forwarded-Forpatterns. - Base URI Detection: Catching DOM-based phishing injections.
This software is strictly for educational and research purposes. It was developed as part of a Master's Thesis to study defense mechanisms. Please use it responsibly in a controlled environment.
cybersecurity phishing-simulation aitm-defense mfa-bypass evilginx-analysis react19 node-js master-thesis