00->1
Learning pathStep 19 of 62Defence, offence and intelligence ← All writeups

Honeypots, Explained

If you are reading this, you have probably heard that defenders sometimes build fake servers on purpose to attract attackers, and you want to know how that works, what it is for, and whether it is something a normal organization should do.

By the end you will be able to define a honeypot, explain why it produces such clean alerts, tell the main types apart, name the common tools, describe what defenders learn from the data, list the safety rules for running one, and explain its limits. It connects to Reconnaissance, Threat Intelligence and OSINT and False Positives and False Negatives, so those are useful companions.


1. What a honeypot is

A honeypot is a decoy: a system, or a piece of a system, that exists to be found, probed and attacked, so that defenders can watch it happen.

NIST's glossary, quoting the US standard CNSSI 4009-2022 (which draws on IETF RFC 4949), defines it this way (source):

"A system (e.g., a web server) or system resource (e.g., a file on a server) that is designed to be attractive to potential crackers and intruders, like honey is attractive to bears."

Lance Spitzner, who founded the Honeynet Project, gave the definition most often repeated by practitioners. In a 2003 paper he quotes the honeypot mailing list's wording: a honeypot is "an information system resource whose value lies in unauthorized or illicit use of that resource" (Spitzner, ACSAC 2003).

Read that definition twice. A normal server is valuable when it works for its users. A honeypot is the opposite: it is valuable when someone attacks it. If nobody ever touches it, it has little value.

Two points that are easy to get wrong

  1. A honeypot is not always a whole fake computer. NIST's definition includes "a file on a server". A honeypot can be a full server, a single service, a fake database record, a login that does not belong to any person, or a document. Spitzner's term for the non-computer kinds is the honeytoken (section 5).
  2. A honeypot does not always have "fabricated vulnerabilities". Many present services that look weak, but some simply look like ordinary, valuable systems: a database server, a file share, an admin login. What matters is not that it is breakable. What matters is that nobody legitimate has any reason to use it.

2. Why it works: every touch is suspicious

A real server gets thousands of legitimate requests, and security tools must pick out the bad ones from that noise. A honeypot reverses the problem.

Spitzner puts it this way: every honeypot is "a resource or entity with no production value", so anything or anyone interacting with it is an anomaly. His example is a web server in the DMZ (the network zone between the internet and the inside network) that has no entry in DNS and is not used for business. Any visit is assumed to be unauthorized and most likely malicious. And if the honeypot is probed by one of your own production servers, that suggests the production server has been compromised and is being used as a launching pad.

The same paper lists the benefits that follow:

Benefit Why
Small data sets Honeypots only record data when someone interacts with them. Spitzner contrasts the thousands of alerts a day from traditional tools with about a hundred from honeypots, which makes each record more valuable and easier to analyse
Fewer false positives Any activity is unauthorized by definition, which makes honeypots efficient at detecting attacks (see False Positives and False Negatives)
Catches things signatures miss Signature-based tools need to know an attack first. A honeypot has no such need: new or unseen attacks stand out because any interaction stands out
Works with encryption Encrypted attacks still end at the honeypot, where the traffic is decrypted
Flexible and light A honeypot can be anything from a database record to a network of computers, and needs few resources

The same paper is honest about the other side, covered in section 8.


3. A short history

When What Source
1986 An astronomer-turned-system-manager at Lawrence Berkeley Laboratory, Clifford Stoll, noticed a 75-cent accounting discrepancy and traced it to an intruder. To keep the intruder connected long enough to be traced, he invented a fictitious "SDI" department with fake files. His 1989 book The Cuckoo's Egg tells the story, and Wikipedia describes the SDI files as a honeypot Wikipedia: The Cuckoo's Egg
1991 Bill Cheswick at AT&T Bell Laboratories described how, on 7 January 1991, a cracker who thought he had found the sendmail DEBUG hole tried to get the password file. Cheswick sent him one, then spent several months leading him on, to trace his location and learn his methods, using a chroot "Jail" built to watch his activities. The paper is An Evening with Berferd Cheswick, An Evening with Berferd
1999 The Honeynet Project was founded. It is a non-profit security research organization that describes its goal as learning the tools, tactics and motives of attackers and sharing the lessons Honeynet Project

