Aragonite
Aragonite is a form of calcium-carbonate (CaCO3) commonly found in the materials for shell formation. In that spirit, aragonite is a set of tools necessary that makes generating position-independent shellcode in rust easy to do.
Supported targets
- Windows, x64
- Linux, x64
Usage
- Currently, development is only supported on linux-x64 hosts with gnu-build chain (aka
x86_64-unknown-linux-gnu). Ensure you have the required tooling/environment to compile code for this target - Install the
cargo-aragonitebuild tool viacargo install cargo-aragonite. This is a thin-wrapper that sets up the correct environment, release profile, and build scripts to generate proper position-independent shellcode. - Annotate your main function with the
aragonite_mainattribute. This handles setting up the correct attributes for the linker script, and automatic clean exits if a target family is supplied. See theexamples/src/binfolder for examples. - Build your shellcode with the build tool:
cargo aragonite build. Any extra arguments are transparently passed to cargo. - The produced shellcode will be in
targets/x86_64-unknown-linux-gnu/aragonite/[binaryname]
Detailed Information
#[aragonite_main] attributes
family
Can be set to the following values:
| value | description |
|---|---|
win |
support for windows targets, performs automatic cleanup by calling the ExitProcess(0) function in kernel32.dll |
linux |
support for linux targets, performs automatic cleanup by calling the sys_exit(0) syscall for the target arch |
Example
arch
Can be set to the following values:
| value | description |
|---|---|
x64 |
support for x64 targets, used to select correct ABI based on family attribute |
Example
no_cleanup
This flag disables automatic cleanup code generation if a family is specified.
Example