ozaydin.dev

Open to long-term internships

Writing

A fake SSH server for watching bots: ssh-honeypot

I wrote an SSH honeypot that looks like a real server but runs nothing, and records what connecting bots try.

ssh-honeypot is a fake SSH server that looks like an ordinary OpenSSH server. It listens on an idle port and records what the bots that connect to it try: usernames, passwords, client versions. If I want, it lets some attempts "log in" to a fake shell and records the commands typed there too.

The fake shell

The shell is an imitation built entirely in Python, in memory. No command really runs and nothing is downloaded.

What I paid attention to

A honeypot should not be the most dangerous thing on the server. So the process runs with no privileges, and every connection is limited in time, size and count. Everything an attacker can influence flows in one direction, from the socket to the recorder. There are timeouts for login and for idle sessions. The dashboard is a separate process, opens the database read-only and is reachable only from the local address.

mini-siem can read the records too, so the two projects can be connected.

Related project · 100 SSH Honeypot A low-interaction honeypot that looks like an ordinary SSH server and records the usernames and passwords bots try.