2019-02-03 04:38:59 +01:00
|
|
|
# Endlessh: an SSH tarpit
|
|
|
|
|
2019-02-03 14:26:42 +01:00
|
|
|
Endlessh is an SSH tarpit that *very* slowly sends an endless, random
|
|
|
|
SSH banner. It keeps SSH clients locked up for hours or even days at at
|
|
|
|
time. The purpose is to put your real SSH server on another port and
|
|
|
|
then let the script kiddies get themselves stuck in this tarpit instead
|
|
|
|
of bothering a real server.
|
2019-02-03 04:38:59 +01:00
|
|
|
|
2019-02-03 14:26:42 +01:00
|
|
|
Since the tarpit is the banner, before any cryptographic exchange
|
2019-02-03 04:38:59 +01:00
|
|
|
occurs, this program doesn't depend on any cryptographic libraries. It's
|
|
|
|
a simple, single-threaded, standalone C program. It uses `poll()` to
|
|
|
|
trap multiple clients at a time.
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
Usage information is printed with `-h`.
|
|
|
|
|
|
|
|
```
|
|
|
|
Usage: endlessh [-vh] [-d MSECS] [-m LIMIT] [-p PORT]
|
|
|
|
-d INT Message millisecond delay [10000]
|
|
|
|
-h Print this help message and exit
|
|
|
|
-m INT Maximum number of clients [4096]
|
|
|
|
-p INT Listening port [2222]
|
|
|
|
-v Print diagnostics to standard output (repeatable)
|
|
|
|
```
|
|
|
|
|
2019-02-03 14:09:21 +01:00
|
|
|
By default no log messages are produced. The first `-v` enables basic
|
|
|
|
logging and a second `-v` enables debug logging (noisy). All log
|
|
|
|
messages are sent to standard output.
|
|
|
|
|
|
|
|
endlessh -v >endlessh.log 2>endlessh.err
|
|
|
|
|
2019-02-03 04:38:59 +01:00
|
|
|
The purpose of limiting the number of clients (`-m`) is to avoid tying
|
|
|
|
up too many system resources with the tarpit. Clients beyond this limit
|
|
|
|
are left in the accept queue, not rejected instantly.
|
2019-02-03 15:18:28 +01:00
|
|
|
|
|
|
|
A SIGTERM signal will gracefully shut down the daemon, allowing it to
|
|
|
|
write a complete, consistent log.
|