@@ -14,12 +14,10 @@ class Metasploit3 < Msf::Auxiliary
14
14
# Exploit mixins should be called first
15
15
include Msf ::Exploit ::Remote ::HttpClient
16
16
include Msf ::Auxiliary ::Report
17
- include Msf ::Auxiliary ::Scanner
18
17
19
18
def initialize
20
19
super (
21
20
'Name' => 'External IP' ,
22
- 'Version' => '$Revision: $' ,
23
21
'Description' => 'This module checks for the public source IP address of the current route to the RHOST' ,
24
22
'Author' => [ 'RageLtMan' ] ,
25
23
'License' => MSF_LICENSE ,
@@ -31,17 +29,14 @@ def initialize
31
29
32
30
register_options (
33
31
[
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' ] ] ) ,
35
33
OptString . new ( 'VHOST' , [ true , "The VHOST to use" , 'ifconfig.me' ] ) ,
36
34
OptBool . new ( 'REPORT_HOST' , [ false , 'Add the found IP to the database' , false ] )
37
35
] , self . class )
38
36
end
39
37
40
- def run_host ( ip )
41
-
42
-
38
+ def run
43
39
begin
44
- agent = datastore [ 'UserAgent' ]
45
40
connect
46
41
res = send_request_raw ( { 'uri' => '/ip' , 'method' => 'GET' } )
47
42
our_addr = res . body . strip
@@ -52,8 +47,8 @@ def run_host(ip)
52
47
53
48
end
54
49
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
57
52
end
58
53
end
59
54
0 commit comments