
Cowrie SSH/Telnet Honeypot https://docs.cowrie.org/
.. SPDX-FileCopyrightText: 2014 Upi Tamminen [email protected] .. SPDX-FileCopyrightText: 2014-2025 Michel Oosterhof [email protected] .. .. SPDX-License-Identifier: BSD-3-Clause
Cowrie
What is Cowrie
Cowrie is a medium to high interaction SSH and Telnet honeypot designed to log brute force attacks and the shell interaction performed by the attacker. In medium interaction mode (shell) it emulates a UNIX system in Python, in high interaction mode (proxy) it functions as an SSH and telnet proxy to observe attacker behavior on another system. In LLM mode, it uses large language models to generate dynamic responses to attacker commands.
Cowrie <http://github.com/cowrie/cowrie/>_ is maintained by Michel Oosterhof.
Documentation
The Documentation can be found here <https://docs.cowrie.org/en/latest/index.html>_.
Slack
You can join the Cowrie community at the following Slack workspace <https://www.cowrie.org/slack/>_.
Features
Choose to run as an emulated shell (default):
cat files such as /etc/passwd. Only minimal file contents are includedOr proxy SSH and telnet to another system
Or use an LLM backend (experimental):
For both settings:
User Mode Linux <http://user-mode-linux.sourceforge.net/>_ compatible format for easy replay with the playlog utility.mailoney <https://github.com/awhitehatter/mailoney>_)Installation
There are three ways to install Cowrie: pip, Docker, and a git checkout.
For your first honeypot, pip and Docker are the easiest paths.
Use a git checkout for development or advanced scenarios where you want to
modify Cowrie itself. Full instructions for all three are in
the installation guide <https://docs.cowrie.org/en/latest/INSTALL.html>_.
Docker
Docker images <https://hub.docker.com/repository/docker/cowrie/cowrie>_ are available on Docker Hub.
To get started quickly and give Cowrie a try, run::
$ docker run -p 2222:2222 cowrie/cowrie:latest $ ssh -p 2222 root@localhost
To just make it locally, run::
$ make docker-build
PyPI
Cowrie is available on PyPI <https://pypi.org/project/cowrie>_. To install it
into a virtual environment and start it::
$ mkdir my-honeypot && cd my-honeypot
$ python3 -m venv cowrie-env
$ source cowrie-env/bin/activate
(cowrie-env) $ pip install cowrie
(cowrie-env) $ cowrie init
(cowrie-env) $ cowrie start
cowrie init writes the configuration file etc/cowrie.cfg in the current
directory; logs and downloads land under var/.
Requirements
Software required to run locally:
Files of interest:
etc/cowrie.cfg - Cowrie's configuration file (operator-owned). Created by cowrie init.src/cowrie/data/etc/cowrie.cfg.dist <https://github.com/cowrie/cowrie/blob/main/src/cowrie/data/etc/cowrie.cfg.dist>_ - bundled defaults, edit your etc/cowrie.cfg insteadetc/userdb.txt - credentials to access the honeypotsrc/cowrie/data/fs.pickle - fake filesystem; carries both metadata (path, uid, gid, size, mode) and the embedded contents (A_CONTENTS bytes) for the small files attackers commonly cat. Edit via fsctl; rebuild via make build-fs-pickle.src/cowrie/data/txtcmds/ - output for simple fake commandsvar/log/cowrie/cowrie.json - audit output in JSON formatvar/log/cowrie/cowrie.log - log/debug outputCommands
cowrie - start, stop and restart Cowriefsctl - modify the fake filesystemcreatefs - create your own fake filesystemplaylog - utility to replay session logsasciinema - turn Cowrie logs into asciinema filesContributors
Many people have contributed to Cowrie over the years. Special thanks to:
var/lib/cowrie/tty/ - session logs, replayable with the playlog utility.var/lib/cowrie/downloads/ - files transferred from the attacker to the honeypot are stored here