A honeypot project designed to analyze cyber threats by monitoring and logging connection attempts on various network ports. This project demonstrates how honeypots can be used to detect, analyze, and report potential security threats.
Console output showing the honeypot server starting up and listening on multiple ports
- Multi-Port Monitoring: Listens on multiple common ports (SSH, HTTP, HTTPS, FTP, Telnet, MySQL, PostgreSQL, RDP, etc.)
- Threat Detection: Automatically detects suspicious connection patterns and potential attacks
- Real-time Logging: Comprehensive logging of all connection attempts and threats
- Threat Analysis: Periodic analysis and reporting of detected threats
- Connection Tracking: Tracks connections by IP address, port, and behavior patterns
- Easy to Extend: Modular design allows easy addition of new features
- Python 3.7 or higher
- No external dependencies (uses only Python standard library)
-
Clone the repository
git clone https://github.com/yourusername/honey.git cd honey -
Run the honeypot
python run.py
Or directly:
python main.py
-
Monitor the logs Logs are automatically created in the
logs/directory:honeypot.log- General system logsconnections.log- All connection attemptsthreats.log- Detected threatsconnection_data.json- Structured connection dataanalysis_report.json- Threat analysis reports
honey/
βββ main.py # Main honeypot server
βββ config.py # Configuration settings
βββ logger.py # Logging module
βββ analyzer.py # Threat analysis module
βββ detectors.py # Threat detection logic
βββ database.py # Data storage module
βββ run.py # Simple entry point
βββ requirements.txt # Dependencies (optional)
βββ README.md # This file
βββ LICENSE # MIT License
βββ .gitignore # Git ignore rules
Edit config.py to customize:
- Ports to monitor: Modify the
PORTSlist - Threat threshold: Adjust
THREAT_THRESHOLDfor sensitivity - Logging: Configure log files and verbosity
- Analysis interval: Set how often reports are generated
- Connection Monitoring: The honeypot listens on configured ports and accepts all incoming connections
- Threat Detection: Each connection is analyzed for suspicious patterns:
- Multiple rapid connections from same IP
- Port scanning behavior
- Connections to sensitive ports
- Automated attack patterns
- Logging: All connections and threats are logged with timestamps
- Analysis: Periodic reports are generated showing:
- Total connections
- Unique IP addresses
- Most attacked ports
- Top attacking IPs
- Threat level distribution
The system uses a 0-10 threat level scale:
- 0-2: Normal/suspicious activity
- 3-5: Moderate threat (multiple connections)
- 6-8: High threat (port scanning detected)
- 9-10: Critical threat (automated attack pattern)
All logs are stored in the logs/ directory:
- honeypot.log: System events and errors
- connections.log: Detailed connection logs
- threats.log: Detected threats with details
- connection_data.json: Machine-readable connection data
- analysis_report.json: Threat analysis reports
This is a showcase project for educational purposes.
- Do not use on production systems without proper security measures
- This honeypot is designed to be discovered and interacted with
- Ensure you have proper authorization before deploying
- The honeypot will log all connection attempts, which may include legitimate traffic
Contributions are welcome! This is an open-source project, and the community is encouraged to:
- Add new threat detection rules
- Improve analysis algorithms
- Add new features (web dashboard, API, etc.)
- Fix bugs and improve code quality
- Add documentation and examples
This project is licensed under the MIT License - see the LICENSE file for details.
Potential improvements for the community:
- Web dashboard for visualizing threats
- IP geolocation integration
- Integration with threat intelligence feeds
- Machine learning-based threat detection
- REST API for external systems
- Database backend (PostgreSQL, MongoDB)
- Email/Slack alerts for high-threat events
- Docker containerization
- Kubernetes deployment manifests
- Enhanced logging with ELK stack integration
For issues, questions, or contributions, please open an issue on GitHub.
Built as a showcase project to demonstrate honeypot concepts for cybersecurity analysis.
Note: This project is intentionally simple and extensible. Feel free to fork, modify, and enhance according to your needs!
