SSHwatch Insights Blog

SSH Honeypots: Detecting and Understanding Attack Patterns

SSH servers continue to be prime targets for attackers worldwide, with millions of automated attempts occurring daily against internet-facing systems. While implementing strong SSH security measures is essential, proactive security professionals are increasingly turning to an intelligence-gathering approach: SSH honeypots. These specialized decoy systems offer unique insights into attacker behaviors that traditional security measures simply cannot provide. This article explores how SSH honeypots can help you understand attack patterns, strengthen your defenses, and transform anonymous connection attempts into actionable security intelligence.

What Are SSH Honeypots?

SSH honeypots are decoy systems designed to look like legitimate SSH servers while actually serving as monitored traps for attackers. They simulate vulnerable SSH services to attract malicious actors, record their activities, and provide security teams with actionable intelligence on attack methods.

Unlike your production servers, honeypots have no legitimate users, which means any connection attempt is potentially malicious and worth investigating. This clear separation makes honeypot data exceptionally valuable for threat intelligence.

Why Deploy SSH Honeypots?

SSH honeypots offer several compelling benefits that make them worthwhile investments for organizations of all sizes. They function as an early warning system, allowing you to detect new attack patterns before they target your production infrastructure. This advance notice can be invaluable when emerging threats begin circulating in the wild. The threat intelligence gathered from honeypots provides concrete data on attacker origins, techniques, and tools, rather than relying on theoretical vulnerabilities.

Another significant advantage is attacker distraction, as every minute malicious actors spend engaging with your honeypot represents time they’re not spending on your actual production systems. This creates an effective security diversion that consumes attacker resources. From a research perspective, the data collected contributes to the broader understanding of evolving SSH attack methods, potentially benefiting the entire security community.

Perhaps most importantly for busy system administrators, honeypots drastically reduce false positives in security monitoring. Unlike production server logs which contain a mix of legitimate and potentially malicious activities, honeypot interactions represent clear attack attempts with virtually no false positives. For Linux administrators concerned about server security, honeypots provide a crystal-clear window into the specific threats actively targeting their environment.

Setting Up a Basic SSH Honeypot

Let’s explore how to set up a simple SSH honeypot using Cowrie, one of the most popular and well-maintained honeypot frameworks. This setup process is designed to be accessible even for Linux administrators who may not have extensive security experience.

Prerequisites

First, we need to install the necessary dependencies for Cowrie. Run the following commands to update your system and install the required packages:

# Update your system
sudo apt update && sudo apt upgrade -y

# Install dependencies
sudo apt install git python3-virtualenv libssl-dev libffi-dev build-essential libpython3-dev python3-minimal authbind python3-pip -y

This command updates your package repositories and installs essential development libraries, Python tools, and networking utilities that Cowrie requires to function properly. The libssl-dev and libffi-dev packages provide cryptographic libraries needed for secure communications, while authbind allows non-root users to bind to privileged ports.

Installation Steps

  1. Create a dedicated user for running the honeypot. This is a security best practice that isolates the honeypot process from other system functions:
sudo adduser --disabled-password cowrie
sudo su - cowrie

The first command creates a new user named “cowrie” with no password login capabilities, while the second command switches to this user account for the subsequent steps.

  1. Clone the Cowrie repository and set up the Python virtual environment:
git clone https://github.com/cowrie/cowrie.git
cd cowrie
python3 -m virtualenv cowrie-env
source cowrie-env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

These commands download the Cowrie source code from GitHub, create an isolated Python environment for its dependencies, activate that environment, and install all required Python packages. Using a virtual environment prevents conflicts with system-wide Python packages and enhances security by isolating the honeypot’s dependencies.

  1. Configure Cowrie by creating a customized configuration file:
# Create configuration file from the example
cp etc/cowrie.cfg.dist etc/cowrie.cfg

