Identifier / Programs / Linux and Unix
apt-get
Debian and Ubuntu package management utility. Search for packages using apt-cache. It is recommended to use apt when used interactively in Ubuntu versions 16.04 and later. tldr-pages
GTFOBins inherit, shell 3 Sigma rules name it 1 ATT&CK technique 3 documented commands
How apt-get is abused
inherit
changelog
Each abuse is GTFOBins's category and the options and words it uses; the full write-up is on GTFOBins's page for apt-get.
3 documented commands
shell with sudo, as SUID
For this to work the target package (i.e., sl) must not be already installed.
echo 'Dpkg::Pre-Invoke {"/bin/sh;false"}' >/path/to/temp-file
apt-get -y install -c /path/to/temp-file slIdentifyTrips no Sigma process-creation rule.
shell with sudo, as SUID
When the shell exits the update command is actually executed.
apt-get update -o APT::Update::Pre-Invoke::=/bin/shIdentifyTrips 1 Sigma rule: mediumShell Invocation via Apt - Linux by Nasreddine Bencherchali (Nextron Systems)
1 of the 3 commands the identifier reads trips a Sigma process-creation rule; 2 trip none. These commands are, with GTFOBins’ notes, from GTFOBins, at commit acd524623f9c of 2026-05-27, under the GPL-3.0, with no warranty. Changed: Markdown is shown formatted. The source is in lolbas-gtfobins-commands.json.gz, and the full entry is on GTFOBins’s page for apt-get. The identifier reads the line of each that runs apt-get.
What detects it
Everyday use
Update the list of available packages and versions (it's recommended to run this before other apt-get commands)
sudo apt-get updateIdentifyInstall a package, or update it to the latest available version
sudo apt-get install packageIdentifyRemove a package
sudo apt-get remove packageIdentifyTrips 1 Sigma rule: lowLinux Package Uninstall by Tuan Le (NCSGroup), Nasreddine Bencherchali (Nextron Systems)
Of the 3 examples the identifier reads, 1 matches GTFOBins abuse or trips a Sigma process-creation rule.