Turning the Tables: Honeypots Flawed Logic and Counter-Intelligence

Sheila A. Berta (Head of Research · Dreamlab Technologies)

Swiss Cyber Storm 2023 · Day 1 · Arena

Overview

In an insightful talk at Swiss Cyber Storm, Sheila A. Berta, Head of Research at Dreamlab Technologies, unveiled novel techniques to identify honeypots by exploiting fundamental flaws in their emulated services. Titled "Turning the Tables: Honeypots Flawed Logic and Counter-Intelligence," Berta's presentation challenged the conventional wisdom surrounding honeypot deployment and detection. She demonstrated how subtle, yet critical, differences in how emulated honeypots handle malformed or unexpected network packets can serve as reliable fingerprints, even when traditional indicators like service banners or certificates are customized.

Watch on YouTube · Slides

Visual summary for Turning the Tables: Honeypots Flawed Logic and Counter-Intelligence by Sheila A. Berta
Visual summary for Turning the Tables: Honeypots Flawed Logic and Counter-Intelligence by Sheila A. Berta

Key moments

  1. 0:00 Introduction and speaker's research motivation
  2. 2:00 What are honeypots and how they work
  3. 7:50 Novel detection: Flawed logic in packet handling
  4. 8:50 Flawed logic examples: FTP and SSH honeypots
  5. 21:00 Automating detection with Nuclei templates and demo
  6. 23:00 Honeypot statistics and counter-intelligence findings
  7. 26:00 Q&A: Do attackers try to detect honeypots?

Turning the Tables: Honeypots Flawed Logic and Counter-Intelligence

Speakers: Sheila A. Berta, Head of Research, Dreamlab Technologies

Conference: Swiss Cyber Storm

YouTube: https://www.youtube.com/watch?v=XM4ry4B4eUQ

Overview

In an insightful talk at Swiss Cyber Storm, Sheila A. Berta, Head of Research at Dreamlab Technologies, unveiled novel techniques to identify honeypots by exploiting fundamental flaws in their emulated services. Titled "Turning the Tables: Honeypots Flawed Logic and Counter-Intelligence," Berta's presentation challenged the conventional wisdom surrounding honeypot deployment and detection. She demonstrated how subtle, yet critical, differences in how emulated honeypots handle malformed or unexpected network packets can serve as reliable fingerprints, even when traditional indicators like service banners or certificates are customized.

The core premise of Berta's research is that while honeypots are designed to mimic real systems to lure attackers and gather threat intelligence, their emulated nature often leads to "flawed logic" in their protocol implementations. These flaws manifest as unexpected error messages or deviations from standard protocol behavior when confronted with non-standard inputs. By systematically identifying these discrepancies across a range of popular honeypot frameworks and services, Berta developed a robust method for distinguishing traps from genuine systems.

This research carries significant implications for both offensive and defensive security. For attackers, it provides a sophisticated toolkit to evade detection and avoid wasting resources on decoy systems. For defenders, it highlights the inherent weaknesses in many widely deployed honeypots, urging a re-evaluation of current strategies. More importantly, it offers a crucial mechanism for refining threat intelligence by filtering out data generated by honeypots, leading to a more accurate understanding of attacker tactics, techniques, and procedures (TTPs) targeting real assets. The ability to unmask honeypots also opens avenues for counter-intelligence, allowing researchers to identify organizations operating these deceptive systems.

Background

▶ Watch: Introduction and speaker's research motivation (0:00)

Honeypots are deceptive systems intentionally designed to mimic real services, attracting and trapping attackers to study their methodologies. The primary goal is to gather threat intelligence, observe TTPs, and potentially develop improved detection mechanisms, such as Yara rules for newly identified attack patterns. A typical honeypot architecture involves an attacker interacting with a service that appears real, while behind the scenes, a stack of technologies (often the Elastic Stack with Kibana) processes and visualizes the attack logs for defenders. Popular open-source frameworks like Dionaea and Cowrie frequently utilize this setup.

