File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
modules/auxiliary/scanner/http Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -45,34 +45,34 @@ def run
45
45
return
46
46
end
47
47
48
- if res && res . code == 401
49
- print_error ( "#{ peer } - Failed to authenticate. Invalid username/password ." )
48
+ unless res
49
+ print_error ( "#{ peer } - Server did not respond in an expected way ." )
50
50
return
51
51
end
52
52
53
- if res && res . code == 200 && res . headers [ 'X-Influxdb-Version' ] . include? ( 'InfluxDB' ) && res . body . length > 0
53
+ if res . code == 401 && res . body =~ /Invalid username\/ password/
54
+ print_error ( "#{ peer } - Failed to authenticate. Invalid username/password." )
55
+ return
56
+ elsif res . code == 200 && res . headers . include? ( 'X-Influxdb-Version' ) && res . body . length > 0
54
57
print_status ( 'Enumerating...' )
55
58
begin
56
59
temp = JSON . parse ( res . body )
57
60
results = JSON . pretty_generate ( temp )
58
61
rescue JSON ::ParserError
59
- print_error ( 'Unable to parse JSON data for the response .' )
62
+ print_error ( 'Unable to parse JSON data.' )
60
63
return
61
64
end
62
-
63
65
print_good ( "Found:\n \n #{ results } \n " )
64
-
65
66
path = store_loot (
66
67
'influxdb.enum' ,
67
68
'text/plain' ,
68
69
rhost ,
69
70
results ,
70
71
'InfluxDB Enum'
71
72
)
72
-
73
73
print_good ( "#{ peer } - File saved in: #{ path } " )
74
74
else
75
- print_error ( "#{ peer } - Unable to enum, received \" #{ res . code } \" . " )
75
+ print_error ( "#{ peer } - Unable to enum, received \" #{ res . code } \" " )
76
76
end
77
77
end
78
78
end
You can’t perform that action at this time.
0 commit comments