Rapid7

module

OS Command Exec, Add user with useradd

Disclosed
N/A
Created
Jun 9, 2025

Description

Execute an OS command from PHP.

Creates a new user. By default the new user is set with sudo
but other options exist to make the new user automatically
root but this is not automatically set since the new user will
be treated as root (and login may be difficult). The new user
can also be set as just a standard user if desired.

Authors

Spencer McIntyre
Nick Cottrell Rad10Logic

Platform

PHP

Architectures

php

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 payload/php/unix/cmd/adduser
msf payload(adduser) > show actions
...actions...
msf payload(adduser) > set ACTION < action-name >
msf payload(adduser) > show options
...show and set options...
msf payload(adduser) > run

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.