Module: Msf::Payload::Windows::Exec
- Includes:
- Cmd::Options, Single, Msf::Payload::Windows
- Defined in:
- lib/msf/core/payload/windows/exec.rb
Overview
Common command execution implementation for Windows.
Instance Method Summary collapse
- #cmd_required? ⇒ Boolean
-
#command_string ⇒ Object
Returns the command string to use for execution.
- #generate(_opts = {}) ⇒ Object
Methods included from Single
Methods included from Msf::Payload::Windows
#apply_prepends, exit_types, #handle_intermediate_stage, #include_send_uuid, #initialize, #replace_var
Methods included from PrependMigrate
#apply_prepend_migrate, #initialize, #prepend_migrate, #prepend_migrate?, #prepend_migrate_64
Instance Method Details
#cmd_required? ⇒ Boolean
17 18 19 |
# File 'lib/msf/core/payload/windows/exec.rb', line 17 def cmd_required? true end |
#command_string ⇒ Object
Returns the command string to use for execution.
30 31 32 33 34 35 36 37 38 |
# File 'lib/msf/core/payload/windows/exec.rb', line 30 def command_string cmd = datastore['CMD'].to_s if cmd.empty? && cmd_required? fail_with(Msf::Module::Failure::BadConfig, 'CMD must not be empty') end cmd end |
#generate(_opts = {}) ⇒ Object
21 22 23 24 25 |
# File 'lib/msf/core/payload/windows/exec.rb', line 21 def generate(_opts = {}) raw = super raw = ''.dup if raw.nil? raw + command_string + "\x00" end |