wraith

[WIP] A free and open-source, modular Remote Administration Tool (RAT) / Payload Dropper written in Go(lang) with a flexible command and control (C2) system.

View on GitHub

Wraith Architecture (WIP)

This document outlines how Wraith works in theory, how it communicates with C2, as well as how the codebase is structured.

Index

Overview

Wraith is designed with flexibility, resilience and versatility in mind. This means that it should never need manual updating (that is, updating via original infection vectors) once deployed and should be able to deal with C2 outages, or the server being taken down altogether. Furthermore, Wraith is also designed to be modular, to allow for effortless expansion of its functionality, without familiarity with the entire codebase.

Wraith accomodates these requirements by utilising a unique architecture. The core component, libwraith, is tiny and lacks external dependencies, platform-specific code or cgo. It is designed to work as a library, meaning that it can be included in legitimate Go codebases with a minimal footprint, to provide a backdoor.

This architecture also allows for all basic and advanced functionality to be implemented as modules. Those can be included or excluded individually depending on requirements for each individual build. Wraith therefore adapts to be as covert or a feature-complete as desired.

As the C2 protocol is implemented as a plugin, it can be effortlessly switched out, or multiple protocols can work alongside each other for maximum resilience. In practice, this means that command and control can take place over any protocol, including DNS which is extremely difficult to block.

Features

Protocol

Wraith is not tied to a specific protocol as this is dependent on modules. Wraith’s communication works as follows:

Overall, the Wraith protocol is governed by the modules which are in use and entirely flexible. Modules even have the flexibility to bypass the comms manager altogether and make their own communication routes, though this is generally discouraged.

All that said, the default comms manager implemented as part of stdmod uses an encrypted JWT-based protocol providing flexibility and decentralisation. Using this comms manager ensures that control of Wraith isn’t dependent on access to one location (domain or IP address) but rather a signing key which is impossible to block, ban or report.

Codebase Layout

Due to the Wraith’s modular architecture, the codebase is split into 2 main parts:

In terms of the directory structure, that looks as follows: