A truly Position Independent Code (PIC) NimPlant C2 beacon written in C, without reflective loading.
Built with ♥ by Tijme Gommers – Buy me a coffee via PayPal.
Abstract • Progress • Getting started • Issues & requests • License & copyright
A minimal Proof-of-Concept (PoC) NimPlant C2 beacon in plain C, designed to be truly Position Independent Code (PIC), without relying on reflective loader such as Donut and sRDI. By manually resolving imports, storing required data on the stack, and executing without fixed addresses, the beacon compiles directly to PIC. As advantage, the beacon is much smaller in size compared to using a NimPlant beacon with a reflective loader (30kb vs 800kb). It is built on Relocatable, a boilerplate to develop raw and truly Position Independent Code (PIC).
⚠️ This minimal Proof-of-Concept (PoC) was developed to showcase Kong Loader (to be released at BlackHat Asia on the 3rd of April 2025). It is a Minimum Viable Product (MVP) and is definitely not production and opsec safe. Memory is not being used safely either, possibly causing memory leaks and vulnerabilities in the code.⚠️
Clone this repository first. Install the dependencies, then review the code.
Dependencies
Modify the code
Adjust the implant settings in the __main
function from ./src/main.c
to your needs.
Compiling
make
Usage
Load ./dst/shellcode.bin
using your shellcode loader (technique) of choice. An example loader that you can use is Kong Loader, which will be released at BlackHat Asia on the 3rd of April 2025.
Another option is to convert it to a c-code array using xxd
.
xxd -i dst/shellcode.bin
This outputs about ~30kb of truly Position Independent Code (PIC) to be used in your own loader.
As stated, this is just a minimal Proof-of-Concept (PoC) showcasing a beacon in truly Position Independent Code (PIC). Not all functionalities and commands that you are used to in Nimplant beacons are available yet.
- [✅] Implant initialization functionality.
- [✅] Implant registration functionality.
- [✅] AES encryption of data passed via JSON.
- [✅] Retrieve metadata and send back to Nimplant server.
- [✅] Support implant command
cat
. - [✅] Support implant command
cd
. - [✅] Support implant command
cp
. - [✅] Support implant command
ls
. - [✅] TODO: Support implant command
mv
. - [✅] Support implant command
pwd
. - [✅] TODO: Support implant command
shell
. - [✅] Support implant command
whoami
. - [
⚠️ ] TODO: Support all implant configuration options. - [
⚠️ ] TODO: Support jitter if sleep is used. - [
⚠️ ] TODO: Support incremental delay if server not reachable. - [
⚠️ ] TODO: Basic opsec such as string obfuscation. - [
⚠️ ] TODO: Low coupling, high cohesion. - [
⚠️ ] TODO: Support implant commandcurl
. - [
⚠️ ] TODO: Support implant commanddownload
. - [
⚠️ ] TODO: Support implant commandenv
. - [
⚠️ ] TODO: Support implant commandexecute-assembly
. - [
⚠️ ] TODO: Support implant commandget-av
. - [
⚠️ ] TODO: Support implant commandget-domain
. - [
⚠️ ] TODO: Support implant commandget-local-admin
. - [
⚠️ ] TODO: Support implant commandinline-execute
. - [
⚠️ ] TODO: Support implant commandmkdir
. - [
⚠️ ] TODO: Support implant commandpowershell
. - [
⚠️ ] TODO: Support implant commandps
. - [
⚠️ ] TODO: Support implant commandreg
. - [
⚠️ ] TODO: Support implant commandrm
. - [
⚠️ ] TODO: Support implant commandrun
. - [
⚠️ ] TODO: Support implant commandscreenshot
. - [
⚠️ ] TODO: Support implant commandshinject
. - [
⚠️ ] TODO: Support implant commandsleep
. - [
⚠️ ] TODO: Support implant commandupload
. - [
⚠️ ] TODO: Support implant commandwget
.
Issues or new feature requests can be reported via the issue tracker. Please make sure your issue or feature has not yet been reported by anyone else before submitting a new one.
Copyright (c) 2025 Tijme Gommers. This project is released under the GNU General Public License, version 2.0. View LICENSE.md for the full license.