Rapid7

module

APT Package Manager Persistence

Disclosed
Mar 9, 1999
Created
Sep 11, 2025

Description

This module will run a payload when the APT package manager is used.
This module creates a pre-invoke hook for APT in apt.conf.d. Write access
to the apt.conf.d directory is required, typically requiring root access.
The hook name is randomized if not specified.
Verified on Ubuntu 22.04

Author

Aaron Ringo

Platform

Linux,Unix

Architectures

cmd, x86, x64, armle, aarch64, ppc, mipsle, mipsbe

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':


msf > use exploit/linux/persistence/apt_package_manager
msf exploit(apt_package_manager) > show targets
...targets...
msf exploit(apt_package_manager) > set TARGET < target-id >
msf exploit(apt_package_manager) > show options
...show and set options...
msf exploit(apt_package_manager) > exploit

Title
Rapid7 Labs

2026 Global Threat Landscape Report

The predictive window has collapsed. Exploitation follows disclosure in days. See how attackers are accelerating and how to stay ahead.