2010-11-15 05:12:48 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2010-11-15 05:12:48 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Auxiliary
|
2010-11-15 05:12:48 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
|
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'SAP BusinessObjects Version Detection',
|
|
|
|
'Description' => 'This module simply attempts to identify the version of SAP BusinessObjects.',
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
# General
|
|
|
|
[ 'URL', 'http://spl0it.org/files/talks/source_barcelona10/Hacking%20SAP%20BusinessObjects.pdf' ]
|
|
|
|
],
|
|
|
|
'Author' => [ 'Joshua Abraham <jabra[at]rapid7.com>' ],
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(8080),
|
|
|
|
OptString.new('URI', [false, 'Path to the SAP BusinessObjects Axis2', '/dswsbobje']),
|
2017-05-03 20:42:21 +00:00
|
|
|
])
|
2013-08-30 21:28:54 +00:00
|
|
|
register_autofilter_ports([ 8080 ])
|
|
|
|
deregister_options('RHOST')
|
|
|
|
end
|
|
|
|
|
|
|
|
def run_host(ip)
|
|
|
|
res = send_request_cgi({
|
|
|
|
'uri' => normalize_uri(datastore['URI'], "/services/listServices"),
|
|
|
|
'method' => 'GET'
|
|
|
|
}, 25)
|
|
|
|
return if not res or res.code != 200
|
|
|
|
|
|
|
|
enum_version(ip)
|
|
|
|
end
|
|
|
|
|
|
|
|
def enum_version(rhost)
|
|
|
|
print_status("Identifying SAP BusinessObjects on #{rhost}:#{rport}")
|
|
|
|
success = false
|
|
|
|
soapenv='http://schemas.xmlsoap.org/soap/envelope/'
|
|
|
|
xmlns='http://session.dsws.businessobjects.com/2007/06/01'
|
|
|
|
xsi='http://www.w3.org/2001/XMLSchema-instance'
|
|
|
|
|
|
|
|
data = '<?xml version="1.0" encoding="utf-8"?>' + "\r\n"
|
|
|
|
data << '<soapenv:Envelope xmlns:soapenv="' + soapenv + '" xmlns:ns="' + xmlns + '">' + "\r\n"
|
|
|
|
data << '<soapenv:Header/>' + "\r\n"
|
|
|
|
data << '<soapenv:Body>' + "\r\n"
|
|
|
|
data << '<ns:getVersion/>' + "\r\n"
|
|
|
|
data << '</soapenv:Body>' + "\r\n"
|
|
|
|
data << '</soapenv:Envelope>' + "\r\n\r\n"
|
|
|
|
|
|
|
|
begin
|
|
|
|
res = send_request_raw({
|
|
|
|
'uri' => normalize_uri(datastore['URI']) + "/services/Session",
|
|
|
|
'method' => 'POST',
|
|
|
|
'data' => data,
|
|
|
|
'headers' =>
|
|
|
|
{
|
|
|
|
'Content-Length' => data.length,
|
|
|
|
'SOAPAction' => '"' + 'http://session.dsws.businessobjects.com/2007/06/01/getVersion' + '"',
|
|
|
|
'Content-Type' => 'text/xml; charset=UTF-8',
|
|
|
|
}
|
|
|
|
}, 15)
|
|
|
|
|
|
|
|
if res and res.code == 200
|
|
|
|
case res.body
|
|
|
|
when nil
|
2015-04-03 11:12:23 +00:00
|
|
|
# Nothing
|
2013-08-30 21:28:54 +00:00
|
|
|
when /<Version xmlns=".*">(.*)<\/Version><\/getVersionResponse>/
|
|
|
|
version = "#{$1}"
|
|
|
|
success = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
rescue ::Rex::ConnectionError
|
|
|
|
print_error("[SAP BusinessObjects] Unable to attempt authentication")
|
|
|
|
return :abort
|
|
|
|
end
|
|
|
|
|
|
|
|
if success
|
|
|
|
print_good("[SAP BusinessObjects] Version: #{version}")
|
|
|
|
return
|
|
|
|
else
|
|
|
|
print_error("[SAP BusinessObjects] failed to identify version")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2010-11-15 05:12:48 +00:00
|
|
|
end
|