This tool acts as a transparent proxy that can operate in either active or passive mode. It listens for HTTP requests, logs sensitive information, and in active mode, injects JavaScript for client-side data collection.
Disclaimer: This code is for educational and security research purposes only. Unauthorized use is illegal and unethical.
- Python 3.5
- Required libraries:
argparse,re,socket,zlib,gzip,io,urllib.parse - Ensure proper permissions to bind to the desired IP and port (root/admin)
-m, --mode: Specifies the mode of operation (activeorpassive).ip: The IP address to listen on.port: The port to listen on.
python proxy_logger.py -m <mode> <ip> <port>To run the proxy in passive mode on IP 127.0.0.1 and port 8080:
python proxy_logger.py -m passive 127.0.0.1 8080To run in active mode:
python proxy_logger.py -m active 127.0.0.1 8080- Logs sensitive information such as emails, passwords, and other personal data from requests and responses.
- Logs are stored in
info1.txt.
- Injects JavaScript into HTML responses to collect client-side data such as:
- User-Agent
- Screen resolution
- Language preference
- Logs client information in
info2.txt. - Only HTML content is modified for JavaScript injection; other content types are forwarded unaltered.
- Injected script sends client data to the proxy server using an image request.
- GET and POST Requests: Requests are forwarded to the target server.
- Phishing Page Serving: If a
GETrequest is detected forexample.com, a sample login page is served. - Phishing Data Handling: A
POSTto/loginlogs client information and responds with aGETtohttps://example.com.
- Supports decompression of
gzipanddeflateencoded responses for inspection and modification.
- info1.txt: Stores sensitive information extracted from requests and responses in passive mode.
- info2.txt: Stores client information logged in active mode.
- This tool must be run responsibly and in compliance with legal and ethical standards.
- Ensure no unauthorized data collection occurs.
This tool is provided as-is with no warranty. It is intended for educational and research purposes only.