Skip to content

Commit b032f2c

Browse files
committed
Added Elastic Search Enum
1 parent c76c022 commit b032f2c

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
##
2+
# This module requires Metasploit: http//metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
7+
require 'msf/core'
8+
9+
10+
class Metasploit3 < Msf::Auxiliary
11+
12+
# Exploit mixins should be called first
13+
include Msf::Exploit::Remote::HttpClient
14+
# Scanner mixin should be near last
15+
include Msf::Auxiliary::Scanner
16+
include Msf::Auxiliary::Report
17+
18+
def initialize
19+
super(
20+
'Name' => 'ElasticSearch Enum Utility',
21+
'Description' => 'Send a request to enumerate ElasticSearch indices',
22+
'Author' => ['Silas Cutler <Silas.Cutler [at] BlackListThisDomain.com'],
23+
'License' => MSF_LICENSE
24+
)
25+
register_options(
26+
[
27+
Opt::RPORT(9200)
28+
]
29+
)
30+
31+
end
32+
33+
def run_host(target_host)
34+
35+
begin
36+
res = send_request_raw({
37+
'uri' => '/_aliases',
38+
'method' => 'GET',
39+
'version' => '1.0',
40+
}, 10)
41+
42+
if res.nil?
43+
print_error("No response for #{target_host}")
44+
return nil
45+
end
46+
47+
begin
48+
temp = JSON.parse(res.body)
49+
rescue JSON::ParserError
50+
print_error("Unable to parse JSON")
51+
return
52+
end
53+
54+
55+
if (res.code == 200)
56+
temp.each do |index|
57+
print_good("Index : " + index[0])
58+
end
59+
end
60+
61+
if res and res.code == 200 and res.headers['Content-Type'] and res.body.length > 0
62+
path = store_loot("couchdb.enum.file", "text/plain", rhost, res.body, "CouchDB Enum Results")
63+
print_status("Results saved to #{path}")
64+
else
65+
print_error("Failed to save the result")
66+
end
67+
68+
69+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
70+
rescue ::Timeout::Error, ::Errno::EPIPE
71+
end
72+
end
73+
end

0 commit comments

Comments
 (0)