finshir


You are seeing a high-performant, coroutines-driven, and fully customisable implementation of [Low & Slow](https://www.cloudflare.com/learning/ddos/ddos-low-and-slow-attack/) load generator designed for real-world pentesting. You can easily torify/proxify it using various platform-dependent utilities.

Pulse · Stargazers · Releases · Contributing


Table of contents


Demonstration


Advantages


Disadvantages


Installation

Building from crates.io

bash $ cargo install finshir

Building from sources

bash $ git clone https://github.com/Gymmasssorla/finshir.git $ cd finshir $ cargo build --release

Pre-compiled binaries

The easiest way to run Finshir on your system is to download the pre-compiled binaries from the existing releases, which doesn't require any external software (unlike the two previous approaches).

Use native CPU features

If you care about performance, please consider using the RUSTFLAGS="-C target_cpu=native" environmental variable which tells the compiler to use accelerated instructions which are specific to your CPU.


Usage

Flags

Name | Explanation -----|------------ -h, --help | Prints help information --use-tls | Use a TLS connection instead of the ordinary TCP protocol. It might be used to test HTTPS-based services. -V, --version | Prints version information

Options

Name | Value | Default | Explanation -----|-------|---------|------------ --connect-periodicity | Time span | 7secs | This option will be applied if a socket connection error occurs (the next connection will be performed after this periodicity) --connect-timeout | Time span | 10secs | Try connect a socket within a specified timeout. If a timeout is reached and a socket wasn't connected, the program will retry the operation later --connections | Positive integer | 1000 | A number of connections the program will handle simultaneously. This option also equals to a number of coroutines --date-time-format | String | %X | A format for displaying local date and time in log messages. Type man strftime to see the format specification --failed-count | Positive integer | 5 | A number of failed data transmissions used to reconnect a socket to a remote web server --ip-ttl | Unsigned integer | None | Specifies the IP_TTL value for all future sockets. Usually this value equals a number of routers that a packet can go through --json-report | Filename | None | A file to which a JSON report (also called a "total summary") will be generated before exiting -f, --portions-file | Filename | None | A file which consists of a custom JSON array of data portions, specified as strings. When a coroutine finished sending all portions, it reconnects its socket and starts sending them again. -r, --receiver | Socket address | None | A receiver of generator traffic, specified as an IP address (or a domain name) and a port number, separated by a colon -d, --test-duration | Time span | 64years 64hours 64secs | A whole test duration, after which all spawned coroutines will stop their work --text-report | Filename | None | A file to which the program will generate a human-readable report (also called a "total summary") before exiting -v, --verbosity | From 0 to 5 | 3 | Enable one of the possible verbosity levels. The zero level doesn't print anything, and the last level prints everything. Note that specifying the 4 and 5 verbosity levels might decrease performance, do it only for debugging. -w, --wait | Time span | 5secs | A waiting time span before test execution used to prevent a launch of an erroneous (unwanted) test --write-periodicity | Time span | 30secs | A time interval between writing data portions. This option can be used to modify test intensity --write-timeout | Time span | 10secs | If a timeout is reached and a data portion wasn't sent, the program will retry the operation later --xml-report | Filename | None | A file to which an XML report (also called a "total summary") will be generated before exiting


Overview

Minimal command

The following command spawns 1000 coroutines, each trying to establish a new TCP connection. When connections are established, it sends empty spaces every 30 seconds, thereby order a server to wait as long as it can:

```bash

Specify one of the Google's IP addresses as a target web server

$ finshir --receiver=google.com:80 ```

Test intensity

Low & Slow techniques assume to be VERY SLOW, which means that you typically send a couple of bytes every N seconds. For instance, Finshir uses the 30 seconds interval by default, but it's modifiable as well:

```bash

Test the Google's server sending data portions every one minute

$ finshir --receiver=google.com:80 --write-periodicity=1min ```

Connections count

The default number of parallel connections is 1000. However, you can modify this limit using the --connections option, but be sure that you system is able to handle such amount of file descriptors:

```bash

Modify the default limit of file descriptors to 17015

$ sudo ulimit -n 17015

Test the target server using 17000 parallel TCP connections

$ finshir --receiver=google.com:80 --connections=17000 ```

Custom data portions

By default, Finshir generates 100 empty spaces as data portions to send. You can override this behaviour by specifying your custom messages as a file, consisting of a single JSON array. This example is focused on Google:

```bash

Send partial HTTP headers to Google using --portions-file

$ finshir --receiver=google.com:80 --portions-file=files/google.json ```

Logging options

Consider specifying a custom verbosity level from 0 to 5 (inclusively), which is done by the --verbosity option. There is also the --date-time-format option which tells Finshir to use your custom date-time format.

```bash

Use a custom date-time format and the last verbosity level

$ finshir --receiver=google.com:80 --date-time-format="%F" --verbosity=5 ```

TLS support

Most of web servers today use the HTTPS protocol instead of HTTP, which is based on TLS. Since v0.2.0, Finshir has functionality to connect through TLS using the --use-tls flag.

```bash

Connect to the Google's server through TLS on 443 port (HTTPS)

$ finshir --receiver=google.com:443 --use-tls ```

Generate a report

Report is a set of statistics variables like a total number of connections established, a total number of failed transmissions and so on. There is three options for this: --xml-report, --json-report, and --text-report:

```bash

Test the Google's server and generate a JSON report at the end

$ finshir --receiver=google.com:80 --json-report=report.json ```

What means "at the end"? Well, Finshir will generate a report for you either if allotted time expires or if you cancel the process by Ctrl-C. You can look at the report examples in the files/reports folder:

(files/reports/report.json) json { "connections": { "failed": "0", "successful": "683", "total": "683" }, "time": { "test-duration": "9s 897ms 561us 209ns", "test-start": "Mon, 27 May 2019 10:20:27 -0000" }, "total-bytes-sent": "683", "total-errors": "0", "transmissions": { "failed": "0", "successful": "683", "total": "683" } }

(files/reports/report.xml) xml <?xml version="1.0" encoding="UTF-8"?> <finshir-report> <total-bytes-sent>1534</total-bytes-sent> <total-errors>0</total-errors> <time> <test-start>Mon, 27 May 2019 10:18:57 -0000</test-start> <test-duration>38s 807ms 453us 842ns</test-duration> </time> <connections> <successful>1000</successful> <failed>0</failed> <total>1000</total> </connections> <transmissions> <successful>1534</successful> <failed>0</failed> <total>1534</total> </transmissions> </finshir-report>

(files/reports/report.txt) ``` ****** FINSHIR REPORT ****** Total bytes sent: 2000 Total errors: 0

Test start: Mon, 27 May 2019 10:21:02 -0000 Test duration: 56s 29ms 777us 950ns

Successful connections: 1000 Failed connections: 0 Total connections: 1000

Successful transmissions: 2000 Failed transmissions: 0 Total transmissions: 2000


```

If none of the options above has been specified, Finshir prints a report right to your terminal. That is, you can just run a test, cancel it later, and see the results which you can easily save. Perfect!


Contributing

You are always welcome for any contribution to this project! But before you start, you should read the appropriate document to know about the preferred development process and the basic communication rules.


Legal disclaimer

Finshir was developed as a means of testing stress resistance of web servers, and not for hacking, that is, the author of the project IS NOT RESPONSIBLE for any damage caused by your use of his program.


Project references


Contacts

Temirkhan Myrzamadi <gymmasssorla@gmail.com> (the author)