File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
modules/auxiliary/scanner/http Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -35,23 +35,29 @@ def initialize(info = {})
35
35
end
36
36
37
37
def run
38
- res = send_request_cgi (
39
- 'uri' => normalize_uri ( target_uri . path ) ,
40
- 'method' => 'GET'
41
- )
38
+ begin
39
+ res = send_request_cgi (
40
+ 'uri' => normalize_uri ( target_uri . path ) ,
41
+ 'method' => 'GET'
42
+ )
43
+ rescue ::Errno ::EPIPE , ::Timeout ::Error , ::EOFError , ::IOError => e
44
+ print_error ( "#{ peer } - The following Error was encountered: #{ e . class } " )
45
+ return
46
+ end
42
47
43
48
if res && res . code == 401
44
49
print_error ( "#{ peer } - Failed to authenticate. Invalid username/password." )
45
50
return
46
51
end
47
52
48
- if res . code == 200 && res . headers [ 'X-Influxdb-Version' ] . include? ( 'InfluxDB' ) && res . body . length > 0
53
+ if res && res . code == 200 && res . headers [ 'X-Influxdb-Version' ] . include? ( 'InfluxDB' ) && res . body . length > 0
49
54
print_status ( 'Enumerating...' )
50
55
begin
51
56
temp = JSON . parse ( res . body )
52
57
results = JSON . pretty_generate ( temp )
53
58
rescue JSON ::ParserError
54
59
print_error ( 'Unable to parse JSON data for the response.' )
60
+ return
55
61
end
56
62
57
63
print_good ( "Found:\n \n #{ results } \n " )
@@ -68,7 +74,5 @@ def run
68
74
else
69
75
print_error ( "#{ peer } - Unable to enum, received \" #{ res . code } \" ." )
70
76
end
71
- rescue => e
72
- print_error ( "#{ peer } - The following Error was encountered: #{ e . class } " )
73
77
end
74
78
end
You can’t perform that action at this time.
0 commit comments