Threat reportThreat IntelligenceTL-2026-4011
Python .pth Startup Files Abused for Persistence (UPSTYLE backdoor in GlobalProtect CVE-2024-3400 exploitation)
Python path-configuration (.pth) files execute any line beginning with 'import' followed by a space or tab each time the interpreter starts, giving attackers a stealthy persistence and execution hook that default tooling rarely inspects. The technique was used in the wild by UTA0218 in the UPSTYLE Python backdoor (update.py writing system.pth) deployed after exploiting Palo Alto PAN-OS GlobalProtect CVE-2024-3400. First disclosed .
Key facts
| Identifiers | TL-2026-4011, CVE-2024-3400 |
|---|---|
| Also known as | UPSTYLE, Python startup hooks persistence |
| Severity | MEDIUM |
| First disclosed | |
| Exploitation status | Linked CVE exploited in the wild; Listed in CISA KEV: CVE-2024-3400 (added ) |
| EPSS | CVE-2024-3400: 99.9% (99.9th percentile) |
| Affected products | Python Software Foundation CPython (site module .pth processing); Palo Alto Networks PAN-OS GlobalProtect (CVE-2024-3400 delivery vector) |
| Weaknesses (CWE) | CWE-77, CWE-20 |
| Attribution | UTA0218 (low confidence) |
| Malware | Python, UPSTYLE |
| Tools | GOST, Netcat |
| MITRE ATT&CK techniques | T1003.003 NTDS, T1021.004 SSH, T1027.010 Command Obfuscation, T1053.003 Cron, T1059.004 Unix Shell, T1059.006 Python, T1070.004 File Deletion, T1132.001 Standard Encoding, T1190 Exploit Public-Facing Application, T1546.018 Python Startup Hooks, T1555.003 Credentials from Web Browsers, T1572 Protocol Tunneling |
| Motivation | ESPIONAGE |
| Detection rules | 9 (1 shown free) |
| Sources | 8 cited sources |
Detection coverage
As of 2026-10-21, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-4011 across Splunk SPL, Microsoft KQL and Sigma, covering 13 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: UPSTYLE-Style Python .pth Startup File Created in site-packages / dist-packages
Detects creation or modification of a .pth file inside a Python site-packages or dist-packages directory. Python's site module exec()s any .pth line beginning with 'import' plus a space or tab on every interpreter start, which UTA0218 abused in the UPSTYLE backdoor (system.pth dropped after CVE-2024-3400 exploitation) and which dfir.ch documents as a stealthy persistence hook (T1546.018). Names seen in research (system.pth, update.pth, malmoeb.pth) are flagged as high priority. Part of TL-2026-4011.
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1546.018, T1059.006
- Data sources: linux_auditd (index=linux, sourcetype=linux_audit), sysmon_for_linux, microsoft_defender_for_endpoint_linux (DeviceFileEvents)
- Severity: high
- Confidence: high
Splunk SPL
index=linux sourcetype=linux_audit type=PATH earliest=-24h (name="*/site-packages/*.pth" OR name="*/dist-packages/*.pth") nametype IN ("CREATE","NORMAL")
| eval pth_file=lower(name)
| where NOT match(pth_file, "(-nspkg|distutils-precedence|easy-install)\.pth$")
| eval upstyle_name_match=if(match(pth_file, "/(system|update|malmoeb)\.pth$"), "UPSTYLE-known-name", "generic-pth")
| stats min(_time) as first_seen max(_time) as last_seen values(nametype) as nametype values(upstyle_name_match) as upstyle_name_match count by host, name
| convert ctime(first_seen) ctime(last_seen)Microsoft KQL
DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where FileName endswith ".pth"
| where FolderPath has_any ("/site-packages", "/dist-packages")
| where not(FileName endswith "-nspkg.pth" or FileName in~ ("distutils-precedence.pth", "easy-install.pth"))
| extend UpstyleKnownName = FileName in~ ("system.pth", "update.pth", "malmoeb.pth")
| project Timestamp, DeviceName, ActionType, FolderPath, FileName, UpstyleKnownName, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName, SHA256Sigma
title: Python .pth Startup File Created in site-packages (UPSTYLE-Style Persistence)
id: 7c1e5b2a-3d4f-4a68-9b10-5e2f8a6c1d01
status: experimental
description: Detects creation of a .pth file in a Python site-packages or dist-packages directory. Lines starting with import in .pth files are executed at every interpreter start and were abused by UTA0218 UPSTYLE (system.pth) after CVE-2024-3400.
references:
- https://dfir.ch/posts/publish_python_pth_extension/
- https://www.volexity.com/blog/2024/04/12/zero-day-exploitation-of-unauthenticated-remote-code-execution-vulnerability-in-globalprotect-cve-2024-3400/
author: Threadlinqs Team
date: 2026-10-21
tags:
- attack.persistence
- attack.privilege_escalation
- attack.t1546.018
- attack.execution
- attack.t1059.006
- cve.2024-3400
logsource:
category: file_event
product: linux
detection:
selection:
TargetFilename|contains:
- '/site-packages/'
- '/dist-packages/'
TargetFilename|endswith: '.pth'
filter_legit_packaging:
TargetFilename|endswith:
- '-nspkg.pth'
- '/distutils-precedence.pth'
- '/easy-install.pth'
condition: selection and not filter_legit_packaging
falsepositives:
- Package installation via pip, apt or yum that ships a legitimate .pth file
- Virtualenv or conda environment creation
level: high
Known false positives:
- Package installation via pip, apt or yum that ships a legitimate .pth file
- Virtualenv or conda environment creation and CI build agents
- Editable installs (pip install -e) that write easy-install or __editable__ .pth files
Tuning notes: Requires an auditd watch such as: -w /usr/lib/python3 -p wa -k pth_watch (repeat for /usr/local/lib/python3*/dist-packages and per-user ~/.local/lib). Baseline legitimate .pth names per fleet and extend the exclusion regex (for example __editable__*.pth). Restrict alerting to writes by processes other than pip, dpkg, rpm and apt. Treat any hit on system.pth or update.pth as critical; malmoeb.pth is the benign dfir.ch test artifact and is useful for validating the rule.
- PAN-OS GlobalProtect CVE-2024-3400 Exploitation (Threat Signatures and SESSID Traversal) · unlock with TL Creds
- Obfuscated Python Exec or Shell-Written .pth Import Line (UPSTYLE Base64 Payload) · unlock with TL Creds
- NTDS.DIT Extraction and Browser Credential Store Copy After Edge Device Compromise · unlock with TL Creds
- GlobalProtect SESSID Cookie Traversal or Injection (CVE-2024-3400 Web Telemetry) · unlock with TL Creds
- Cron Job Fetching Remote Policy File Every Minute (UTA0218 Persistence) · unlock with TL Creds
- [indicator] Connectivity Beacon and UTA0218 C2 IP [indicator] via Proxy or Firewall Logs · unlock with TL Creds
- Python to Shell to Netcat Process Chain (.pth / UPSTYLE Reverse Shell) · unlock with TL Creds
- UTA0218 GOST / Reverse-SSH Tunneling and C2 IP [indicator] Contact · unlock with TL Creds
Indicators of compromise
As of 2026-10-21, Threadlinqs Intelligence tracks 13 indicators of compromise for TL-2026-4011.
Sample indicators (3 of 13)
- IP address:
172.233.228[.]93 - Domain:
worldtimeapi[.]org - File hash:
0c1554888ce9ed0da1583dbdf7b31651
Defanged, TLP:CLEAR. Full set of 13 indicators: unlock with TL Creds.
Technical analysis
Python's site module processes .pth files found in site-packages / dist-packages directories at interpreter start-up. Lines that begin with 'import' followed by a space or tab are passed to exec(), so a single line such as 'import os; os.system(...)' runs arbitrary code whenever any Python process starts or the site module is imported (behavior documented in the Python site module docs; executed lines are supported since Python 3.5 per dfir.ch). Files in a directory are processed in alphabetical order. Interpreter flag -S suppresses the site module and therefore .pth processing; -s disables only the user site-packages directory. Python 3.15 deprecates executing 'import' lines in .pth files (still executed, diagnostic only with -v), with removal planned in later releases; .start files are the documented migration path.
dfir.ch (2025-01-14) analyzes the technique and lists example locations: /usr/lib/python3.6/site-packages/, /usr/local/lib/python3.12/dist-packages/ and the per-user /root/.local/lib/python3.12/site-packages/. The article's researcher test artifact is /usr/local/lib/python3.12/dist-packages/malmoeb.pth. The article notes that default security tooling typically misses .pth persistence and recommends monitoring creation of new (and hidden) .pth files in site-packages directories, and Python -> Bash -> nc process chains. It also points to CPython issue #113659 and the SafeBreach talk 'I'm In Your $PYTHONPATH, Backdooring Your Python Programs' (Itzik Kotler) for the related $PYTHONPATH redirection technique.
Real-world precedent: Volexity (2024-04-12) documented UTA0218, assessed as likely state-backed, exploiting the unauthenticated OS command injection CVE-2024-3400 in Palo Alto Networks PAN-OS GlobalProtect (CVSS 10.0 per vendor/Volexity). Volexity tracked the Python backdoor as UPSTYLE: update.py (MD5 0c1554888ce9ed0da1583dbdf7b31651, SHA256 3de2a4392b8715bad070b2ae12243f166ead37830f7c6d24e778985927f9caac) is dropped and writes a system.pth (dfir.ch cites /usr/lib/python3.6/site-packages/system.pth) whose base64-encoded payload executes on Python module imports. UPSTYLE parses the nginx error log (sslvpn_ngx_error.log) for attacker-supplied command patterns, executes them, writes output to a bootstrap CSS file, and cleans up artifacts within about 15 seconds; a signal handler protects the component from deletion. Post-exploitation described by Volexity includes cron jobs fetching remote 'policy' files every 60 seconds, reverse shells, firewall configuration exfiltration, the GOST tunneling tool and reverse-SSH, a worldtimeapi.org connectivity beacon, lateral movement over SMB/RDP with compromised service accounts, and theft of Chrome/Edge browser data, NTDS.DIT and DPAPI keys. Volexity's observed timeline: 2024-03-26 reconnaissance (zero-byte file), 2024-04-07 failed backdoor deployment, 2024-04-10 successful exploitation, 2024-04-11 second compromise.
The CVE is referenced context rather than the subject of the dfir.ch article; the technique applies to any host with a Python interpreter and write access to a site directory. No CVSS is assigned to the technique itself.
MITRE ATT&CK techniques by tactic:
Credential Access
T1003.003 NTDS; T1555.003 Credentials from Web Browsers
Lateral Movement
Defense Evasion
T1027.010 Command Obfuscation; T1070.004 File Deletion
Persistence
T1053.003 Cron; T1546.018 Python Startup Hooks
Execution
T1059.004 Unix Shell; T1059.006 Python
Command and Control
T1132.001 Standard Encoding; T1572 Protocol Tunneling
Initial Access
T1190 Exploit Public-Facing Application
Privilege Escalation
Remediation
Patches
- PAN-OS 10.2.9-h1 or later
- PAN-OS 11.0.4-h1 or later
- PAN-OS 11.1.2-h3 or later
Immediate actions
- Hunt for new or modified .pth files in all Python site-packages and dist-packages directories, including hidden files and per-user site directories
- Review .pth files for lines starting with 'import' followed by a space or tab, especially base64 blobs, exec/eval, os.system or subprocess calls
- Alert on Python -> bash/sh -> nc (netcat) process chains
- On PAN-OS GlobalProtect devices, apply the CVE-2024-3400 hotfixes and investigate for UPSTYLE (update.py, system.pth, sslvpn_ngx_error.log abuse)
Workarounds
- Palo Alto Networks Threat Prevention signatures (Threat IDs 95187, 95189, 95191) with vulnerability protection on GlobalProtect interfaces
- Restrict write permissions to Python site-packages/dist-packages directories to trusted administrators
Longer-term hardening
- Baseline and file-integrity-monitor Python site directories on servers, containers and appliances
- Deploy EDR/auditd rules covering file creation of *.pth under python*/site-packages and dist-packages
- Run non-interactive Python services with -I or -S where site customization is not required
- Plan for Python 3.15+ deprecation of executable 'import' lines in .pth files
Affected and fixed versions
- Python Software Foundation — CPython (site module .pth processing)
Vulnerable versions: 3.5 and later: lines starting with 'import' in .pth files are executed
Fixed in: Behavior is by design; deprecated in 3.15 with later removal - Palo Alto Networks — PAN-OS GlobalProtect (CVE-2024-3400 delivery vector)
Vulnerable versions: 10.2 before 10.2.9-h1; 11.0 before 11.0.4-h1; 11.1 before 11.1.2-h3
Fixed in: 10.2.9-h1; 11.0.4-h1; 11.1.2-h3
Timeline
- Volexity observes UTA0218 initial reconnaissance against a GlobalProtect device (zero-byte file placement)
- Failed backdoor deployment attempt against a GlobalProtect device
- Successful exploitation of CVE-2024-3400 with payload delivery, including the Python-based UPSTYLE backdoor
- Second victim compromised following the same attack pattern
- Palo Alto Networks advisory and Volexity report published; CVE-2024-3400 added to CISA KEV
- dfir.ch publishes analysis of Python .pth files as a persistence mechanism, citing the GlobalProtect backdoor as real-world use
Sources cited
- NVD: CVE-2024-3400 NVD (NIST) · Advisory · 2024-04-12
- CISA Known Exploited Vulnerabilities Catalog (CVE-2024-3400 added 2024-04-12) CISA · Government advisory · 2024-04-12
- Centre for Cybersecurity Belgium: CVE-2024-3400 GlobalProtect actively exploited ccb.belgium.be · Advisory
- Volexity: Zero-Day Exploitation of Unauthenticated RCE Vulnerability in GlobalProtect (CVE-2024-3400) volexity.com · Research · 2024-04-12
- Palo Alto Networks Security Advisory CVE-2024-3400 Palo Alto Networks · Vendor report · 2024-04-12
- Python docs: site - Site-specific configuration hook docs.python.org · Vendor report
- CPython issue #113659 GitHub · Code repository
- Analysis of Python's .pth files as a persistence mechanism (dfir.ch) dfir.ch · Blog · 2025-01-14
Other reports on CVE-2024-3400
Previous and next in threat intel
Drafted by the Threadlinqs research pipeline from 8 sources; published ; last updated —.