@@ -29,26 +29,19 @@ def initialize
29
29
30
30
register_options (
31
31
[
32
- OptEnum . new ( 'RHOST' , [ true , 'The ifconfig.me server to use' , '49.212.202.172' , [ '49.212.202.172' , '133.242.129.236' ] ] ) ,
33
- OptString . new ( 'VHOST' , [ true , "The VHOST to use" , 'ifconfig.me' ] ) ,
32
+ Opt ::RHOST ( 'ifconfig.me' ) ,
34
33
OptBool . new ( 'REPORT_HOST' , [ false , 'Add the found IP to the database' , false ] )
35
34
] , self . class )
36
35
end
37
36
38
37
def run
39
- begin
40
- connect
41
- res = send_request_raw ( { 'uri' => '/ip' , 'method' => 'GET' } )
42
- our_addr = res . body . strip
43
- if Rex ::Socket . is_ipv4? ( our_addr ) or Rex ::Socket . is_ipv6? ( our_addr )
44
- print_good ( "Source ip to #{ ip } is #{ our_addr } " )
45
- report_host ( our_addr ) if datastore [ 'REPORT_HOST' ]
46
- end
47
-
48
- end
49
- rescue ::Rex ::ConnectionRefused , ::Rex ::HostUnreachable , ::Rex ::ConnectionTimeout
50
- rescue Timeout ::Error , Errno ::EINVAL , Errno ::ECONNRESET , EOFError , Errno ::ECONNABORTED , Errno ::ECONNREFUSED , Errno ::EHOSTUNREACH => e
51
- raise e
38
+ connect
39
+ res = send_request_raw ( { 'uri' => '/ip' , 'method' => 'GET' } )
40
+ our_addr = res . body . strip
41
+ if Rex ::Socket . is_ipv4? ( our_addr ) or Rex ::Socket . is_ipv6? ( our_addr )
42
+ print_good ( "Source ip to #{ rhost } is #{ our_addr } " )
43
+ report_host ( our_addr ) if datastore [ 'REPORT_HOST' ]
52
44
end
53
45
end
54
46
47
+ end
0 commit comments