Skip to content
Race Condition framework
Python C Go CMake Shell
Branch: master
Clone or download
Latest commit f4724dd Aug 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bindings/python Added python binding #4 Aug 6, 2019
cmake/modules global refactoring Dec 10, 2018
lib Added macos build file Jul 18, 2019
racepwn global refactoring Dec 10, 2018
test_flask_server Added python binding #4 Aug 6, 2019
.editorconfig add .editorconfig Nov 20, 2018
.gitignore Added python binding #4 Aug 6, 2019
CMakeLists.txt Added python binding #4 Aug 6, 2019
LICENSE Initial commit Nov 20, 2018
README.md Merge pull request #7 from nexxai/patch-1 Jul 20, 2019
README_ru.md global refactoring Dec 10, 2018
build.sh global refactoring Dec 10, 2018
macos_build.sh Added macos build file Jul 18, 2019

README.md

RacePWN (Race Condition framework)

1. Description

RacePWN is a librace library and a racepwn utility that are designed to test a race condition attack through protocols that use a TCP connection.

1.1. librace

librace is a library written in the C programming language and designed to create and send multiple requests to a single host over the network. Library support two race types:

  1. Parallel - in this mode, a separate connection is created for each request. Requests are sent at the same time (using non-blocking socket write). Optionally, sending a request can be divided into 2 parts. The first is sending the main part of the request, the second is sending the last part of the request, after some time. The delay time as well as the size of the last part can be set.

  2. Pipeline - in this mode, requests are glued together into one large request, which is sent through one connection.

1.2. racepwn

racepwn - a utility written in golang that implements the librace interface by setting parameters through a config written in json.

Configuration file example

[
    {
        "race": {
            // Setting race parameters
            "type": "paralell", // race mode
            "delay_time_usec": 10000, // time delay between two request parts
            "last_chunk_size": 10 // last request chunck size
        },
        "raw": {
            "host": "tcp://localhost:8080", // hostname and port
            "ssl": false, // use ssl flag
            "race_param": [
                {
                    // race data parameters
                    "data": "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n", // response body
                    "count": 100 // packets count
                }
            ]
        }
    }
]

Two modes of operation are supported. Run as a console utility as well as a web service.

console util:

In this mode of operation, a configuration file is fed to the application input. The application makes requests to the server.

racepwn < config.json

web service:

In this mode, the utility starts working as a web service. To work, you need to make a POST requeston the path /race with the contents of the configuration file. The hostname and port must be specified using the -hostname flag.

racepwn -host "localhost:8080"

2. Installing

2.1. Dependences

  • clang or gcc
  • golang
  • libevent (libevent-dev)
  • openssl
  • cmake

2.2. Build

To start the build process, run ./build.sh.

Warning : the build was tested only for linux.

2.3. Build for MacOS

  1. Install dependencies
brew install go openssl libevent cmake gcc
  1. Export LIBRARY_PATH
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
  1. Build
./macos_build.sh

3. HOWTO

  • HTTP2 support.
  • HTTP response parsing.
  • Bindings for Python.
You can’t perform that action at this time.