• Stars
    star
    513
  • Rank 86,178 (Top 2 %)
  • Language
    C
  • License
    MIT License
  • Created almost 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fake sshd that logs ip addresses, usernames, and passwords.

SSH Honeypot

This unfortunately named program listens for incoming ssh connections and logs the IP address, username, and password used by the client. This is a low-interaction honeypot that does not allow malware or attackers to login.

This was originally written to gather rudimentary intelligence on brute force attacks and not meant for production usage.

Nowadays, I mostly use this at attack/defend CTFs paired with sshunt: https://github.com/droberson/sshunt

I set up sshunt to forward tools such as Hydra, Metasploit, and Ncrack to ssh-honeypot and allow OpenSSH clients to connect to ssh normally.

Quickstart

Linux

Make sure headers/development packages are installed for:

  • libssh
  • openssl
  • libjson-c
  • libpcap
apt install libssh-dev libjson-c-dev libpcap-dev libssl-dev

Build and Run

make
ssh-keygen -t rsa -f ./ssh-honeypot.rsa
bin/ssh-honeypot -r ./ssh-honeypot.rsa

OSX (experimental/unsupported)

WARNING: I haven't tested JSON logging, HASSH, or anything really on OSX. MacOS is officially unsupported as I do not own any Macs to test this software with.

Make sure that xcode is up to date.

Install libssh and json-c

brew install libssh json-c

Specify MakefileOSX with make:

make -f MakefileOSX

Docker (experimental)

Please take a look at our Docker documentation.

HASSH

As of version 0.2.0, ssh-honeypot attempts to calculate the HASSH of the client software initiating sessions with ssh-honeypot. In short, you can tell if the client is using OpenSSH, PuTTY, SecureCRT, ...

For more information about HASSH, refer to these links:

Syslog facilities

As of version 0.0.5, this supports logging to syslog. This feature is toggled with the -s flag. It is up to you to configure your syslog facilities appropriately. This logs to LOG_AUTHPRIV which is typically /var/log/auth.log. You may want to modify this to use one of the LOG_LOCAL facilities if you are worried about password leakage.

Dropping Privileges

As of version 0.0.8, you can drop root privileges of this program after binding to a privileged port. You can now run this as nobody on port 22 for example instead of root, but have to initially start it as root:

sudo bin/ssh-honeypot -p 22 -u nobody

Beware that this chowns the logfile to the user specified as well.

Changing the Banner

ssh-honeypot allows you to change the server's banner to blend in with other hosts on your network or mimic a specific device.

List available banners

bin/ssh-honeypot -b

Set banner string

bin/ssh-honeypot -b "my banner string"

Set banner by index

bin/ssh-honeypot -i <banner index>

JSON Logging

The -j CLI flag specifies the path to log results in JSON format. This feature can make log analytics much easier because many languages have robust JSON support.

JSON logs can be sent to a remote host. The -J and -P CLI flags set the host and port to send logs in JSON to, respectively. At this time, logs are transmitted using UDP and not encrypted.

This feature can be useful when running multiple ssh-honeypot instances. Listeners can be created for Splunk and ElasticSearch to ingest these logs and make them searchable.

Systemd Integration

On Linux you can install ssh-honeypot as a Systemd service so that it automatically runs at system startup:

make install
systemctl enable --now ssh-honeypot

Before installing, check ssh-honeypot.service and modify it to run with the options you want.

More Repositories

1

rtfm

Cheat sheet and notes inspired by the book RTFM - Red Team Field Manual
164
star
2

ELFcrypt

Simple ELF crypter. Uses RC4 encryption.
C
67
star
3

icmp-backdoor

Backdoor that listens for specially crafted ICMP packets and spawns reverse shells.
C
58
star
4

ELFappend

PoC to append and extract data at the end of an ELF file
C
20
star
5

pastebin-scrape

Utilize Pastebin's scraping API to find interesting pastes.
Python
17
star
6

curl-portscan

Crappy shell script that port scans using curl
Shell
12
star
7

greylost

DNS logging, detection, ...
Python
11
star
8

break-web-scanners

Its like GORILLAS.BAS, just different. Creates a bunch of bogus files/directories to deceive web vulnerability scanners.
Shell
9
star
9

thefuzz

Various fuzzers written in Python. Currently has a TCP server for fuzzing client software, and a CLI fuzzer to use against programs ran from the command line.
Python
9
star
10

yararules

misc yara rules
YARA
8
star
11

sshunt

SSH proxy with HASSH firewalling capabilities
Python
8
star
12

gokiller

LKM to detect + kill golang bins
C
7
star
13

ELFparasite

Simple parasite for ELF binaries using the concatenation method.
C
6
star
14

SLAE

SecurityTube Linux Assembly Expert exercises
C
5
star
15

rdpy-rdpfingerprint

OS Fingerprinting based on RDP login screen.
Python
5
star
16

noawareness

no awareness, swift as gold
C
5
star
17

exec-logger

LD_PRELOAD library to log all execve() calls to syslog
C
5
star
18

harness

execute stuff in memory
C
5
star
19

syslog_spoof

Sends spoofed syslog packets using scapy
Python
4
star
20

sshady

SSH key monkeyshines.
Python
4
star
21

pycompiler

Compile .py files as ELF using Cython
Python
3
star
22

usb-watch

Use Python's pyudev to monitor for USB events. Sends SMS texts using Twilio if a USB device is added or removed from your machines.
Python
3
star
23

pinger

continuously ping hosts and make the data available via an HTTP API
Python
3
star
24

linux_amd64_static_tools

static linked bash, coreutils, and binutils for Linux/amd64
Perl
3
star
25

dotfiles

My dotfiles.
Shell
3
star
26

papa-shango

ptrace injection
C
2
star
27

crappy_identd

SUPER AWESOME IDENT SERVER. RFC1413
Python
1
star
28

rehash

rehash
Python
1
star
29

exec-guard

LD_PRELOAD library to only allow execve() calls to files in whitelisted directories.
C
1
star
30

pypacket

Parse packets
Python
1
star
31

syscallslol

Linux LKM that detects sys_call_table[] manipulation
C
1
star
32

asscan

masscan without the m
Python
1
star
33

udp-scan

Non-privileged UDP port scanner.
C
1
star
34

lilt

The littlest network watcher - libnids example
C
1
star
35

million_dollar_dream

EVERY MAN HAS A PRICE
Python
1
star
36

stroke

Updated "stroke" tool from Building Open Source Network Security Tools book by Mike Schiffman.
C
1
star
37

subrute

/bin/su brute forcer using pexpect.
Python
1
star
38

camnewtonsendzonedance

CAM table flooder
Python
1
star