MCPcopy Index your code
hub / github.com/TheKingOfDuck/geacon

github.com/TheKingOfDuck/geacon @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
89 symbols 167 edges 17 files 9 documented · 10% updated 5y ago★ 61
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Geacon

log

20210402:

  • 优化代码,统一配置至config.go

20210401:

  • 信任https,简单支持c2profile,添加异常容错处理,解决cmd小黑窗,支持CDN上线

use

macos

export GOOS="darwin" && export GOARCH="amd64" && rm -rf ./main &&go build -ldflags="-s -w" cmd/main.go &&./main

linux

export GOOS="linux" && export GOARCH="amd64" && rm -rf ./main &&go build -ldflags="-s -w" cmd/main.go &&./main

windows

WINDOWS环境需要去除/src/geacon/cmd/packet/commands.go中第13和64行的注释,否则执行命令会有小黑窗!!!

export GOOS="windows" && export GOARCH="amd64"&&go build -ldflags="-s -w -H windowsgui" cmd/main.go

Implement CobaltStrike's Beacon in Go


This project is only used for learning protocol analysis and reverse engineering. If someone's rights are violated, contact me to delete the project, and the last DO NOT USE IT ILLEGALLY

How to play

  1. Setup the teamserver and start a http lisenter, the teamserver will generate the file .cobaltstrike.beacon_keys.
  2. Compile beacontoo with Jetbrains Idea, use command java -jar BeaconTool.jar to convert java keystore to PEM format.
  3. Replace the RSA key pair in the file cmd/config/config.go (the RSA private key is not required, I wrote it in the code just for the record)
  4. Compile geacon for what platform you want to run, use command export GOOS="darwin" && export GOARCH="amd64" && go build cmd/main.go
  5. Having fun ! PR and issue is welcome ;)
  6. Geacon has just been tested on CobaltStrike 3.14 and only support default c2profile, so many hardcode in the project and I will not try to implement more C2profile support at this moment.
  7. Thanks for @xxxxxyyyy's PR, and now Geacon support CobaltStrike 4.x

Screenshot

Grab Geacon's command execution results in Linux login

Protocol analysis

To be continued, I will update as soon as I have time ...

Todo

~~1. Support CobaltStrike 4.0~~

  1. Fix the OS icon issue in session table

_DarkRay@RedCore

Extension points exported contracts — how you extend this code

Exception (Interface)
Exception exception type include err, panic info, and other...
cmd/exception/exception.go
Try (FuncType)
Try things try to do
cmd/exception/exception.go
Catch (FuncType)
Catch deal with exception
cmd/exception/exception.go

Core symbols most depended-on inside this repo

WriteInt
called by 4
cmd/packet/packet.go
ReadInt
called by 4
cmd/packet/packet.go
processErrorTest
called by 3
cmd/packet/commands.go
arrayToString
called by 2
cmd/sysinfo/sysinfo_linux.go
getUname
called by 2
cmd/sysinfo/sysinfo_linux.go
getOneIP
called by 2
cmd/packet/http.go
HttpGet
called by 2
cmd/packet/http.go
ReadObjectFromFile
called by 1
tools/BeaconTool/src/com/blackh4t/BeaconTool.java

Shape

Function 70
Method 10
Class 2
FuncType 2
Struct 2
TypeAlias 2
Interface 1

Languages

Go90%
Java10%

Modules by API surface

cmd/packet/packet.go12 symbols
cmd/sysinfo/sysinfo_windows.go10 symbols
cmd/sysinfo/sysinfo_linux.go9 symbols
cmd/packet/commands.go9 symbols
cmd/exception/exception.go8 symbols
cmd/sysinfo/sysinfo_darwin.go7 symbols
cmd/sysinfo/meta.go6 symbols
cmd/packet/http.go6 symbols
tools/BeaconTool/src/com/blackh4t/AsymmetricCrypto.java5 symbols
tools/BeaconTool/src/com/blackh4t/BeaconTool.java4 symbols
cmd/crypt/aes.go4 symbols
cmd/main.go3 symbols

For agents

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

⬇ download graph artifact

Ask about this repo answers extend the page