🛠️
Ghoul's Den
WebsiteGhoulsec-Vault
  • Ghoul's Den
  • Index of Tools
  • Index of Links
  • Top Ports
  • Initial Environment Deployment
    • Python3 & Pip Installation
    • Docker 🛳
    • Setting up AWS CLI
    • Msfconsole
    • Netplan configuration & Cloudinit
    • Wordlist Generation - CEWL
    • Apache2 Server
  • Information Gathering & Recon Tools
    • GHDB : Google Hacking Database
    • Sherlock : Social Media Footprinting
    • Nslookup
    • Dig (Domain Information Groper)
    • Recon-ng
    • HTTrack & Web Data Extractor
    • Email Tracker Pro
    • Shodan
    • ARIN Website Registry
  • Network Scanning Enumaration & Vulnerability Detection Tools
    • NMAP & SuperENUM
    • Nmap
      • Target Specification
      • Host Discovery
      • Port Scanning Techniques
      • Port Specification & Scan Order
      • Service Version Detection
      • OS Detection
      • Nmap Scripting Engine
      • Timing & Performance
      • FW / IDS / IPS Evasion
      • Miscellaneous Options
    • Colasoft Packet Builder & Megaping
    • Global Network Inventory
    • LDAP Enumeration > Active Directory Explorer
    • NetBIOS Enumerator
    • SMBEagle
    • RPC Scan
    • Nikto - Web Application Scanner
    • Enum4Linux
  • File Sharing Enumeration
  • Cloud Computing
    • AAD Internals
    • AWS CLI & S3
    • Trivy Scanner
    • S3 Scanner
    • LazyS3
  • Cryptography & stegnography
    • Veracrypt
    • Cryptanalysis Tools
    • Whitespace Cryptography - Snow
    • Creating a Self signed certificate in IIS
    • Steghide & Stegcracker
    • snow
  • Wireless Attacks
    • Aircrack-ng
  • Mobile Attacks
    • PhoneSploit-Pro
    • AndroRAT
    • ADB
  • SQL Injection Vulnerability
    • SQLMap
    • DSSS
  • IOT & OT Hacking
  • Social Engineering
  • Honeypot & IDS
    • Cowrie Honeypot
  • Sniffing & DDos
    • Sniffing
      • Capturing Remote packets using Wireshark
      • Detecting Sniffing using Nmap
    • Denial of Service (Dos & DDos)
      • DDos Protection using DDos Guardian
  • Malware Attacks
  • Password Cracking & Windows exploitation tools
    • Hydra
    • John
    • Hashcat
    • CrackMapExec
    • Impacket
    • Powerview
    • BitsAdmin
    • Rubeus (Kerberoasting) & Winpeas
    • AD-DC Querying
    • mstsc - RDP
  • System hacking & buffer overflow
    • Responder
    • Reverse Shell Generator
    • Clearing Traces
  • Session Hijacking
    • Caido
    • Bettercap
  • Web Servers & Applications
  • Linux Fundamentals
    • Find Command
    • Grep Command
Powered by GitBook
On this page
  • Installing Cowrie
  • Installing using Docker
  1. Honeypot & IDS

Cowrie Honeypot

Installing Cowrie

nano /etc/ssh/sshd_config
## Replace port 22 with the highest port 22222 and restart ssh
systemctl restart ssh
systemctl status ssh

Now install cowrie honeypot on ubuntu

 apt update
 apt-get install git python-virtualenv libssl-dev build-essential libpython-dev python2.7-minimal authbind

Add a user Cowrie

adduser --disabled-password cowrie

Login in to the new user account Cowrie

su - cowrie

Download the code for cowrie.

git clone http://github.com/micheloosterhof/cowrie

Move into cowrie folder and create a new virtual environment for the tool by running the command below.

cd cowrie/
virtualenv cowrie-env
source cowrie-env/bin/activate

Install the packages of Python that Cowrie needs to run

pip install --upgrade pip
pip install --upgrade -r requirements.txt

Create a copy of cowrie.cfg.dist so that we can edit that config file.

cd etc/
cp cowrie.cfg.dist cowrie.cfg

Edit the config file by changing the hostname first and then enable telnet using any of the editors.

nano cowrie.cfg

Redirect traffic of port 22 and 23 to the high ports 2222 and 2223 using iptables

iptables -t nat -A PREROUTING -p tcp --dport 22 -j REDIRECT --to-port 2222
iptables -t nat -A PREROUTING -p tcp --dport 23 -j REDIRECT --to-port 2223

Start/Stop cowrie.

bin/cowrie start
bin/cowrie stop

To see the logs in realtime in honeypot use below command.

tail -f /var/log/cowrie/cowrie.log

Installing using Docker

https://hub.docker.com/r/cowrie/cowrie
docker pull cowrie/cowrie
docker run -p 2222:2222/tcp cowrie/cowrie

Configuring Cowrie in Docker

Cowrie in Docker can be configured using environment variables. The variable starts with COWRIE_ then has the section name in capitals, followed by the stanza in capitals. An example is below to enable telnet support:

COWRIE_TELNET_ENABLED=yes

Alternatively, Cowrie in Docker can use an etc volume to store configuration data. Create cowrie.cfg inside the etc volume with the following contents to enable telnet in your Cowrie Honeypot in Docker:

[telnet]
enabled = yes
PreviousHoneypot & IDSNextSniffing & DDos

Last updated 5 months ago