Honeypots generally fall into two major categories: real services and emulated services. Real services, as the name suggests, involve deploying actual software (e.g., a real web server or database) configured to act as a trap. Their advantage lies in offering full functionality, making them inherently more difficult for attackers to detect as honeypots. However, they demand significant effort for setup, logging integration, and ongoing maintenance, often requiring redeployment after compromise.

In contrast, emulated services are purpose-built honeypots designed from the ground up to mimic specific services. They are typically easier to deploy, maintain, and are often open-source and free, making them a popular choice for their low operational overhead. The trade-off, however, is that their capabilities are often limited compared to real services, and crucially, they are susceptible to flawed logic issues – the very vulnerability exploited in Berta's research. It's important to note that the level of interaction (low, medium, or high) a honeypot allows an attacker is distinct from whether it's a real or emulated service; an emulated service can still offer a high degree of interaction.

Prior research into honeypot detection primarily focused on techniques such as analyzing service banners (static strings identifying the service), examining default responses to common commands, inspecting file content, or identifying common certificate configurations. Other methods included looking for suspicious behaviors like an unusually high number of open ports or the hosting of industrial control systems (ICS) honeypots on public cloud providers, which would be atypical for real-world deployments. While effective to some extent, these methods are often easily circumvented by honeypot operators who customize banners, modify default responses, or employ more sophisticated configurations. Berta’s work aimed to develop a more resilient detection strategy that would bypass these superficial countermeasures.

Key Findings

▶ Watch: Novel detection: Flawed logic in packet handling (7:50)

Sheila Berta's research introduces a novel and highly effective methodology for identifying honeypots based on flawed logic in their packet handling functions. The core insight is that while honeypots strive to mimic real services, their emulation is rarely perfect, especially when confronted with malformed or unexpected inputs. By sending carefully crafted, non-standard network packets, Berta demonstrated that honeypots often respond with error messages or behaviors that deviate significantly from those of genuine services. These discrepancies serve as unique and reliable fingerprints for detection.

The advantages of this approach are multifaceted. Firstly, it provides a robust method to bypass common anti-detection techniques, such as customizing service banners, modifying default command responses, or altering certificate configurations. The flawed logic is embedded deeper within the honeypot's core code, making it much harder to fix without patching the underlying software. Secondly, Berta's method emphasizes minimal interaction with the target system, often requiring only one or two packets to trigger a detectable flaw. This is crucial because honeypots are traps, and extensive interaction risks detection by the honeypot operator. Minimal interaction also enables rapid, large-scale scanning and analysis.

To automate the detection process, Berta developed NUCLEI templates – open-source YAML files designed for vulnerability detection. Each template is tailored to identify a specific honeypot by sending the unique malformed packet and then matching the characteristic flawed response. These templates are designed to be easily deployable, allowing anyone to conduct honeypot identification with a single command.

Applying these techniques, Berta conducted a large-scale analysis in Switzerland using the Scops cyber radar platform. Her findings revealed the widespread presence of honeypots: over 280 services running on 121 detected honeypots, which, after accounting for an estimated 20% false positive rate for SSH, still amounted to approximately 100 distinct honeypots. These were distributed across 14 cantons, with Zurich showing the highest concentration. While many were hosted on cloud providers or by Internet Service Providers, a concerning number of organizations, including a scientific center and several universities, were found to be running honeypots directly within their own networks. This capability for counter-intelligence allows researchers to identify specific entities operating honeypots, raising significant security and privacy implications for those organizations.

Technical Deep Dive

▶ Watch: Flawed logic examples: FTP and SSH honeypots (8:50)

