A basic SSH honeypot with downloader (to collect malware samples). Made with Python, containerised in Docker, managed with Docker Compose. https://securehoney.net/blog/how-to-build-an-ssh-honeypot-in-python-and-docker-part-2.html
  • Python 69.2%
  • Shell 29.4%
  • Dockerfile 1.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2023-08-01 20:14:50 +02:00
.env Create .env 2021-08-05 18:02:07 +01:00
.gitignore Fix paramiko.py3compat error and cleanup the code a bit 2023-08-01 20:13:55 +02:00
docker-compose.yml Fix paramiko.py3compat error and cleanup the code a bit 2023-08-01 20:13:55 +02:00
Dockerfile Create Dockerfile 2021-08-05 18:02:47 +01:00
README.md Update README.md 2021-08-12 09:37:31 +01:00
requirements.txt Fix paramiko.py3compat error and cleanup the code a bit 2023-08-01 20:13:55 +02:00
ssh_honeypot.py Fix paramiko.py3compat error and cleanup the code a bit 2023-08-01 20:13:55 +02:00
ssh_honeypot_downloader.py Merge branch 'main' of https://github.com/Griefed/basic_ssh_honeypot_with_downloader 2023-08-01 20:14:50 +02:00
wait-for-it.sh Create wait-for-it.sh 2021-08-12 09:32:00 +01:00

Basic SSH Honeypot - with Downloader

Following on from Part 1, this repo extends the basic SSH honeypot with a downloaderer -- for getting malware samples. Part of my blog post: How to build an SSH honeypot in Python and Docker - Part 2. Made with Python, containserised in Docker, managed with Docker Compose.

Uses the Paramiko Python SSH protocol library.

Installation

Port forwarding

Setup port forwarding (e.g. from 22 to 2222)

iptables -A PREROUTING -t nat -p tcp --dport 22 -j REDIRECT --to-port 2222

Generate server key

ssh-keygen -t rsa -f server.key

Build

docker-compose build

Run

docker-compose up

Logs are recorded in the auto-generated ssh_honeypot.log and ssh_honeypot_downloader.log files