Rapid7

module

update-motd.d Persistence

Disclosed
Jan 1, 1999
Created
Sep 13, 2025

Description

This module will add a script in /etc/update-motd.d/ in order to persist a payload.
The payload will be executed with root privileges everytime a user logs in.
Root privileges are likely required to write to /etc/update-motd.d/.
Verified on Ubuntu 22.04

Author

Julien Voisin

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/motd
msf exploit(motd) > show targets
...targets...
msf exploit(motd) > set TARGET < target-id >
msf exploit(motd) > show options
...show and set options...
msf exploit(motd) > 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.