Berta's technical deep dive showcased specific examples across various common network services, meticulously detailing the malformed inputs and the distinct, flawed responses that differentiate honeypots from real systems. The general principle involves sending an unexpected or non-standard request and observing the resulting error message or protocol deviation.

  1. Dionaea FTP:
  • Attack: Sending a line break (\n) as the password during an FTP session.
  • Honeypot Response: Dionaea FTP responds with 500 syntax error pass requires an argument.
  • Real Service Comparison: A genuine ProFTPD server, when receiving a line break as a password, correctly responds with 530 Login incorrect and then 221 Goodbye if a QUIT command is issued. Dionaea, however, consistently returns a syntax error for unexpected input, highlighting its inability to correctly parse the protocol state.
  1. Cowrie SSH:
  • Attack: Initiating an SSH connection with a malformed version string, such as SSH-1.337-OpenSSH_8.2p1.
  • Honeypot Response: Cowrie SSH responds with Protocol mismatch. Version 1337.
  • Real Service Comparison: Modern OpenSSH servers typically respond with a generic Protocol mismatch without echoing the specific malformed version. While very old SSH versions might exhibit similar behavior, this specific response is a strong indicator for Cowrie.
  1. Mailoney SMTP:
  • Attack: Sending a non-existent or unsupported command, such as HELP.
  • Honeypot Response: Mailoney responds with 502 Error: command help not implemented.
  • Real Service Comparison: A real Exim server, upon receiving a HELP command, provides a list of supported commands. For a non-existent command, it would typically return an "unrecognized command" message. Mailoney's explicit "not implemented" error flags its limited functionality.
  1. Dionaea HTTP:
  • Attack: Sending an HTTP request with an invalid or malformed method, such as AAAA.
  • Honeypot Response: Dionaea HTTP returns 501 Not Implemented.
  • Real Service Comparison: A genuine Nginx server, when presented with an invalid method, correctly responds with 405 Method Not Allowed, adhering to HTTP standards. The 501 Not Implemented from Dionaea reveals its incomplete HTTP protocol handling.
  1. Snare HTTP:
  • Attack: Sending an HTTP request with a malformed HTTP version (e.g., HTTP/1.337).
  • Honeypot Response: Snare HTTP responds with Bad line expected dot. This error message is particularly revealing as it originates directly from the underlying Python script, effectively exposing the honeypot's implementation details.
  • Real Service Comparison: A real Nginx server would return 505 HTTP Version Not Supported. The raw Python error from Snare is a clear indicator of flawed emulation.
  1. SMB (Dionaea/Cowrie SMB):
  • Attack: Initiating an SMB negotiation.
  • Honeypot Flaw: During the SMB challenge-response mechanism, the honeypot consistently returns a hardcoded, non-random string (e.g., A8T) as part of the challenge.
  • Real Service Comparison: Genuine SMB servers generate a unique, random challenge string for each negotiation. Berta attributed this flaw to honeypots using packet manipulation libraries like Scapy, which often hardcode such values for debugging purposes, assuming they don't need cryptographic randomness for their primary function.
  1. Dionaea MySQL:
  • Attack: Initiating a MySQL connection.
  • Honeypot Flaw: In the initial network packet response, Dionaea MySQL includes a peculiar, unknown string (AAA) alongside the version information.
  • Real Service Comparison: A real MySQL server responds with its version and a set of standard features, without this extraneous string.
  1. MongoDB Honeypot:
  • Attack: Sending a buildInfo command.
  • Honeypot Flaw: The honeypot's response to buildInfo inexplicably omits the version information, which should be the first element.
  • Real Service Comparison: A genuine MongoDB instance includes the version as the primary piece of information in its buildInfo response.
  1. Elasticpot:
  • Attack 1: Sending an HTTP request with an invalid method (similar to Dionaea HTTP).
  • Honeypot Response 1: Elasticpot returns 501 Not Implemented and an internal message stating, "I don't know how to handle that request."
  • Real Service Comparison 1: A real Elasticsearch instance would correctly respond with 405 Method Not Allowed.
  • Attack 2: Sending a POST request to update a non-existent or random index.
  • Honeypot Response 2: Elasticpot accepts the request, responding with "OK."
  • Real Service Comparison 2: A real Elasticsearch server would return a document missing exception because the index does not exist.
  1. Redis Honeypot:
  • Attack: Sending a QUIT command or a non-existent command.
  • Honeypot Flaw: The honeypot's error messages for these commands are almost identical to a real Redis server, but they conspicuously lack a trailing whitespace character at the end of the message.
  • Real Service Comparison: A real Redis server includes this subtle whitespace. Berta aptly noted, "the devil is in the details," highlighting how even a single missing character can betray an emulation.
  1. Cisco ASA Honeypot:
  • Attack: Accessing the web interface.
  • Honeypot Flaw: The honeypot's login page displays "logon" instead of the standard "login" found on real Cisco ASA devices. While Berta acknowledged the possibility of very old Cisco versions using "logon," this deviation is a strong indicator for modern systems.
  1. Citrix Honeypot:
  • Attack: Inspecting the HTML source of the login portal.
  • Honeypot Flaw: The honeypot's HTML code for its login page, despite visually mimicking a real Citrix portal (e.g., matching labels for username and password), omits a specific "terms of conditions" string that is present but often hidden in the source code of a genuine Citrix portal.
  1. ICSPot (Siemens S7):
  • Attack: Sending an initial packet to the emulated PLC.
  • Honeypot Flaw: The honeypot's response is consistently different from how real Siemens PLCs respond. Real PLCs often respond with a string like AN L LE to initial packets.
  • Real Service Comparison: Berta noted she was unable to find any real PLC that responded in the manner of the honeypot, making this a reliable fingerprint.
  1. Dionaea MQTT:
  • Attack: Attempting to connect using MQTT protocol version 5 (V5).
  • Honeypot Flaw: Dionaea MQTT fails to properly handle V5, instead responding as if a V3 connection was attempted, indicating a protocol parsing error.
  • Real Service Comparison: A real MQTT broker would correctly process and respond to an MQTT V5 connection.

