MCPcopy Index your code
hub / github.com/averagesecurityguy/c2

github.com/averagesecurityguy/c2 @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
41 symbols 97 edges 15 files 33 documented · 80%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

C2

The C2 repository seeks to provide a practical implementation of the ideas contained in the Red Team Infrastructure Wike at https://github.com/bluscreenofjeff/Red-Team-Infrastructure-Wiki. In particular, this repository provides two Go packages one for beaconers and another for downloaders. In addition, the repository provides sample implants that use these beaconers and downloaders. Finally, the repository contains backend DNS and HTTP servers for C2 and configuration information for building front-end redirector servers.

Creating Implants

The implants folder has two implants that show how to use the beaconer and downloader packages. These implants can be used as a reference for building your own implants. The general idea is to select a beaconer and a downloader and wrap them in a loop with some type of timing mechanism to control how often the implant will beacon out.

Creating Beacons and Downloaders

To create new beaconers and downloaders you must build a struct that satisfies the appropriate interface. The beaconer and downloader directories contain both HTTP and DNS examples.

Backend Servers

The servers directory contains both a DNS server and an HTTP server that can be used as the backend server for the various beacons and downloaders. These servers were not designed with production use in mind but can be used in production if needed. In addition, the servers folder contains a payload file, which can be built using go build -o payload.bin payload.go. The servers expect to find a payload.bin file in the current directory, which will be served to the downloaders and executed on the client.

Frontend Servers

The docs folder contains configuration information needed to build frontend redirectors for the C2 system. The configuration allows C2 traffic to be redirected to the C2 server based on specific criteria and sends all other traffic to a benign server.

Contributions

I am not a C2 expert. I have been reading the Red Team Infrastructure Wiki and decided to build a practical implementation. With that said, I would love pull requests for new beaconers and downloaders. If you are not comfortable writing the code yourself, let me know what beacon or downloader techniques you would like implemented by submitting an issue.

Extension points exported contracts — how you extend this code

Beaconer (Interface)
Define the Beaconer interface that all beacons must implement. [3 implementers]
beaconer/beaconer.go
Downloader (Interface)
Define the Downloader interface. [2 implementers]
downloader/downloader.go

Core symbols most depended-on inside this repo

DownloadExec
called by 3
downloader/downloader.go
Beacon
called by 2
beaconer/http.go
Beacon
called by 2
beaconer/dns.go
save
called by 2
downloader/helper.go
run
called by 2
downloader/helper.go
NewHttpAuthBeacon
called by 1
beaconer/beaconer.go
NewDnsNsBeacon
called by 1
beaconer/beaconer.go
NewDnsMxBeacon
called by 1
beaconer/beaconer.go

Shape

Function 25
Method 8
Struct 6
Interface 2

Languages

Go100%

Modules by API surface

beaconer/beaconer.go5 symbols
servers/http.go4 symbols
servers/dns.go4 symbols
downloader/helper.go4 symbols
downloader/downloader.go4 symbols
beaconer/dns.go4 symbols
beaconer/beaconer_test.go3 symbols
implants/http.go2 symbols
implants/dns.go2 symbols
downloader/http.go2 symbols
downloader/dns.go2 symbols
beaconer/http.go2 symbols

For agents

$ claude mcp add c2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact