Lucene search
K

NAT-PMP External Address Scanner

🗓️ 24 Jan 2012 16:32:30Reported by Jon Hart <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 10 Views

scan NAT devices for their external address using NAT-PMP. Report NAT-PMP as being open

Code
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
  include Msf::Auxiliary::Report
  include Msf::Exploit::Remote::Udp
  include Msf::Auxiliary::UDPScanner
  include Msf::Auxiliary::NATPMP
  include Rex::Proto::NATPMP

  def initialize
    super(
      'Name'        => 'NAT-PMP External Address Scanner',
      'Description' => 'Scan NAT devices for their external address using NAT-PMP',
      'Author'      => 'Jon Hart <jhart[at]spoofed.org>',
      'License'     => MSF_LICENSE
    )

  end

  def scan_host(ip)
    scanner_send(@probe, ip, datastore['RPORT'])
  end

  def scanner_prescan(batch)
    @probe = external_address_request
  end

  def scanner_process(data, shost, sport)
    (ver, op, result, epoch, external_address) = parse_external_address_response(data)

    peer = "#{shost}:#{sport}"
    if (ver == 0 && op == 128 && result == 0)
      print_good("#{peer} -- external address #{external_address}")
      # report its external address as alive
      if inside_workspace_boundary?(external_address)
        report_host(
          :host   => external_address,
          :state => Msf::HostState::Alive
        )
      end
    else
      print_error("#{peer} -- unexpected version/opcode/result/address: #{ver}/#{op}/#{result}/#{external_address}")
    end

    # report the host we scanned as alive
    report_host(
      :host   => shost,
      :state => Msf::HostState::Alive
    )

    # report NAT-PMP as being open
    report_service(
      :host   => shost,
      :port   => sport,
      :proto  => 'udp',
      :name   => 'natpmp',
      :state  => Msf::ServiceState::Open
    )
  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

24 Jul 2017 13:26Current
0.1Low risk
Vulners AI Score0.1
10