This command creates your working configuration file by copying the distributed example. The configuration file controls all aspects of the honeypot’s behavior.

  1. Edit the configuration file to customize your honeypot:
# Use your favorite text editor
nano etc/cowrie.cfg

Key settings you should consider modifying include:

  • hostname: The hostname that will be presented to attackers (should match your organization’s naming conventions)
  • listen_endpoints: The IP and port where the honeypot will listen (default is port 2222)
  • ssh_version: The SSH version string to present (match this to your production servers for realism)
  1. Start the honeypot with a simple command:
bin/cowrie start

This command launches the Cowrie honeypot using the configuration you’ve specified. You can verify it’s running correctly by checking var/log/cowrie/cowrie.log for startup messages.

Redirecting Port 22 Traffic

For your honeypot to capture real attack attempts, you’ll want to redirect traffic from the standard SSH port (22) to your honeypot. This requires using iptables to create a port forwarding rule:

# Assuming your production SSH runs on port 2222 and honeypot on 2223
sudo iptables -t nat -A PREROUTING -p tcp --dport 22 -j REDIRECT --to-port 2223

This command uses the nat table in iptables to redirect incoming TCP connections on port 22 to your honeypot listening on port 2223. The PREROUTING chain ensures this happens before the traffic reaches the regular routing decisions.

Important security note: Always ensure your real SSH service is properly secured and running on a different port before implementing this redirection. Otherwise, you risk redirecting legitimate administrative traffic to your honeypot, potentially locking yourself out of your system.

Analyzing Honeypot Data

The real value of SSH honeypots lies in the data they collect. Cowrie stores detailed logs of all interactions with attackers in the var/log/cowrie directory.

Analyzing Honeypot Data with SSHwatch

The real value of SSH honeypots lies in the data they collect and how effectively you can analyze this intelligence. SSHwatch transforms raw honeypot logs into actionable security insights through its comprehensive monitoring and analytics capabilities.

When you connect your Cowrie honeypot to the SSHwatch platform, the detailed logs stored in the var/log/cowrie directory become part of your broader security monitoring ecosystem. SSHwatch’s analysis engine processes these logs to identify patterns, detect attack campaigns, and generate alerts based on specific threat indicators.

SSHwatch provides specialized dashboards for honeypot data analysis that visualize attack sources, attempted credentials, and post-compromise behaviors. These visualizations make it easy to spot trends that might not be apparent in raw log files. For example, you can quickly identify geographic regions with heightened attack activity or spot new credential combinations being tested by attackers.

One of SSHwatch’s most powerful features is its ability to create custom alert rules specifically for honeypot activity. Since honeypots have no legitimate users, any authentication attempt represents suspicious activity. You can configure alerts to notify your team whenever specific patterns emerge:

  • Authentication attempts using credentials seen in recent breaches
  • Login attempts from new geographic regions
  • Commands attempting to download malware
  • Connections from IP addresses associated with known threat actors

These alerts can be sent through multiple channels including email, Slack, or webhook integrations with your existing security tools. When an alert triggers, SSHwatch provides all contextual information needed for investigation, including the attacker’s IP address, attempted credentials, and any commands executed during the session.

For organizations seeking even deeper insights, SSHwatch’s correlation engine can automatically analyze relationships between attacks on your honeypots and activity targeting your production infrastructure. This correlation helps identify sophisticated campaigns that might be probing different parts of your network simultaneously or using information gathered from one system to target another.

Understanding Attack Patterns

After running your honeypot for even a short period, clear patterns begin to emerge from the collected data. You’ll observe credential stuffing attacks where automated systems attempt access using databases of common username/password combinations. These often reveal which default credentials are most frequently targeted in your environment. Similarly, dictionary attacks show systematic attempts with username lists and password dictionaries, often revealing which service accounts (like postgres, mysql, and admin) attackers believe might exist on your systems.

