Honeypots: Tracking Attacks Against Misconfigured or Exposed ServicesOctober 17, 2019
Honeypots can be useful tools for gathering information on current attack techniques. Conversely, they can be an overwhelming source of data if you don’t have a specific goal in mind. I have been running a series of honeypots with rsync, FTP, SMB, and RDP services enabled and exposed to the internet throughout the month of August, evaluating weekly data sets to gather information on the overall volume and frequency of attacks against commonly misconfigured or exposed services associated with data loss. Based on the results, the data suggests that automated enumeration and attacks against these services is the most common threat. Given the widespread presence of devices currently connected to the internet, it is easy for attackers to create botnets that number in the hundreds of thousands. For example, a 21-year-old in Vancouver, Washington was recently convicted for creating an Internet of Things botnet that contained approximately 800,000 devices. With just one botnet containing that many devices, that should give you a clear picture of the scale of malicious automated activity that takes place daily.
A few definitions to get out of the way right up front:
- Honeypot: intentionally misconfigured computer with vulnerable services exposed to the internet.
- FTP: basic file transfer protocol that allows users to move files between networked computers.
- SMB: Server Message Block protocol is another file sharing service that also allows network browsing and printing services.
- RDP: Remote Desktop Protocol allows users to remotely access a network computer and use it like they normally would in person.
As you can see, all of these protocols allow for various forms of file sharing and remote access that could be problematic if they are abused by someone with malicious intent. These services, particularly the SMB protocol, were chosen because they are some of the more common ones that may be misconfigured when exposed to the internet, leading to inadvertent data exposure and loss. SMB is one of the most widely accessible protocols mainly due to the ubiquity of Windows systems exposed on the internet – SMB comes preinstalled with Windows, and admins may not even realize that the protocol is being exposed. Common misconfigurations of these services include: allowing anonymous login, default credentials, weak passwords, inadvertent exposure due to poor firewall configuration, and unpatched software on the exposed host.
I used T-Pot, developed by T-Mobile (https://dtag-dev-sec.github.io/mediator/feature/2019/04/01/tpot-1903.html), with some modifications to allow the gathering of data in the environment I had chosen. Outbound network traffic from the vulnerable services was disabled to prevent communication with C2 infrastructure or the delivery of multi-stage payloads. The honeypots used were:
- Cowrie: an SSH honeypot that was reconfigured to allow users to transfer files between remote and local machines via the rsync protocol.
- Dionaea: a multipurpose honeypot configured to use the FTP and SMB protocols.
- RDPy: a RDP honeypot.
I decided to focus on these services largely due to the high-profile exploits that impact the SMB (EternalBlue and DoublePulsar) and RDP (BlueKeep) protocols. Suricata, an open source IDS, was used to monitor activity on the honeypots and an Elasticsearch, Logstash, Kibana (ELK) stack was used to visualize data. Now that we’ve discussed how data was collected and inspected, we can get into the results!
(Honey)combing through the data
- 1,287,747 attempts to communicate with C2 infrastructure were made by the DoublePulsar backdoor which is delivered by the EternalBlue exploit.
- 5,546 alerts were generated by an attacker accessing the honeypot’s SMB share.
- 4,605 alerts were due to the SMB share in question running unpatched SMBv1 software that is vulnerable to attack.
- Additionally, there were 14,805 combined alerts for RDP connection requests and confirmation.
- SMB and RDP were attacked approximately 8 minutes after being exposed to the internet. It took approximately 13 minutes for the first attack against the FTP service.
- rsync was the lowest volume victim service, and it took several days for someone to attempt to rsync files via SSH.
During the reporting period, Dionaea was attacked 146,696 times, Cowrie was attacked 34,946 times (the overwhelming majority was SSH bruteforce attempts, only 14 rsync commands were issued), and RDPy was attacked 2,585 times. The breakdown of attacks by port can be seen below (FTP is not visible, as it made up 0.03% of all attacks total). 79.55% of the attacks were directed towards SMB on port 44. This averages out to 761 attacks against SMB, 182 attacks against SSH, and 13 attacks against RDP per hour.
Suricata logged the following alerts as the most frequent over the most recent reporting period of September 5th and 13th 2019.
Suricata also logged the following CVEs as the most attempted during the reporting period:
- CVE-2001-0540: Allows attackers to cause a Denial of Service attack against RDP.
- CVE-2012-0152: Allows attackers to send crafted packets and cause a Denial of Service attack against RDP.
- CVE-2019-0708: Allows unauthenticated attackers to cause a Denial of Service or remotely execute code against RDP. This CVE was used in the BlueKeep attack and proof of concept.
- CVE-2003-0818: Allows attackers to remotely execute code via flaws in commonly used Microsoft dynamic link libraries.
- CVE-2017-0143: Allows attackers to remotely execute code against SMB services. This CVE was used in the WannaCry ransomware attacks and was also known as EternalBlue.
- CVE-2017-7494: Allows attackers to upload a malicious shared library to Samba and get the server to execute it. Also known as EternalRed.
As seen in the above charts, SMB was attacked the most frequently, and RDP had the most CVE labelled exploits being thrown against it. Surprisingly, there was not a spike in RDP attacks involving BlueKeep after a module for the exploit was added to the open source penetration testing tool Metasploit. This is likely due to the module requiring manual installation into the Metasploit Framework, as it is not included in the current release. The module also requires manual configuration for a single target, so attacking IP ranges from within Metasploit is not currently possible.
Given the high volume and frequency of attacks against these services, it is likely that much of the traffic is automated botnet activity. As mentioned earlier, these services are typically exploited by criminals to exfiltrate data, deploy ransomware, and otherwise wreak havoc on misconfigured or unprotected networks.
Manual exploitation attempts ranged in the single digits per day. Taking that into account shows that the most effective risk mitigation strategies an organization can do involves patching vulnerable services, and not exposing unnecessary ports to the internet. While patch management can be a logistical nightmare for large organizations, it is important to develop a plan to keep critical infrastructure up to date and secure, especially with the increasingly popular trend of ransomware being used against enterprise environments. Thorough asset visibility and knowledge of devices that are exposed to the internet will help admins configure rules to appropriately restrict services and reduce the overall attack surface. A good rule of thumb is that if the service isn’t going to be used, turn it off and disable external access to the port in your firewall configuration. Instead of just being the victim of a large botnet attempting to exploit known vulnerabilities, your attacker will have to search for more specific issues to exploit, which requires much more effort and potentially no reward on their behalf.
Following these basic security principles can drastically improve the security posture of your organization. There is no way to make things unhackable, but reducing the surface area of attack vectors with a defense in depth approach will certainly help reduce the risk many organizations face.
Digital Shadows SearchLight™ helps our clients gain an attackers-eye-view of their external-facing infrastructure. If you’d like to see for yourself, try poking around our tool for 7 days:
Indicators of Compromise sourced from Digital Shadows Honeypots:
|MD5 hashes of files uploaded to the SMB honeypot|