A tiny C2 Framework
The goal of this C2 framework is to create an extremely small, fast framework. This is NOT intended to be extremely modular. The C2 server is entirely multiprocessed, allowing for fast, non-blocking communications between clients while taking advantage of multi-core CPUs. This framework is intended to fill a gap in the space, providing an in-between option between basic reverse-shells/proxies and modular, complex C2 frameworks. The server and clients are designed to be quickly and easily started.
The initial version of this framework is NOT designed to be secure. There is very basic AES-256 encryption for all packets with hardcoded keys and identifiers. The communications are not cryptographically secure against determined attackers, especially with access to the client executable.
There is currently no message authentication built in either, potentially allowing replay attacks or other data manipulations.
Edit the AES key in c2-lib/include/aes.h
to use a non-default key.
gcc
cmake
Run ./build.sh
.
Server executable is build/server/server
, linux client executable is build/linux-client/linux-client
Run cmake -S . -B build
to configure cmake.
Run cmake --build build
to build.
The server takes two options:
-s
or--server
: Specify the IP to run the server on. Default0.0.0.0
-p
or--port
: Specify the port to run the server on. Default8083
As of 8/10/2024, the client is designed to connect only to 127.0.0.1:1234
for testing.
After connecting, you can interact with clients through the server's CLI. Run help
to see commands.
- Convert TCP sockets into non-constant connection
- Keep state on the server, client only connects when it wants to send info
- This turns it into more of an actual C2 as opposed to a fancy reverse shell
- CLI
- Doesn't support arrows for selecting history
- System Command
- Things such as a bash reverse shell don't work. Invalid FD
- This is due to the fact that input redirection is a bash feature
- To suport this, the client needs to find the current installed shell and pass that in
- Ex:
bash -c '<command>'
- Things such as a bash reverse shell don't work. Invalid FD