Post-compromise activities become particularly revealing, as commands executed after successful logins show attackers’ true intentions. This might include reconnaissance commands, privilege escalation attempts, or configuration changes to establish persistence. Malware download attempts expose the URLs and repositories used to deliver malicious payloads, giving you concrete indicators of compromise to watch for in your production environment. Finally, lateral movement techniques demonstrate how attackers attempt to pivot to other systems once they’ve established a foothold, revealing their methodology for network exploration and privilege escalation.

Advanced SSH Honeypot Strategies

Once you’re comfortable with basic honeypot operations, consider these advanced strategies:

High-Interaction Honeypots

While Cowrie simulates an SSH server, high-interaction honeypots use actual operating systems in isolated environments. Tools like HonSSH proxy connections to real systems while recording all activity.

Honeypot Networks

Deploy multiple honeypots with varying security levels to observe how attackers move between systems after initial compromise. Tools like T-Pot combine multiple honeypot technologies into a comprehensive platform.

Integration with Security Tools

Maximize the value of your honeypot by integrating with your existing security infrastructure:

# Example of sending honeypot data to Elasticsearch
cat >> etc/cowrie.cfg << EOF

enabled = true host = your-elasticsearch-host port = 9200 index = cowrie EOF

Common SSH Attack Patterns Revealed by Honeypots

Our analysis of extensive honeypot data has revealed several prevalent attack patterns that every Linux administrator should understand. Default credential attacks remain surprisingly effective for attackers despite their simplicity. Attackers frequently target systems with predictable combinations such as root/root, admin/admin, ubuntu/ubuntu, and pi/raspberry. These simple attempts still yield results because many devices ship with default credentials that administrators neglect to change, particularly on secondary systems or temporary deployments that later become permanent.

Geographic attack sources provide another interesting insight from honeypot data. SSH brute force attacks often originate from predictable sources that honeypots help identify. Significant attack traffic comes from commercial data centers and cloud providers, where attackers rent inexpensive virtual machines to launch their campaigns. Known VPN exit nodes frequently appear in attack logs, as these provide anonymity for attackers. Perhaps most notably, certain countries with limited cybercrime enforcement consistently appear as origination points, suggesting these regions serve as safe havens for attack infrastructure.

Post-compromise behavior reveals attackers’ true objectives once they gain access. After successful compromise, attackers typically begin with system reconnaissance using commands like uname -a, who, w, and cat /etc/passwd to understand the environment they’ve penetrated. This is followed by privilege escalation attempts targeting known vulnerabilities or misconfigurations. Attackers then typically configure persistence mechanisms to ensure they maintain access even if the initial compromise is discovered. In recent years, cryptocurrency miner deployment has become increasingly common, as attackers monetize compromised systems by stealing computational resources. Finally, lateral movement attempts reveal how attackers try to expand their foothold to other systems in the network.

Automated attack tools leave distinctive fingerprints that honeypots readily expose. Most SSH attacks are automated using tools like Hydra, Medusa, and various custom Python scripts. Each tool has characteristic timing patterns, preferred credential lists, and retry behaviors that become apparent in honeypot logs. These distinctive signatures can be used to create targeted defenses that recognize and block specific attack tools before they can successfully compromise your systems.

Integrating Honeypots with SSHwatch

A honeypot becomes significantly more valuable when integrated with a comprehensive SSH monitoring solution like SSHwatch. While standalone honeypots collect valuable data, SSHwatch transforms this raw intelligence into actionable security measures through its real-time monitoring and alerting capabilities.

By connecting your SSH honeypot to SSHwatch, you can create customized alerts that notify your security team the moment suspicious authentication attempts occur on your honeypot server. Since honeypots have no legitimate users, any authentication attempt represents potentially malicious activity worth investigating. SSHwatch allows you to establish alert thresholds, determining exactly when and how you receive notifications based on the specific threat patterns relevant to your organization.

The SSHwatch dashboard provides a centralized view of all honeypot activity alongside your production SSH traffic, creating a comprehensive picture of your SSH security landscape. This unified approach allows security teams to quickly identify patterns that might indicate a coordinated attack against multiple systems. The platform’s analytical capabilities can automatically correlate attack signatures across honeypots and production servers, revealing sophisticated attack campaigns that might otherwise go undetected.

Perhaps most valuable is SSHwatch’s ability to automatically generate and deploy blocklists based on honeypot intelligence. When attackers target your honeypot, their IP addresses and behavioral signatures can be automatically added to blocklists that protect your entire infrastructure. This automated response capability transforms passive honeypot intelligence into active defense mechanisms without requiring manual intervention from your security team.

Ethical and Legal Considerations

When deploying SSH honeypots, consider these important ethical and legal aspects:

  1. Privacy laws: Ensure compliance with local regulations regarding monitoring and data collection
  2. Entrapment concerns: Honeypots should be passive, never encouraging illegal activity
  3. Liability issues: Properly isolate honeypots to prevent them from being used to attack others
  4. Data handling: Treat collected data as sensitive and establish proper retention policies

SSH Honeypot Best Practices

To maximize the safety and effectiveness of your SSH honeypot deployment, several key practices should be implemented from the beginning. Network isolation stands as perhaps the most critical requirement, as honeypots should always be deployed in segregated network segments with carefully controlled access to other systems. This isolation prevents a compromised honeypot from becoming a stepping stone to attack your actual infrastructure. The network configuration should allow incoming connections while strictly limiting outbound traffic to prevent the honeypot from being used in attacks against third parties.

Regular monitoring forms the backbone of an effective honeypot strategy. Logs should be checked daily for new attack patterns and unusual activities, ideally with automated alerts for significant events. This consistent attention ensures you catch emerging threats while the intelligence is still actionable. Resource limitation serves as both a security measure and a practical consideration, as honeypots should have restricted CPU and bandwidth allocations to prevent abuse if compromised. These limitations prevent attackers from using your honeypot for resource-intensive activities like denial-of-service attacks or cryptocurrency mining.

Deception depth requires careful consideration, as you must balance realism against security. A honeypot that’s too obviously fake will be quickly identified by sophisticated attackers, while one that’s too realistic might create security risks. This balance differs for each organization based on their threat model and technical capabilities. Finally, data sharing represents an often-overlooked aspect of honeypot operations. Consider contributing anonymized data to community threat intelligence platforms, as this collaborative approach strengthens the entire security ecosystem while potentially providing access to broader intelligence feeds in return.

Conclusion: Transforming Intelligence into Protection

SSH honeypots represent a powerful addition to your cybersecurity arsenal, providing unique insights that traditional security measures cannot deliver. By implementing even a basic honeypot and connecting it to SSHwatch’s comprehensive monitoring platform, you gain a significant advantage in understanding and defending against the threats specifically targeting your environment.

The intelligence gathered from honeypots allows for more targeted defensive measures, focusing your security resources on actual threat patterns rather than theoretical vulnerabilities. For organizations of all sizes, this approach offers an efficient way to improve security with minimal investment, turning passive monitoring into active defense.

SSHwatch enhances the value of honeypot data through its automated analysis capabilities, customizable alerting, and integration with your broader security infrastructure. The platform’s ability to correlate activity across honeypots and production systems creates a unified security perspective that helps identify sophisticated attack campaigns before they succeed.

Start with a simple honeypot deployment connected to SSHwatch today, and you’ll gain immediate insights into the specific threats targeting your environment. As your comfort level increases, expand your honeypot strategy to create a comprehensive threat intelligence platform tailored to your organization’s unique security requirements.

Further Resources

Secure Your Infrastructure Today!

Sign up now to gain comprehensive insights into your SSH access logs. Start monitoring, alerting, and analyzing your entire infrastructure effortlessly.
Get started for free

Book a demo

Fill in the form below to book a demo without obligation.
Request a demo