Catalog GTFOBins

GTFO · Tool

ldconfig

3 techniques LinuxGTFOBins GPL-3.0

library-load

Library LoadPrivilege Escalation Linux

This allows to override one or more shared libraries (e.g., `libpcap`) globally, then triggers the execution by running a program that uses it, e.g., `ping`. This is particularly useful if the target binary is SUID. Beware though that it is easy to end up with a broken target system. First identify the shared libraries used by the target program, for example: ``` $ ldd /bin/ping | grep libcap libcap.so.2 => /path/to/temp-dir/libcap.so.2 (0x00007f8417eef000) ``` Then create the shared library override, named `libcap.so.2`, and put in in `/path/to/temp-dir/`. The program might require some exported symbols from the library override, in that case make sure to add them (e.g., `void cap_get_flag() {}`).

echo /path/to/temp-dir/ >/path/to/temp-file
ldconfig -f /path/to/temp-file
ping
Context
sudo
Native
library-load
MITRE
T1574

library-load

Library LoadPrivilege Escalation Linux

This allows to override one or more shared libraries (e.g., `libpcap`) globally, then triggers the execution by running a program that uses it, e.g., `ping`. This is particularly useful if the target binary is SUID. Beware though that it is easy to end up with a broken target system. First identify the shared libraries used by the target program, for example: ``` $ ldd /bin/ping | grep libcap libcap.so.2 => /path/to/temp-dir/libcap.so.2 (0x00007f8417eef000) ``` Then create the shared library override, named `libcap.so.2`, and put in in `/path/to/temp-dir/`. The program might require some exported symbols from the library override, in that case make sure to add them (e.g., `void cap_get_flag() {}`).

echo /path/to/temp-dir/ >/path/to/temp-file
ldconfig -f /path/to/temp-file
ping
Context
suid
Native
library-load
MITRE
T1574

library-load

Library Load Linux

This allows to override one or more shared libraries (e.g., `libpcap`) globally, then triggers the execution by running a program that uses it, e.g., `ping`. This is particularly useful if the target binary is SUID. Beware though that it is easy to end up with a broken target system. First identify the shared libraries used by the target program, for example: ``` $ ldd /bin/ping | grep libcap libcap.so.2 => /path/to/temp-dir/libcap.so.2 (0x00007f8417eef000) ``` Then create the shared library override, named `libcap.so.2`, and put in in `/path/to/temp-dir/`. The program might require some exported symbols from the library override, in that case make sure to add them (e.g., `void cap_get_flag() {}`).

echo /path/to/temp-dir/ >/path/to/temp-file
ldconfig -f /path/to/temp-file
ping
Context
unprivileged
Native
library-load
MITRE
T1574