Apply Egypt's cleanup

Remove revision, raise the exception itself, remove scanner mixin,
datastore['RHOST'] unstead of RHOSTS, and useles agent var removed.
bug/bundler_fix
RageLtMan 2013-03-07 18:34:12 -05:00
parent dfe3a4f394
commit 25f3f935c4
1 changed files with 4 additions and 9 deletions

View File

@ -14,12 +14,10 @@ class Metasploit3 < Msf::Auxiliary
# Exploit mixins should be called first
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner
def initialize
super(
'Name' => 'External IP',
'Version' => '$Revision: $',
'Description' => 'This module checks for the public source IP address of the current route to the RHOST',
'Author' => ['RageLtMan'],
'License' => MSF_LICENSE,
@ -31,17 +29,14 @@ class Metasploit3 < Msf::Auxiliary
register_options(
[
OptEnum.new('RHOSTS', [true, 'The ifconfig.me server to use','49.212.202.172',['49.212.202.172','133.242.129.236']]),
OptEnum.new('RHOST', [true, 'The ifconfig.me server to use','49.212.202.172',['49.212.202.172','133.242.129.236']]),
OptString.new('VHOST', [true, "The VHOST to use", 'ifconfig.me' ]),
OptBool.new('REPORT_HOST', [false, 'Add the found IP to the database', false])
], self.class)
end
def run_host(ip)
def run
begin
agent = datastore['UserAgent']
connect
res = send_request_raw({'uri' => '/ip', 'method' => 'GET' })
our_addr = res.body.strip
@ -52,8 +47,8 @@ end
end
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Errno::ECONNABORTED, Errno::ECONNREFUSED, Errno::EHOSTUNREACH =>e
raise "#{e}"
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Errno::ECONNABORTED, Errno::ECONNREFUSED, Errno::EHOSTUNREACH => e
raise e
end
end