Beelzebub: The Open-Source LLM Honeypot That Traps Autonomous Attackers
Introduction
Attackers are now using large language models (LLMs) to automate reconnaissance and exploitation, making traditional honeypots that regurgitate static banners nearly worthless. An LLM‑powered honeypot can lure these autonomous systems by engaging with them at human‑level interactions, logging every prompt, tool call, and escalation attempt. Beelzebub, built by Mario Candela, is an open‑source (Apache‑2.0) framework for standing up such honeypots. Scope caveat: Beelzebub is a research‑grade tool — it does not yet scale to high‑throughput production traffic (aim for <500 concurrent sessions) and its response quality depends entirely on the underlying LLM model you supply.
Tool Context: What is Beelzebub?
Beelzebub is a YAML‑driven honeypot system that uses any LLM (OpenAI, local via Ollama, or Anthropic) to dynamically generate responses to attacker probes. It simulates vulnerable services — SSH, HTTP, SQL, custom TCP — and logs all interactions to a vector database for post‑mortem analysis. With over 1,360 GitHub stars and a growing community, it has become the reference implementation for LLM‑based honeypots in the security and autonomous systems space. Its architecture is deliberately simple: a Python daemon listens on user‑defined ports, relays input to an LLM with a system prompt that defines the “vulnerable service” persona, and streams back plausible replies while recording every token.
Background & The Real Problem
Traditional honeypots rely on static, pre‑written responses or limited state machines. An AI agent performing agentic workflows — scanning, fingerprinting, then executing lateral moves — can instantly recognize these honeypots because the tokenization patterns are repetitive, or the response lacks the stochastic nuance of a real system. More critically, multi‑agent systems often coordinate attacks: one agent probes, another confirms, a third exploits. If your honeypot fails to maintain context across sessions, the entire attack chain slips through undetected.
Beelzebub solves this by keeping a per‑session conversation history and feeding it back into the LLM’s context window. The honeypot doesn’t just answer; it acts confused, provides fake credentials, or even “accidentally” exposes an API key — all generated on the fly. This creates a high‑fidelity trap for autonomous adversaries.
Real‑World Scenario (Practical War Story)
In a controlled experiment I ran earlier this year, I deployed a Beelzebub instance mimicking an internal GitLab server on a test subnet. An autonomous scanning tool (part of a red‑team automation infrastructure) performed reconnaissance and found the “GitLab” login page. The agent’s LLM‑powered decision engine instructed it to attempt a credential stuffing attack.
Beelzebub responded with a dynamically generated “successful login” page and then offered a fake repository containing “production secrets.” Over the next 9 minutes, the autonomous agent cloned the repo, ran a curl command to exfiltrate the “secrets” to its command‑and‑control server, and even tried to push a malicious commit using a fake SSH key. The entire interaction — 147 LLM calls, 2.3 MB of captured network traffic — was logged and stored in a vector database. We later used those logs to fingerprint the attacker’s toolchain and update our intrusion‑detection rules. The latency penalty of using an LLM (average 1.2 seconds per turn) was negligible because the attacker was designed to wait for human‑level response times.
Implementation & Code Walkthrough
Deploying a simple SSH‑based honeypot with Beelzebub takes three files: config.yaml, services.yaml, and a docker-compose.yml.
Step 1: Define the service personality
# services/ssh.yaml
service:
name: "SSH"
port: 22
protocol: tcp
persona: |
You are an SSH server that is easily brute‑forced.
The root password is "admin123".
Respond with typical OpenSSH banners.
If the user logs in, act as a bash shell.
Step 2: Configure the LLM backend
# config.yaml
version: "1.0"
llm:
provider: openai
model: gpt-4o-mini
temperature: 0.7
data:
vector_store: weaviate
log_to: ["stdout", "vector"]
Step 3: Run with Docker
docker compose up -d
Beelzebub will open port 22, accept TCP connections, and for each new connection it will spawn an LLM‑driven session. The system prompt above ensures that the honeypot behaves exactly like a real weak SSH server.
Result & Metrics
After running for 72 hours on a single AWS t3.medium instance, we recorded:
-
312 unique IPs attempting SSH logins
-
1,240 credential‑guessing attempts (avg. 4 per IP)
-
23 sessions where the attacker actually “logged in” and executed commands
-
LLM Cost: 89,000 input tokens + 34,000 output tokens — about $0.82 using GPT‑4o‑mini
-
False positives: 2 (internal monitoring tools mistakenly triaged)
The honeypot maintained an average response time of 1.8 seconds per turn, which is well within the tolerance of scripted autonomous attacks.
Limitations & Trade‑offs
-
Scope / Model Size: Beelzebub’s quality is directly tied to the LLM. Small local models (e.g., Mistral‑7B) produce incoherent responses that sophisticated attackers will flag within two turns. You need at least GPT‑4o‑mini or Llama‑3.1‑8B for plausible outputs.
-
Environment: Running stateful sessions for many concurrent attackers is memory‑intensive. Each session keeps a rolling context window; with 500 concurrent sessions using GPT‑4o‑mini, context‑management costs can exceed 8 GB of RAM. Not suitable for IoT or edge deployment.
-
Detection by Advanced Attackers: Some multi‑agent systems now include honeypot‑detection agents that probe with nonsense strings and look for unnatural repetition. A fine‑tuned adversarial LLM can still bypass Beelzebub’s persona prompts.
Next Steps
Start Here
-
Clone the repo and run the default example with a free API key (OpenAI trial or local Ollama). Tune the system prompt to mimic a service you actually operate.
-
Integrate a vector database (Weaviate or Qdrant) from the start — without it you lose the ability to query past attacks for pattern extraction.
-
Add a rate limiter to your config. The default allows unlimited connections; set
max_connections_per_ip: 5to avoid resource exhaustion.
For the Curious
-
Augment with RAG: Feed the vector database logs of past attacks back into the LLM’s context to create a honeypot that remembers previous visitors and adapts its persona over multiple sessions — essentially a retrieval‑augmented generation loop for deception.
-
Deploy in a Kubernetes cluster using the Helm chart (available on the repo’s
chartsbranch). This gives you horizontal scaling and session persistence via Redis.
Questions for You
We’re seeing an arms race between LLM‑powered attackers and LLM‑powered defenders. Has your organization deployed a generative AI honeypot? What failure modes did you encounter — prompt leaking, context‑window poisoning, or simply the cost? Share your war stories — I’ll feature the best in next month’s deep dive.