<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>Persistence-Technique - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/persistence-technique/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Fri, 21 Aug 2026 13:08:12 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/persistence-technique/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>TeamPCP Persistence via Malicious Python .pth Files</title><link>https://feed.craftedsignal.io/briefs/2026-08-python-pth-persistence/</link><pubDate>Fri, 21 Aug 2026 13:08:12 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-08-python-pth-persistence/</guid><description>The threat actor TeamPCP leverages Python path configuration (.pth) files created during package installation to achieve persistent arbitrary code execution.</description><content:encoded><![CDATA[<p>The threat actor group TeamPCP has been identified exploiting the Python interpreter's behavior regarding path configuration files (.pth). During the supply chain compromise of the 'litellm' package, the actors embedded malicious .pth files within the package distribution. When these packages are installed, the .pth file is placed into the site-packages or dist-packages directory. The Python interpreter automatically processes these files upon every subsequent invocation, leading to persistent, arbitrary code execution on the compromised host. This technique is particularly effective as it bypasses traditional execution controls and remains active regardless of how the Python application is built or distributed. Defenders should monitor for the correlation between Python process execution and the creation of .pth files in sensitive package directories.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The adversary publishes a malicious version of a legitimate Python package (e.g., 'litellm') to a public repository.</li>
<li>A target user installs the malicious package via 'pip' or other standard package managers.</li>
<li>The malicious installation script triggers a process (e.g., python.exe) to handle package setup.</li>
<li>The installation process writes a malicious .pth file to the target's 'site-packages' or 'dist-packages' directory.</li>
<li>The attacker's code inside the .pth file is configured to execute upon Python startup.</li>
<li>The victim executes a local Python script or application on the host.</li>
<li>The Python interpreter automatically parses the directory, discovers the .pth file, and executes the contained malicious commands.</li>
<li>The attacker achieves persistence and potential full control over the compromised environment.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation results in persistent arbitrary code execution on the target endpoint. Any host that installs the compromised package, including developers and automated CI/CD build environments, becomes infected. This enables data exfiltration, lateral movement, and long-term access to the internal network.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable Sysmon logging for Event ID 1 (Process Creation) and Event ID 11 (File Creation) to capture .pth file modifications.</li>
<li>Deploy the provided Sigma rule to detect the specific correlation between python.exe activity and .pth file creation.</li>
<li>Review the contents of any .pth files found in site-packages or dist-packages for suspicious imports or command execution scripts.</li>
<li>Audit Python environments for unauthorized changes to package installation directories.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">threat</category><category>persistence</category><category>supply-chain-compromise</category><category>python</category><category>persistence-technique</category></item></channel></rss>