This project demonstrates how credentials transmitted over unencrypted HTTP traffic can be intercepted on a network.
The lab simulates a public WiFi login portal and captures the credentials using packet sniffing.
- Python
- Flask
- Scapy
A simple login page simulating a public WiFi captive portal.
File:
app.py
Captures HTTP traffic on port 80 and extracts credentials from POST requests.
File:
sniffer.py
Captured credentials are saved to:
captured_credentials.txt
- Start the Flask server
- Start the packet sniffer
- Connect another device to the same network
- Access the login page
- Submit credentials
The sniffer intercepts the HTTP POST request and extracts the credentials.
[+] HTTP POST Request Captured
[+] Username : hanish
[+] Password : test123
Credentials saved to captured_credentials.txt
This experiment demonstrates why transmitting sensitive data over HTTP is insecure and highlights the importance of HTTPS encryption.
This project was conducted in a controlled lab environment using my own devices for educational purposes only.
