• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 5 years ago
  • Updated 7 months ago

Reviews

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

Repository Details

A simple SSH tarpit inspired by endlessh

Cargo

tarssh

A simple SSH tarpit, similar to endlessh.

As per RFC 4253:

   The server MAY send other lines of data before sending the version
   string.  Each line SHOULD be terminated by a Carriage Return and Line
   Feed.  Such lines MUST NOT begin with "SSH-", and SHOULD be encoded
   in ISO-10646 UTF-8 [RFC3629] (language is not specified).  Clients
   MUST be able to process such lines.

In other words, you can fool SSH clients into waiting an extremely long time for a SSH handshake to even begin simply by waffling on endlessly. My high score is just over a fortnight.

The intent of this is to increase the cost of mass SSH scanning - even clients that immediately disconnect after the first response are delayed a little, and that's one less free connection for the next attack.

Usage

-% cargo install tarssh
-% tarssh --help
tarssh 0.7.0
A SSH tarpit server

USAGE:
    tarssh [FLAGS] [OPTIONS]

FLAGS:
        --disable-log-ident         Disable module name in logs (e.g. "tarssh")
        --disable-log-level         Disable log level in logs (e.g. "info")
        --disable-log-timestamps    Disable timestamps in logs
    -h, --help                      Prints help information
    -V, --version                   Prints version information
    -v, --verbose                   Verbose level (repeat for more verbosity)

OPTIONS:
        --chroot <chroot>              Chroot to this directory
    -d, --delay <delay>                Seconds between responses [default: 10]
    -g, --group <group>                Run as this group
    -l, --listen <listen>...           Listen address(es) to bind to [default: 0.0.0.0:2222]
    -c, --max-clients <max-clients>    Best-effort connection limit [default: 4096]
    -t, --timeout <timeout>            Socket write timeout [default: 30]
    -u, --user <user>                  Run as this user and their primary group

-% tarssh -v --disable-log-timestamps --disable-log-ident -l 0.0.0.0:2222 \[::]:2222
[INFO ] init, pid: 27344, version: 0.7.0
[INFO ] listen, addr: 0.0.0.0:2222
[INFO ] listen, addr: [::]:2222
[INFO ] privdrop, enabled: false
[INFO ] sandbox, enabled: true
[INFO ] start, servers: 2, max_clients: 4096, delay: 10s, timeout: 30s
[INFO ] connect, peer: 127.0.0.1:61986, clients: 1
[INFO ] connect, peer: 127.0.0.1:61988, clients: 2
load: 1.05  cmd: tarssh 27344 [kqread] 6.92r 0.00u 0.00s 0% 4512k
[INFO ] info, pid: 27344, signal: INFO, uptime: 6.92s, clients: 2, total: 2, bytes: 0
[INFO ] disconnect, peer: 127.0.0.1:61986, duration: 19.80s, bytes: 24, error: "Broken pipe (os error 32)", clients: 1
[INFO ] disconnect, peer: 127.0.0.1:61988, duration: 19.62s, bytes: 24, error: "Broken pipe (os error 32)", clients: 0
^C[INFO ] shutdown, pid: 27344, signal: INT, uptime: 25.39s, clients: 0, total: 2, bytes: 48

The info line is generated using a BSD SIGINFO signal - SIGHUP is also supported for Unix platforms lacking this.

More Repositories

1

Compactor

A user interface for Windows 10 filesystem compression
Rust
1,148
star
2

monotime

A sensible interface to monotonic time in Ruby
Ruby
156
star
3

cw

A Rust wc clone
Rust
101
star
4

rtss

Relative TimeStamps for Stuff
Rust
51
star
5

zfsnapr

Recursive ZFS snapshot mounter
Ruby
24
star
6

rust-linereader

A fast Rust line reader
Rust
23
star
7

borg-backup.sh

A simple shell script for driving BorgBackup
Shell
20
star
8

fast-memchr

A port of rust-memchr's fallback and SSE2 memchr() to C
C
19
star
9

faccess

Cross-platform file access checks in Rust
Rust
16
star
10

rust-proctitle

A safe cross-platform interface to setting process titles
Rust
16
star
11

checkrestart

sysutils/checkrestart: A FreeBSD tool to find stale processes that may need restarting after an upgrade
C
14
star
12

gcstool

A small tool for creating and searching Golomb Compressed Sets
Rust
13
star
13

rust-filesize

Physical disk use retrieval
Rust
12
star
14

pqsort

A generic partial quicksort macro for C99.
C++
12
star
15

run-one

A BSD-compatible reimplementation of Ubuntu's run-one
Shell
11
star
16

compresstimator

Simple and fast compressibility tester
Rust
10
star
17

mkjail

Create minimal jail environments on FreeBSD
Ruby
9
star
18

elite_shield_tester

A Rust port of Down To Earth Astronomy's Elite Dangerous shield tester
Rust
8
star
19

mkpass

Generates reasonably secure passwords
Rust
5
star
20

annoirc

A bot to annotate IRC with information about posted links
Rust
5
star
21

portacl-rc

A FreeBSD rc(8) script for mac_portacl(4)
Roff
4
star
22

pkg-cruft

Find cruft on pkgng systems like FreeBSD
Ruby
4
star
23

TerraIntrimmer

Trim the notification queue from Terra Invicta saves
Rust
3
star
24

fast-bytecount

A port of the Rust bytecount SSE2 and AVX2 algorithms to C
M4
3
star
25

ruby-reattempt

Yet another Ruby retry library.
Ruby
3
star
26

rust-bitrw

A Rust library for bit-level reading and writing
Rust
3
star
27

esc

Email Search Command, because Email Sucks Completely
Rust
3
star
28

blooming-rust

Disk-backed Bloom Filters for Rust
Rust
3
star
29

par_qsort

A quick and dirty parallel quicksort in Rust
Rust
2
star
30

simplepass

Simple Ruby and Rust password generation
Rust
2
star
31

tikibar

Prototypical Ruby progress bar library
Ruby
2
star
32

ruby-capsicum

A Ruby interface to Capsicum sandboxing
Ruby
2
star
33

blooming-ruby

Ruby BitArray and BloomFilter library
Ruby
1
star
34

quickhash

Multithreaded stream hashing
Rust
1
star
35

IMSErious

Execute commands in response to Dovecot's Internet Message Store Event notifications
Rust
1
star
36

ruby-filemon

A Ruby interface to FreeBSD's filemon(4) device
Ruby
1
star
37

numastat

FreeBSD NUMA domain memory monitor
Python
1
star
38

nfo.fcgi

Newzbin's ancient FastCGI NFO service
Ruby
1
star
39

123-spellcheck

An email spellchecker I made for a friend
Rust
1
star
40

unprivileged

Privilege dropping for Rust
Rust
1
star
41

precache

Read the contents of a directory tree and hope it has useful side-effects
Rust
1
star
42

ruby-gcs

A small Ruby library for creating and searching Golomb Compressed Sets
Ruby
1
star
43

swapflush

Flush swap devices on FreeBSD
C
1
star