Trustwave's 2024 Retail Report Series Highlights Alarming E-Commerce Threats and Growing Fraud Against Retailers. Learn More

Trustwave's 2024 Retail Report Series Highlights Alarming E-Commerce Threats and Growing Fraud Against Retailers. Learn More

Services
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Microsoft Security
Unlock the full power of Microsoft Security
Offensive Security
Solutions to maximize your security ROI
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats

Trustwave Threat Hunting Guide: Identifying PwnKit (CVE-2021-4034) Exploitation

The Trustwave Threat Hunting team has authored a practical guide to help the cybersecurity community address the Linux “polkit” Local Privilege Escalation vulnerability (CVE-2021-4034) by identifying common behavior in exploitation.

Overview

On January 25, 2022, Qualys released a research blog detailing a critical vulnerability (aka PwnKit) in the “polkit” component available by default in almost all Linux distributions. At the time of this writing, the Trustwave Threat Hunt team has not witnessed any attacks in the wild using this Local Privilege Escalation.

Our team of threat hunters leveraged the Endpoint Detection and Response (EDR) API across our advanced tier client environment to determine if there was activity from non-root users accessing the ‘gconv-module’ file. This action can also be performed via a normal EDR query or a File Integrity Monitor. If there are findings where non-root users are seen modifying or acting on this file, the following techniques can be used to determine if it is malicious activity indicative of PwnKit exploitation.

How to investigate the results

  1. Check the timeline of events up to two minutes before the file access or modification for any curl/wget execution.
  2. Check the timeline of events up to two minutes before the file access or modification for any shellcode execution, similar to the below:

            ./anyname       
            or
            anyname.py
            or
            anyname.sh

  1. Check the timeline of events up to one minute before the file access or modification for any compilation like this in command line:

            sh -c gcc -o payload.so -shared -fPIC payload.c

  1. Check for username after the event file write/create "gconv-modules". If it is ROOT, then this may be indicative of malicious privilege escalation events.

How the exploit works and how to verify

  1. The exploit will create two folders under the current directory; the folder name can be any random name and "GCONV_PATH="
  2. The two folders will have an exploit attempt file, which can be any random name.
  3. Once the setup is done, the exploitation starts by executing "/usr/bin/pkexec" as ROOT user permission.
  4. You can observe the remaining process will be under ROOT user. This is where the adversary is executing the commands by obtaining ROOT user-level permission.

Summary

Although Local Privilege Escalation vulnerabilities require access to the vulnerable system, do not discount this vulnerability. When paired with any simple Remote Code Execution (RCE) vulnerability, this becomes a part of a critical attack chain. Given the massive attack surface that affects most every Linux distribution, this vulnerability will have legs that make it a threat well into 2022.

For more information about PwnKit (CVE-2021-4034), please refer to our Action Response.

Not every organization has the resources or expertise to perform Threat Hunting. Trustwave offers Threat Hunting services that combine human experts and automated processes to bring you purpose-built threat hunting capabilities that help you stay ahead of advanced adversaries.

ABOUT TRUSTWAVE

Trustwave is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.

Latest Intelligence

Discover how our specialists can tailor a security program to fit the needs of
your organization.

Request a Demo