Kuboid
Open Luck·Kuboid.in

SSH Honeypots and Walkthrough Workshops

DEFCONConference726 views34:456 months ago

This talk explores the history and evolution of SSH honeypots used within the Packet Hacking Village at DEF CON. It details the transition from simple, low-interaction honeypots to complex, interactive environments designed to teach penetration testing skills through gamified challenges. The presentation highlights the use of Python-based frameworks like Cowrie to simulate realistic server environments and the integration of AI to manage challenge logic.

Beyond Basic Banners: How Modern SSH Honeypots Gamify Threat Intelligence

TLDR: Modern SSH honeypots have evolved from simple banner-grabbing scripts into complex, gamified environments that capture high-fidelity attacker behavior. By using frameworks like Cowrie to simulate interactive shells and file systems, researchers can now track sophisticated post-exploitation techniques rather than just credential stuffing. This shift allows security teams to move beyond simple IP blacklisting and gain actionable intelligence on how attackers navigate compromised infrastructure.

Security researchers often view honeypots as static, low-interaction traps designed to log brute-force attempts. While tools like Dionaea or Honeyd are effective for collecting malware samples and identifying scanning patterns, they rarely provide insight into the "why" behind an attacker's actions. If you are running a standard SSH honeypot, you are likely only seeing the initial phase of an attack: the credential spray. Once the attacker lands, they need a realistic environment to continue their work. If your trap doesn't provide that, they leave, and you lose the most valuable part of the engagement.

The Shift to High-Interaction Simulation

The real value in modern honeypot research lies in the transition from simple protocol simulation to high-interaction environments. When an attacker logs into a system, they expect a functional shell. If they run ls, they expect to see a file system. If they run cat, they expect to read a file. By using Cowrie, you can provide this illusion. Cowrie acts as a medium-interaction SSH and Telnet honeypot that logs not just the login attempts, but the entire session, including keystrokes and file uploads.

The technical power here is in the session replay. During a penetration test, you might use Selenium to automate interactions with a web interface, but in an SSH context, you are dealing with raw terminal input. Cowrie captures these inputs and maps them to a virtual file system. This allows you to see exactly what an attacker is looking for. Are they checking /etc/passwd? Are they trying to download a specific script from a remote C2 server? By observing these behaviors, you can identify the specific TTPs (Tactics, Techniques, and Procedures) that your organization is most vulnerable to.

Engineering the Trap

Building a convincing honeypot requires more than just installing a package. The most effective traps are those that feel "lived in." An empty server is an immediate red flag for any experienced attacker. You need to populate your virtual file system with realistic configuration files, dummy scripts, and even "confidential" documents that might bait an attacker into revealing their intent.

When configuring your environment, focus on the OWASP Identification and Authentication Failures category. Attackers are looking for weak credentials or misconfigurations that allow for lateral movement. By intentionally leaving "weak" credentials in your honeypot, you can observe how an attacker attempts to escalate privileges or move to other systems within your network.

Consider this basic configuration snippet for a Cowrie instance:

# Example of customizing the honeypot banner
[ssh]
enabled = true
listen_endpoints = tcp:2222:interface=0.0.0.0
version = SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.3

By spoofing a specific OpenSSH version, you can attract attackers looking for vulnerabilities associated with that release. This is where the research gets interesting. You aren't just waiting for random bots; you are actively profiling the types of threats targeting your specific infrastructure.

Real-World Pentesting Applications

For a penetration tester, the value of these high-interaction honeypots is twofold. First, they serve as an excellent way to test your own detection capabilities. If you deploy a honeypot in your own environment, does your SIEM trigger an alert when an attacker starts running reconnaissance commands? If not, you have a gap in your monitoring.

Second, these honeypots provide a controlled environment to study attacker behavior without risking production data. During a red team engagement, you can use these traps to divert an attacker's attention or to gain a better understanding of their methodology. If you know an attacker is using a specific set of tools, you can tailor your honeypot to mimic the environment those tools are designed to exploit. This allows you to observe the attacker's workflow in real-time, providing you with the data needed to harden your systems against their specific approach.

Defensive Considerations

Defenders should view honeypots as a critical component of their threat intelligence strategy. While they are not a replacement for traditional security controls, they provide a unique perspective on the threat landscape. By analyzing the data collected from your honeypots, you can identify emerging threats and adjust your defensive posture accordingly.

However, remember that a honeypot is only as good as its isolation. Ensure that your honeypot is properly segmented from your production network. Use Docker or other containerization technologies to ensure that even if an attacker manages to "break out" of the honeypot, they are still contained within a restricted environment. Never assume that your honeypot is impenetrable.

The next time you are looking to improve your detection capabilities, stop thinking about how to block attackers and start thinking about how to learn from them. A well-designed, high-interaction honeypot is one of the most effective tools in your arsenal for understanding the reality of the threats you face. Stop worrying about the noise and start focusing on the signal. What are they actually typing? That is where the real story is.

Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in