Skip to content

Commit 25f3f93

Browse files
author
RageLtMan
committed
Apply Egypt's cleanup
Remove revision, raise the exception itself, remove scanner mixin, datastore['RHOST'] unstead of RHOSTS, and useles agent var removed.
1 parent dfe3a4f commit 25f3f93

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

modules/auxiliary/gather/external_ip.rb

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ class Metasploit3 < Msf::Auxiliary
1414
# Exploit mixins should be called first
1515
include Msf::Exploit::Remote::HttpClient
1616
include Msf::Auxiliary::Report
17-
include Msf::Auxiliary::Scanner
1817

1918
def initialize
2019
super(
2120
'Name' => 'External IP',
22-
'Version' => '$Revision: $',
2321
'Description' => 'This module checks for the public source IP address of the current route to the RHOST',
2422
'Author' => ['RageLtMan'],
2523
'License' => MSF_LICENSE,
@@ -31,17 +29,14 @@ def initialize
3129

3230
register_options(
3331
[
34-
OptEnum.new('RHOSTS', [true, 'The ifconfig.me server to use','49.212.202.172',['49.212.202.172','133.242.129.236']]),
32+
OptEnum.new('RHOST', [true, 'The ifconfig.me server to use','49.212.202.172',['49.212.202.172','133.242.129.236']]),
3533
OptString.new('VHOST', [true, "The VHOST to use", 'ifconfig.me' ]),
3634
OptBool.new('REPORT_HOST', [false, 'Add the found IP to the database', false])
3735
], self.class)
3836
end
3937

40-
def run_host(ip)
41-
42-
38+
def run
4339
begin
44-
agent = datastore['UserAgent']
4540
connect
4641
res = send_request_raw({'uri' => '/ip', 'method' => 'GET' })
4742
our_addr = res.body.strip
@@ -52,8 +47,8 @@ def run_host(ip)
5247

5348
end
5449
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
55-
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Errno::ECONNABORTED, Errno::ECONNREFUSED, Errno::EHOSTUNREACH =>e
56-
raise "#{e}"
50+
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Errno::ECONNABORTED, Errno::ECONNREFUSED, Errno::EHOSTUNREACH => e
51+
raise e
5752
end
5853
end
5954

0 commit comments

Comments
 (0)