HOMESCRIPTSPROJECTSREADINGCV
|
Please donate if you find SSH Canary (sshcanary) useful.BTC: 1GwYToq2AuUWUfJJ7NeCpksfjMth7bw7TuLTC: LKh99yzPeXZ7jQgvGgRhkTGReN4TRK4C6p SSH Canary (sshcanary) can be found on GitHub. You can clone the repository directly from github:
Or you can download the current distribution tarball: sshcanary v0.6 What is sshcanaryd?SSH Canary is a ver low interaction honeypot specifically designed to gather information about potential attackers that attemp to brute-force into a system using SSH.Why use it?If you are tired of the constant SSH brute-force noise from your IDS and installing fail2ban is just too simple for you, you can use SSH Canary to monitor attackers and better understand the attributes of their campaigns against your systems. It is also nice to know if their dictionaries include some of your passwords at the same time.Once you have some date, you can start looking into the patterns associated with the brute forcing tools and campaigns as shown in the next two heat maps distilling 12 months of log data from sshcanary. ImplimentationYou must first generate a server key for sshcanary to present when clients connect.
If you want to run sshcanary as a non-privileged user or in conjuntion with a real ssh server, you can use iptables to forward connections to sshcanary on an alternate port. The following forwards all inbound ssh connections destined for TCP/22 to TCP/2222.
When you start sshcanary, use -p 2222 or --port 2222 and all inbound ssh connections will be forwarded to your sshcanary. If you want to allow local connections to a real ssh server from your trusted network (e.g. 192.168.10.0/24) but all other ssh connections to be forwarded to your sshcanary, you can use iptables to forward connections if they don't originate on your trusted network.
A simple and dangerous way to run sshcanary is on the default ssh port as root.
A better way to run sshcanary is to set an effective UID/GID using the -u|--user and -g|--group options as shown below.
The installation includes an RC script for Linux that starts sshcanary in the above fashion but also enables random "traps" where sshcanary acts like the authentication was successful as seen below.
Logging is done in two places, system related events are logged to syslog and authentication events are logged to the specific log file as shown below. What sshcanary sends to syslog:
What sshcanary writes to the log:
To get a list of all the options, you can execute the command with the -h or --help switch.
Security ImplicationsAssume that there are errors in the source that would allow an attacker to gain unauthorized access to your computer. Don't trust this software and install and use it at your own risk.BugsI am not a programmer by any strech of the imagination. I have attempted to remove the obvious bugs and other programmer related errors but please keep in mind the first sentence. If you find an issue with code, please send me an e-mail with details and I will be happy to look into it. |