Cowrie Honeypot Setup
Cowrie Honeypot Setup
Cowrie is an SSH/Telnet honeypot. It should be treated as hostile-facing software, not as a normal trusted application.
This note records a minimal deployment using a dedicated user, Python venv, and systemd.
Example values:
- honeypot user:
cowrie - internal Cowrie SSH port:
2222 - public SSH trap port:
22or2222, depending on firewall/NAT design - fake hostname shown to attackers:
backup-server
Install
Create a dedicated user:
1 | sudo adduser --disabled-password --gecos "" cowrie |
Clone and install dependencies:
1 | git clone https://github.com/cowrie/cowrie.git |
Configure
1 | cp etc/cowrie.cfg.dist etc/cowrie.cfg |
Minimal config:
1 | [honeypot] |
Do not run Cowrie as root just to bind port 22. Keep
Cowrie on a high port and forward traffic if needed.
systemd Unit
1 | [Unit] |
Enable it:
1 | sudo systemctl daemon-reload |
Logs
1 | journalctl -u cowrie -e --no-pager |
The JSON log is usually the most useful file for later analysis.
Firewall Or Port Forwarding
If Cowrie listens on 2222, a simple redirect can expose
it as port 22:
1 | table ip nat { |
Only do this if the real SSH service is moved somewhere else, such as
22222.
Notes
- Do not reuse real hostnames, banners, usernames, or internal paths.
- Logs can contain malicious payloads. Treat them as untrusted input.
- Keep the honeypot isolated from important credentials and services.