Cheswick's paper also shows a small version of a modern idea. Before the big incident he had added "a few fake services" to the gateway and a script to scan the logs daily, because, as he writes, there were no authorized accounts for Internet users on the gateway other than one, so it was easy to pick out probes.


4. The types of honeypot

Honeypots are classified in two main ways.

By purpose

Type Purpose
Production honeypot Deployed inside an organization to improve its security: to detect intruders and tell defenders something is wrong. Wikipedia notes that low-interaction honeypots are the easier ones to deploy for this
Research honeypot Used to study the threats organizations face and learn how to protect against them. More complex, and usually run by research or government bodies

By how much the attacker can do ("interaction level")

Level What it is Example tools
Low interaction Simulates only the services attackers commonly request. Needs fewer resources and less code, but can only collect limited information Honeyd, which creates virtual hosts on a network and can make them appear to run certain operating systems; OpenCanary, a multi-protocol honeypot meant to catch intruders after they have breached a non-public network
Medium to high interaction Offers a convincing environment where the attacker can do more, so more is recorded Cowrie, which describes itself as a "medium to high interaction SSH and Telnet honeypot" that logs brute-force attacks and the shell interaction performed by the attacker
High interaction / honeynet Real systems, not emulations, watched closely. The most informative and the riskiest Honeynets (below)
Pure honeypot A full production-like system monitored through network taps, with no extra software installed on it Described in Wikipedia's article on honeypots

The trade-off is simple. The more realistic and open it is, the more you learn, and the more risk you carry. Spitzner states it directly: simple honeypots carry little risk, while honeynets carry a great deal.

Honeynets

A honeynet is an entire network of computers set up to be attacked. Spitzner describes it as a specialized architecture in which nothing is emulated: the systems and applications can be the same ones found in your organization, with extra files, records and log entries placed for the attacker to find. Its key piece is a Honeywall gateway, a layer-two bridging device that controls and captures all of the attacker's inbound and outbound activity. Because it is a bridge, it has no MAC address, does no routing and does not change the packet TTL, which makes it very hard for an attacker to notice. Its job is to control and capture everything the attacker does, in and out, so the attacker can be watched while their activity is kept under control.


5. Other decoys: honeytokens, canaries and traps

Spitzner calls a honeytoken "a digital entity" that is not a computer, such as a spreadsheet, a login, or a database record, but which follows the same rule as a honeypot: no one should interact with it, so any interaction signals unauthorized or malicious activity.

His example is worth remembering. A hospital must find staff who look at patient records they have no reason to see. It loads a bogus record, a patient who does not exist, into the database. No genuine task ever needs that record, so if anyone opens it, that person has probably broken the privacy policy. As he says, there are no signatures to update and no rules to configure: you load the record, monitor it, and see who touches it.

Modern tools package this idea:

Tool or idea What it does
Canarytokens Free tokens described as "motion sensors for your networks, computers and clouds". Types include DNS tokens, document tokens (PDF, Word, Excel), cloud credential tokens such as AWS keys, web bugs and cloned websites. When someone uses a token, you get an alert. No software has to be installed
OpenCanary A daemon that emulates network services and alerts when attackers touch them. It is open source (BSD-3-Clause) and light enough for small devices
Spam traps Unused email addresses that collect spam. Project Honey Pot describes itself as a distributed system for identifying spammers and the bots that scrape addresses from websites: participating sites publish tagged addresses, and mail sent to them shows when and from where the address was harvested
Database honeypots Decoy databases that lure attacks such as SQL injection (see SQL Injection)
Malware honeypots Decoys that imitate vulnerable services to attract malicious software and capture a copy. Dionaea, for example, emulates services including FTP, HTTP, SMB, MySQL and MSSQL
ICS/SCADA honeypots Imitate industrial control systems. Conpot is one, maintained by the Honeynet Project

