- Go 100%
- Assembly <1%
README #
This project contains a polymorphic BOF-like execution engine via a custom bytecode and VM, a c2 server and agent with jobs.
Unlike traditional BOFs, which contain native COFF object code, .cadv modules contain portable bytecode interpreted by the custom VM.
General idea: after foothold, we assume that an agent of some form is able to receive arbitrary code over the wire. To obfuscate what we're doing, we're using a custom bytecode VM implementation (instead of embedding wasm or something) to execute code on the victim host. A c2 server is used to control jobs and agents.
This project is just an experiment to get up to speed on how it's done nowadays and understand the mechanisms better. Not really for production or real use at all. Use at your own risk.
LLMs #
I don't use LLMs to generate code execpt for tests. The code is handwritten.
Using #
Generate op codes:
go generate ./vm
Now you can either verify ASM code:
go run ./cmd/cli.go check asm-examples/hello-world.asm
Or go straight to compile + exec:
go run ./cmd/cli.go compile asm-examples/hello-world.asm out.cadv
go run ./cmd/cli.go exec out.cadv
-> 42
Development #
You need to generate opcodes.go with a random mapping of ops to byte codes in order to get compileable code:
go generate ./vm
go test ./...
Limitations #
As this is just a "learning how the big boys do it", there are a lot of limitations obviously. Namely any sophistication, a more permanent approach to op code sets (with every generate you lose the option to execute artifacts with a different op code). It's not reproducible yet.
In general there is no heavy emphasis on security. Don't just run stuff.