Module: Msf::Exploit::CmdStagerEcho

Includes:
CmdStager
Defined in:
lib/msf/core/exploit/cmdstager_echo.rb

Overview

Allows for staging cmd to arbitrary payloads through the CmdStagerEcho.

This stager uses the echo's ā€œ-eā€ flag, that enable interpretation of backslash escapes, to drop an ELF with the payload embedded to disk. The ā€œ-eā€ flag is usually available on linux environments. This stager has been found useful on restricted linux based embedded devices, and should work on either:

  • Systems with busy box's echo binary somewhere in $PATH.

  • Systems with bash/zsh whose echo builtin supports -en flags.

  • Systems with GNU coreutils echo which supports -en flags.

Instance Method Summary collapse

Methods included from CmdStager

#execute_cmdstager, #execute_cmdstager_begin, #execute_cmdstager_end, #generate_cmdstager, #initialize, #progress

Methods included from EXE

#generate_payload_dll, #generate_payload_exe, #generate_payload_exe_service, #generate_payload_msi, #get_custom_exe, #get_eicar_exe, #initialize

Instance Method Details

#create_stager(exe) ⇒ Rex::Exploitation::CmdStagerEcho

Initializes a CmdStagerEcho instance for the supplied payload


29
30
31
# File 'lib/msf/core/exploit/cmdstager_echo.rb', line 29

def create_stager(exe)
  Rex::Exploitation::CmdStagerEcho.new(exe)
end