20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/msf/core/auxiliary/etcd.rb', line 20
def fingerprint_service(target_uri)
res = send_request_raw(
'uri' => normalize_uri(target_uri, 'version'),
'method' => 'GET'
)
if res && res.code == 200
begin
banner = res.get_json_document
rescue JSON::ParserError => e
print_error("Failed to read JSON from etcd version response: #{e.class} - #{e.message}}")
return
end
elsif res
vprint_error("Invalid response #{res.code} for etcd version response")
return
else
vprint_error("No response for etcd version probe")
return
end
report_service(
host: rhost,
port: rport,
name: 'etcd',
proto: 'tcp',
info: banner
)
banner
end
|