At the larger scale, vendors sell deception technology: honeypot ideas automated for big organizations. MITRE has two public frameworks that give the practice a vocabulary. MITRE Engage is "a framework for planning and discussing adversary engagement operations", built on the idea that with adversary engagement "the adversary only needs to be wrong once". MITRE D3FEND, its catalogue of defensive techniques, defines a Decoy Environment as one that "comprises hosts and networks for the purposes of deceiving an attacker", with honeynets as sub-types.


6. What defenders learn

A honeypot produces evidence about attackers, which is the raw material of threat intelligence (see Threat Intelligence and OSINT). For example, an SSH honeypot such as Cowrie can record:

  • The source addresses that connect.
  • The usernames and passwords tried in brute-force attacks (see Brute Force vs Password Spraying).
  • The commands the attacker types once they believe they are in.
  • Files they download or upload. Cowrie saves files fetched with wget or curl, or uploaded with SFTP or scp, for later inspection.

Cowrie writes its logs as JSON, which is easy to send to a log system, and it can forward events to platforms such as Splunk, ELK stacks and VirusTotal.

What each kind of evidence is used for:

Evidence Use
Source IP addresses, domains, malware hashes Indicators of compromise for blocking and for hunting. These are the bottom of the Pyramid of Pain, so treat them as short-lived
Credentials tried Shows which passwords attackers are guessing. Helps decide which weak passwords your own systems should reject
Commands and scripts Show the attacker's behaviour (their tools and techniques), which is the more valuable top of the Pyramid of Pain
Malware samples Can be analysed safely elsewhere (see How Malware Works)
Which services get probed, and when Tells you what is being scanned for on the internet right now
Any hit from inside your own network A strong sign that something inside is compromised or someone is where they should not be

That last row is the production use. An internet-facing honeypot mostly tells you what the world is trying. An internal honeypot or honeytoken, which no staff member has any reason to touch, tells you something much more specific: someone is inside and looking around.


7. Running one safely

A honeypot is something you want the bad guys to interact with. NIST's guide to intrusion detection and prevention (SP 800-94) states the main rules in one paragraph. Honeypots are hosts "that have no authorized users other than the honeypot administrators because they serve no business function; all activity directed at them is considered suspicious". They are "a supplement to, not a replacement for" other security controls. They should be managed by "qualified incident handlers and intrusion detection analysts". And "the legality of honeypots has not been clearly established", so organizations "should carefully study the legal ramifications before planning any honeypot deployments".

Turning that into practice:

Rule Why
Isolate it Put it in its own network segment, away from real systems and real data. Spitzner warns that an attacker could use a honeypot to attack other, non-honeypot systems, and that the risk grows with the realism of the honeypot
No real data and no real credentials Everything on it should be fake. If an attacker steals it, nothing real should be lost
Control what leaves Outbound traffic is how a compromised honeypot harms others. The Honeywall approach controls and captures both directions. At the simplest, block or heavily limit outbound connections
Log everywhere, and send logs off the honeypot The honeypot may be wrecked or tampered with, so keep a copy elsewhere
Alert the right people An alert nobody sees is wasted. Decide in advance who looks at it and what they do
Run the software with minimum privilege Cowrie's documentation, for example, recommends a dedicated non-root user and refuses to start as root
Do not disturb the real service Cowrie's documentation warns that redirecting port 22 to the honeypot can make your real SSH server unreachable, and tells you to move the real one to a different port first
Keep it patched and maintained A forgotten honeypot becomes a real, vulnerable system
Get the legal and policy questions answered first See section 8
Treat it as an addition It does not replace firewalls, patching, monitoring or backups

A way to learn, safely

