Lucene search
K

Discover External IP via Ifconfig.me

🗓️ 06 Mar 2013 22:36:01Reported by RageLtMan <rageltman@sempervictus>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 21 Views

Discover External IP via Ifconfig.me. This module checks for the public source IP address by querying ifconfig.me, and can optionally add the found IP to the database

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

class MetasploitModule < Msf::Auxiliary

  # Exploit mixins should be called first
  include Msf::Exploit::Remote::HttpClient
  include Msf::Auxiliary::Report

  def initialize
    super(
      'Name'        	=> 'Discover External IP via Ifconfig.me',
      'Description'	=> %q{
        This module checks for the public source IP address of the current
        route to the RHOST by querying the public web application at ifconfig.me.
        It should be noted this module will register activity on ifconfig.me,
        which is not affiliated with Metasploit.
      },
      'Author'        => ['RageLtMan <rageltman[at]sempervictus>'],
      'License'	=> MSF_LICENSE,
      'References'	=>
        [
          [ 'URL', 'http://ifconfig.me/ip' ],
        ],
      'DefaultOptions' => { 'VHOST' => 'ifconfig.me' }
    )

    register_options(
      [
        Opt::RHOST('ifconfig.me'),
        OptBool.new('REPORT_HOST', [false, 'Add the found IP to the database', false])
      ])
end

  def run
    connect
    res = send_request_cgi({'uri' => '/ip', 'method' => 'GET' })

    if res.nil?
      print_error("Connection timed out")
      return
    end

    our_addr = res.body.strip
    if Rex::Socket.is_ipv4?(our_addr) or Rex::Socket.is_ipv6?(our_addr)
      print_good("Source ip to #{rhost} is #{our_addr}")
      report_host(our_addr) if datastore['REPORT_HOST']
    end
  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

11 Jan 2021 14:59Current
0.4Low risk
Vulners AI Score0.4
21