Path: blob/master/modules/payloads/singles/cmd/windows/generic.rb
19567 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = 878include Msf::Payload::Single9include Msf::Sessions::CommandShellOptions1011def initialize(info = {})12super(13merge_info(14info,15'Name' => 'Windows Command, Generic Command Execution',16'Description' => 'Executes the supplied command',17'Author' => 'juan vazquez',18'License' => MSF_LICENSE,19'Platform' => 'win',20'Arch' => ARCH_CMD,21'Handler' => Msf::Handler::None,22'Session' => Msf::Sessions::CommandShell,23'PayloadType' => 'cmd',24'RequiredCmd' => 'generic',25'Payload' => {26'Offsets' => {},27'Payload' => ''28}29)30)3132register_options(33[34OptString.new('CMD', [ true, 'The command string to execute' ]),35]36)37end3839#40# Constructs the payload41#42def generate(_opts = {})43return super + command_string44end4546#47# Returns the command string to use for execution48#49def command_string50return datastore['CMD'] || ''51end52end535455