These detailed technical observations underscore the fundamental principle of Berta's research: imperfect emulation, no matter how subtle, leaves traces that can be leveraged for reliable detection.

Demo / Proof of Concept

▶ Watch: Honeypot statistics and counter-intelligence findings (23:00)

To demonstrate the practical application of her research, Sheila Berta presented a clear proof of concept utilizing NUCLEI templates. Nuclei is a fast, open-source tool for configurable targeted scanning based on templates, widely used for vulnerability detection. Berta leveraged its flexibility to create specific YAML-based templates, each designed to identify a particular honeypot by exploiting its unique flawed logic.

The structure of these templates is straightforward: they define the specific malformed or unexpected input packet to send to the target service (input parameter) and then specify the characteristic string or pattern to look for in the service's response (matchers parameter). If the response matches the predefined flawed logic, the template identifies the target as a honeypot.

During the demonstration, Berta showcased the execution of these templates using the Nuclei command-line tool. For instance, she demonstrated how to detect Dionaea FTP:

nuclei -debug-response -t dionaea-ftp.yaml -target <IP_Address>

The -debug-response flag provides more verbose output, showing the raw network interaction. The tool successfully identified the Dionaea FTP honeypot by sending the line break as a password and matching the 500 syntax error pass requires an argument response.

Another example involved the Dionaea MySQL honeypot. The Nuclei template for MySQL sends a more complex initial connection packet, and then the matcher looks for the distinctive AAA string that is unique to the honeypot's response. The demo confirmed that Nuclei successfully identified the MySQL honeypot based on this specific string.

Berta emphasized that these YAML files are simple to use and will be made publicly available on her GitHub repository, allowing security researchers and defenders to easily implement these detection capabilities. The demonstration effectively illustrated how the research translates into an automated, efficient, and reliable method for honeypot identification with minimal effort.

Defensive Implications

▶ Watch: Q&A: Do attackers try to detect honeypots? (26:00)

Sheila Berta's research offers critical insights and warnings for defenders, particularly those involved in threat intelligence, security operations, and honeypot deployment.

Firstly, for honeypot operators, the findings are a stark reminder that superficial customizations – such as altering service banners, default responses, or certificate configurations – are insufficient to mask an emulated honeypot. The detection methods presented exploit deeper, flawed logic within the honeypot's core packet handling functions. To truly evade detection, operators would need to patch the underlying honeypot code, a significantly more complex and resource-intensive task. This suggests a strong argument for considering real services as honeypots, despite their higher setup and maintenance costs, as they are inherently more robust against these types of logic-based detection techniques.

