Rich Mirch

Penetration Tester, Red Teamer, Security Researcher

Exploiting Kaseya Unitrends Backup Appliance – Part 1 — May 20, 2022

Exploiting Kaseya Unitrends Backup Appliance – Part 1

In 2021 I discovered several high and critical vulnerabilities in the Kaseya Unitrends backup appliance. This research was conducted and published as part of my day job. Part one details a chain of vulnerabilities by leveraging an insecure PostgreSQL database to ultimately gain shell access to the remote server. Visit https://www.cyberonesecurity.com/blog/exploiting-kaseya-unitrends-backup-appliance-part-1 for the the full write-up. Stay tuned for part two.

Critical Vulnerabilities Discovered in MoFi Routers — September 2, 2020

Critical Vulnerabilities Discovered in MoFi Routers

I discovered several vulnerabilities in the MoFi4500 LTE router. Several vulnerabilities have not been patched, including an unauthenticated remote command injection and several undocumented backdoors. The full write-up can be viewed at https://www.criticalstart.com/critical-vulnerabilities-discovered-in-mofi-routers/.

Media Coverage

Follow the conversation on Twitter

CVE-2020-3950 VMware Fusion Elevation of Privilege — March 17, 2020

CVE-2020-3950 VMware Fusion Elevation of Privilege

VMware Fusion 11.5.12 and prior are vulnerable to an elevation of privilege vulnerability. For more details please review the advisory and proof of concept on my Github page CVE-2020-3950.sh. VMware released a the patch last week and a public advisory VMSA-2020-0005 today however it has been determined that the patch does not properly fix the vulnerability. I reached out to the VMware security team and received a response at 10:31 UTC 2020-03-18 – “We are aware of the situation and working on the next steps”.

I also learned today that Jeff Ball at GRIMM also independently discovered and reported the vulnerability to VMware.  This is a first for me. Make sure to read their excellent detailed write-up https://blog.grimm-co.com/post/analyzing-suid-binaries/. You can also follow the thread on Twitter.

Related Articles

 

CVE-2019-19954 Signal Desktop Windows Elevation of Privilege Vulnerability — December 18, 2019

CVE-2019-19954 Signal Desktop Windows Elevation of Privilege Vulnerability

Vulnerability Summary

Signal Desktop v1.29 on Windows is vulnerable to an elevation of privilege vulnerability. During the startup the application will execute the c:\node_modules\.bin\wmic.exe binary if it exists. By default on Windows, low privileged users have the privilege to create folders under root level drives. A low privileged user can create a malicious wmic.exe which will be executed every time Signal Desktop starts by any user of the system. The malicious binary is executed in the background without the users knowledge. This is an example of horizontal privilege escalation.

The vulnerability has been patched in v1.29.1 in commit 2da39c which was released 12/17/2019. Kudos to the Signal security team for fixing in less than two weeks! Unfortunately, at this time the they do not feel this warrants an advisory or CVE so the vulnerability was silently fixed. 12/24/2019 Update: Mitre assigned CVE-2019-19954

Steps To Reproduce

In a cmd window

mkdir c:\node_modules\.bin
copy c:\windows\system32\calc.exe c:\node_modules\.bin\wmic.exe

Now any user that opens Signal, the Windows calculator will be popped.

PoC

signal-lpe-3

Timeline

  • 2019-12-05: Report sent to Signal security team
  • 2019-12-11: Reached out to Signal to verify report was received
  • 2019-12-16: Signal acknowledges report
  • 2019-12-17: Signal v1.29.1 released
  • 2019-12-18: Published this blog post
  • 2019-12-24: MITRE assigned CVE-2019-19954

References

CVE-2019-3466 Debian / Ubuntu Privilege Escalation via pg_ctlcluster — November 15, 2019

CVE-2019-3466 Debian / Ubuntu Privilege Escalation via pg_ctlcluster

Vulnerability Summary

The pg_ctlcluster script in the postgresql-common package in Debian and Ubuntu is vulnerable to a local privilege escalation attack. pg_ctlcluster is a script used to manage PostgreSQL instances. A malicious actor with access to the postgres account can create arbitrary directories during startup or reload when called via systemd. This vulnerability can be leveraged to escalate privileges to root.

It’s important to note this is not a vulnerability in PostgreSQL and is specific to Debian, Ubuntu, or any system that consumes the Debian postgresql-common package.

A fix is now available. Administrators should upgrade to the latest version of the postgresql-common package. See the Debian security tracker for details.

