Giter Site home page Giter Site logo

hartl3y94 / ssh-honeypot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from droberson/ssh-honeypot

0.0 0.0 0.0 57 KB

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

License: MIT License

Makefile 2.27% C 67.96% Shell 26.98% Dockerfile 2.80%

ssh-honeypot's Introduction

SSH Honeypot

This program listens for incoming ssh connections and logs the ip address, username, and password used. This was written to gather rudimentary intelligence on brute force attacks.

Quickstart

Linux

Make sure libssh and libjson-c are installed

$ apt install libssh-dev libjson-c-dev

OSX

NOTE: Haven't tested json logging on OSX

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.

Build and Run

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

Usage

$ bin/ssh-honeypot -h

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.

This was implemented to aggregate the data from several hosts into a centralized spot.

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

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>

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.

ssh-honeypot's People

Contributors

droberson avatar eengstrom avatar ibykow avatar link89 avatar santigz avatar sem-hub avatar xzero707 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.