Secondly, a significant warning from Berta is: "Please don't run honeypots in your own network." Her counter-intelligence findings in Switzerland revealed that numerous organizations, including academic institutions, were operating honeypots directly within their internal IP ranges. When these honeypots are detected, an attacker or researcher gains valuable intelligence about the operating entity. This could lead to the organization's IP addresses being blacklisted by sophisticated attackers, or worse, revealing their security posture and potentially their strategic intent. Moreover, Berta highlighted that the code quality of many open-source honeypots is often poor, making them susceptible to their own vulnerabilities. Deploying such potentially vulnerable systems directly within an organization's trusted network perimeter poses a significant risk of compromise, turning the trap into a gateway for attackers. Defenders are strongly advised to isolate honeypots in highly segmented, untrusted network zones, far removed from critical infrastructure.

Finally, for defenders consuming threat intelligence, Berta's work underscores the importance of data veracity. Honeypots, by their very nature, generate attack statistics that can significantly distort the accuracy of threat intelligence feeds. If a security team is analyzing attack patterns or vulnerability exploitation attempts, and a substantial portion of that data originates from honeypots rather than real systems, their understanding of actual threats to their enterprise can be skewed. The ability to reliably identify and filter out honeypot-generated data ensures a cleaner, more accurate picture of genuine attacker TTPs, leading to more informed defensive strategies and resource allocation. Attackers are known to use similar techniques to identify and blacklist honeypots, avoiding detection and conserving their resources for real targets.

Key Takeaways

  • Flawed Logic Detection: Honeypots can be reliably identified by exploiting subtle "flawed logic" in their packet handling functions, which causes them to respond differently to malformed inputs compared to real services.
  • Bypasses Traditional Evasion: This method effectively bypasses common honeypot evasion techniques like customizing banners, certificates, or default command responses, requiring deep code changes to mitigate.
  • Minimal Interaction, Large Scale: The detection technique requires minimal interaction (often 1-2 packets), making it efficient for large-scale scanning and reducing the risk of being trapped by the honeypot.
  • Automated Identification: Open-source tools like NUCLEI, coupled with custom YAML templates, can automate the process of identifying various honeypot frameworks and services.
  • Counter-Intelligence Risk: Running honeypots within an organization's own network is a significant counter-intelligence risk, as their detection can reveal the operating entity and lead to IP blacklisting by attackers.
  • Threat Intelligence Accuracy: Filtering out honeypot data using these detection methods is crucial for generating accurate threat intelligence and understanding genuine attacker TTPs targeting real systems.

About the Speaker(s)

Sheila A. Berta is a highly experienced and respected offensive security researcher with over 15 years in the field. She currently serves as the Head of Research at Dreamlab Technologies, a Swiss company based in Bern. Berta is a prominent figure in the cybersecurity community, known for her contributions to cutting-edge research. She is a distinguished member of the academic committee (review board) for Black Hat USA, one of the world's largest and most prestigious security conferences. Her expertise is frequently sought after, leading her to speak at numerous high-profile technical security conferences, including Black Hat Briefings, DEF CON main stage, Hack in the Box, and now Swiss Cyber Storm. Her work consistently pushes the boundaries of offensive security research, providing valuable insights for both attackers and defenders.

Reviews

Dr. Zero (Offensive Security Researcher) — STRONG ACCEPT

Berta systematizes something offensive operators have known for a decade: emulated honeypots are held together by duct tape, and they shatter the second you step off the happy path. Shipping a suite of Nuclei templates to automate this fingerprinting is a massive gift to red teams trying to stay quiet and threat intel teams drowning in polluted data. It's a highly pragmatic, well-executed hit on the lazy state of deception tech.

Heather Calloway (CISO) — STRONG ACCEPT

This is a technical talk with a blunt governance warning. If your threat intel team relies heavily on raw feed data, or worse, if your network team is running open-source honeypots on your own AS, this is a mandatory watch. It forces a necessary conversation about whether your deception program is actually just creating liability.

→ Top-rated talks at Swiss Cyber Storm 2023

All talks from Swiss Cyber Storm 2023