The vulnerability appears to have existed since 2013 based on the Debian Git history (9dc97b, e97d16). I attempted to reproduce it on Wheezy but was unable to verify it due to unrelated technical issues standing up a test environment.

This proof of concept will show the ability to gain root privileges using the default
installation of  postgresql-common v200+deb10u2 along with postgresql-11 on Debian Buster. I have also verified the vulnerability on Ubuntu 19.04 with version 199 of the postgresql-common package.


Walkthrough

The postgresql init script(/etc/init.d/postgresql) sources init.d-functions which contain functions that call the pg_ctlcluster script. pg_ctlcluster loads the following configuration files determined by the Pgcommon module.

  • /etc/postgresql/cluster-version/cluster-name/pg_ctl.conf
  • /etc/postgresql/cluster-version/cluster-name/postgresql.conf
  • /var/lib/postgresql/cluster-version/cluster-name/postgresql.auto.conf

These files are owned by the postgres user. The postgresql.auto.conf file will override the settings from /etc/postgresql. This file is created when the alter system command is executed.

pg_ctlcluster contains logic to create directories for socketdir(defined in pg_ctl.conf) and stats_temp_directory(defined in postgresql.conf). During a start or reload, if the directories defined in either of these variables do not exist, pg_ctlcluster will create it and set the owner to the postgres user.

Continue reading

CVE-2019-12572 PIA Windows Privilege Escalation: Malicious OpenSSL Engine — June 10, 2019

CVE-2019-12572 PIA Windows Privilege Escalation: Malicious OpenSSL Engine

Vulnerability Summary

During startup the PIA Windows service(pia-service.exe) loads the OpenSSL library from C:\Program Files\Private Internet Access\libeay32.dll. This library attempts to load the C:\etc\ssl\openssl.cnf configuration file. By default on Windows systems, authenticated users can create directories under C:\. A low privileged user can create a openssl.cnf configuration file to load a malicious OpenSSL engine library resulting in the arbitrary code execution as SYSTEM when the service starts.

The root cause is when the OpenSSL libraries were built, the OPENSSLDIR parameter was set to a path which a low privileged user can modify or create. I believe this issue is lurking in many Window applications that bundle OpenSSL libraries. I have discovered the same vulnerability in several other Windows applications and will be disclosing those findings when patches are available.

I created a simple tool to help identify potentially vulnerable OpenSSL libraries –https://github.com/mirchr/openssldir_check.

CVE-2019-12572 has been patched in v1.2.1. The latest Windows desktop client can be upgraded automatically via the application or manually from the download page at Private Internet Access.


Walkthrough

While hunting for potential vulnerabilities in the Windows Private Internet Access desktop application I noticed a failed call to open the c:\etc\ssl\openssl.cnf file during the service startup.

pia-openssl-failed-open

This caught my attention and I needed to research this further. But before I get into the details of that, let’s take a step back and see how I arrived there.

Continue reading

Write-up for CVE-2018-15332 , CVE-2018-5529 , CVE-2018-5546 , CVE-2019-6617 — May 21, 2019

Write-up for CVE-2018-15332 , CVE-2018-5529 , CVE-2018-5546 , CVE-2019-6617

Published write-ups for a few vulnerabilities I discovered and responsibly disclosed last year. One vulnerability took three fixes to finally resolve the issue. As a best practice, I always re-check the vulnerability after a patch is available because the fix may not properly resolve the issue or a new vulnerability is introduced. Kudos to the F5 Security Incident Response Team (SIRT). I will be posting additional detailed write-ups in the near future.

CVE-2018-15332 , CVE-2018-5529 , and CVE-2018-5546 – F5 BIG-IP APM client for Linux and macOS arbitrary file takeover vulnerability.

https://github.com/mirchr/security-research/blob/master/vulnerabilities/F5/CVE-2018-15332.txt

https://github.com/mirchr/security-research/blob/master/vulnerabilities/F5/CVE-2018-5529.txt

CVE-2019-6617 – F5 BIG-IP Resource Administrator Privilege Escalation. 

https://github.com/mirchr/security-research/blob/master/vulnerabilities/F5/CVE-2019-6617.txt

 

Linux persistence idea – using group passwords — January 9, 2019

Linux persistence idea – using group passwords

A rarely used feature on Linux and UNIX systems is the ability to add a password to a group. The concept is similar to how users are handled. An encrypted hash is stored in the second field of the gshadow(5) file. Anyone with the password can execute the newgrp(1) command to temporarily change their GID without having to be a member of the group. The goal of this post is show how this feature can be leveraged to create persistence on a server in a semi stealthy way.

Continue reading