What I Learned After Using an SSH Honeypot for 7 Days
Learn more about using an SSH honeypot, from what honeypot to use, to the results after seven days.
Join the DZone community and get the full member experience.Join For Free
how did this idea come about?
the idea of using a honeypot to learn about potential attackers came to me while chatting with a friend that had exposed his ssh port to log into while away from home. he had mentioned that chinese ips had been attempting to gain access. these attacks reminded me of when broadband internet was introduced and there were quite a few firewall software apps protecting internet users. in these apps, when specific incoming traffic took place a popup dialog would alert you to a possible attack. today's internet is a lot more advanced with several new attack vectors and running an ssh honeypot would be a great opportunity to get up to speed about the attacks and attackers affecting the internet.
what honeypot to use?
honeypots are classified into 3 different categories:
- low interaction - simulates services and vulnerabilities for collecting information and malware but doesn't present a usable system for the attacker to interact with
- medium interaction - imitates a production service in a very controlled environment that allows some interaction from an attacker
- high interaction - imitates a production service where attackers can have a free for all until the system is restored
when choosing a honeypot i wanted something where i could not only see the attackers ip but what they are doing to a system. i also didn't want to expose a full blown system to the world where it could be used to hack my internal network or potentially be used for external attack. going with this premise i chose kippo. kippo is the most popular medium interaction ssh honeypot designed to log brute force attacks, and most importantly, the entire shell interaction performed by the attacker.
how did the week progress?
within the first hour of exposing ssh port 22, i had login attempts taking place from all over the world. the more time that had passed had me thinking about the popularity of kippo and given the fact it hasn't been updated in a while, it's most likely detectable and lacking simulated features used by attackers. a quick web search confirmed all these suspicions, so i replaced kippo with cowrie. cowrie is directly based off of kippo with several important updates that include:
- sftp and scp support for file upload
- support for ssh exec commands
- logging of direct-tcp connection attempts (ssh proxying)
- logging in json format for easy processing in log management solutions
- many more additional commands and most importantly, a fix for the previous kippo detection
the switch went real smooth as cowrie is basically a drop in replacement for kippo and scripts like kippo-graph work with it. in addition to switching to cowrie, i had updated the included fs.pickle file to not be the out-of-the-box file system you get by default.
as the week progressed the honeypot continued to rack up login attempts, a few successful, but most were not successful. because of this, i had added a few of the more common username/password combinations to hopefully entice attackers to interact with the honeypot.
what did the statistics look like?
over the course of a week there was a total of 1465 login attempts, which resulted in 1374 failed attempts and 91 successful attempts. additionally, all these attempts are a combination of 113 unique ip addresses.
top 10 usernames
top 10 passwords
top 10 combinations
top connections per country
(kr = south korea, us = united states, ru = russia, tn = tunsia, vn = vietnam, ua = ukraine, cn = china, fr = france)
what information have i learned?
the major takeaway from this experience is that most of the login attempts appear to be automated through the use of some tool or by way of a botnet. evidence of this comes from the fact that login attempt sessions use origin identifying passwords and repeating passwords tried day after day. additionally, by doing a cbl lookup of for example the top connection in my honeypot returns the following text.
attackers are also targeting exposed raspberry pi's and ubiquiti routers as shown in the statistics. both of these devices have factory default logins that are easily taken advantage of when not updated.
unfortunately, in the 7 days that this honeypot ran there were not any notable interactions. typically the most common types of attacks once an attacker gets inside ssh are botnet connections, irc bouncers, or anything that allows an attacker remote control and interaction.
Published at DZone with permission of Torrey Betts. See the original article here.
Opinions expressed by DZone contributors are their own.