If you want to see one in action, do it in a lab, not on a company network:

  1. Use a virtual machine or a spare computer on an isolated network that you own.
  2. Install a tool such as Cowrie (an SSH and Telnet honeypot), OpenCanary, or T-Pot. T-Pot is an all-in-one platform that, according to its documentation, supports more than twenty honeypots, including Cowrie, Dionaea, Conpot and Honeytrap, with the Elastic Stack for viewing the data and Suricata for network monitoring. Its documentation lists 8 GB of RAM and a 128 GB disk for a sensor and 16 GB and 256 GB for the main "hive".
  3. Follow the tool's own installation guide. Cowrie's, for example, has a quick start that uses pip and also documents a Docker deployment. Then read the logs. A simple exercise is to connect to your own Cowrie from another machine and watch your commands being recorded.
  4. Only expose it to the internet if you understand the risks in this section and are allowed to. Putting a honeypot on the internet is a deliberate decision, because you are inviting automated probing and attacks.

For a free taste with no installation, create a canarytoken (a document or a web link) and watch the alert fire when you open it.


Limit Explanation
Limited field of view Spitzner's comparison is a microscope: a honeypot only sees what interacts with it. It does not watch traffic to your real systems
Risk of misuse A compromised honeypot can be used as a stepping stone ("pivot") to real systems if it is not isolated
Can be recognised Wikipedia notes that spammers use counter-measures that identify honeypots from their configuration. Any honeypot that looks too perfect or too fake may be spotted
Accidental use Wikipedia notes that legitimate users may touch a honeypot if it is poorly communicated. Make sure staff know which addresses are off-limits, or you will investigate your own people
Not a fix A honeypot tells you about attacks. It does not stop them
Cost of attention Someone has to read the results and keep it running

NIST says plainly that the legality of honeypots "has not been clearly established". An academic survey of the legal side groups the issues into three: privacy (you may be recording an intruder's communications), liability (if your honeypot is used to attack others), and entrapment. On entrapment, an article hosted by Network World states that the argument applies only to officers of the law, so a private organization running a honeypot is not committing entrapment. The same article says it is not legal advice and tells readers to consult a lawyer qualified in this area, and that legality varies by jurisdiction.

The practical conclusions are:

  • Talk to your legal and compliance team before deploying one on anything beyond a private lab.
  • Never use a honeypot to attack back. A honeypot is for watching, not for hacking the attacker's machine.
  • Do not use real people's data as bait.
  • Make sure the honeypot's records are handled properly, because they can contain personal data such as IP addresses.

9. Common mistakes

Myth The facts
"A honeypot is just a vulnerable server" It is a resource whose value is being used by attackers. Many honeypots are not vulnerable at all. They imitate services, or are just a fake record or file
"It catches attackers" It records and detects them. Catching, in the sense of arrest, is a law-enforcement matter
"More realistic is always better" More realistic gives more data and more risk. Match the type to your goal and your ability to manage it
"A honeypot protects my real systems" It does not shield anything. It gives information and early warning
"Any alert from it proves a serious attack" An internet-facing honeypot is hit all the time by automated scanners. An alert from an internal honeypot is the much stronger signal
"I can put it anywhere" Isolation, outbound control and logging are not optional
"It replaces my other tools" NIST: a supplement, not a replacement
"Honeypots are only for big companies" Free tools exist (Canarytokens, OpenCanary, Cowrie, T-Pot). But they still need someone to run and watch them, and legal clearance

Closing

A honeypot is a decoy whose value comes from being attacked. Because no legitimate user has a reason to touch it, almost every interaction is worth attention, which gives defenders clean alerts and a look at attacker behaviour without risking real systems, provided the honeypot is isolated and its outbound traffic is controlled. The idea goes back to Stoll's fake SDI files in 1986 and Cheswick's chroot jail in 1991, and it now covers anything from a full honeynet to a single fake file or a canarytoken.

Keep these points:

  • A honeypot's value lies in unauthorized use. No real user should ever touch it.
  • That gives clean signals: fewer false positives, a small data set and the ability to spot new attacks.
  • Types: low, medium and high interaction, honeynets, honeytokens, spam traps.
  • Higher interaction means more information and more risk.
  • Run them isolated, with no real data, controlled outbound traffic and off-device logs.
  • NIST: a supplement, not a replacement, run by qualified people, and with the legal questions studied first.
  • Test only in a lab you own until you understand the risks.