{"id":19094,"date":"2022-05-19T09:00:51","date_gmt":"2022-05-19T17:00:51","guid":{"rendered":"https:\/\/www.palada.net\/index.php\/2022\/05\/19\/news-12827\/"},"modified":"2022-05-19T09:00:51","modified_gmt":"2022-05-19T17:00:51","slug":"news-12827","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2022\/05\/19\/news-12827\/","title":{"rendered":"Rise in XorDdos: A deeper look at the stealthy DDoS malware targeting Linux devices"},"content":{"rendered":"<p><strong>Credit to Author: Katie McCafferty| Date: Thu, 19 May 2022 16:00:00 +0000<\/strong><\/p>\n<p>In the last six months, we observed a 254% increase in activity from a Linux trojan called XorDdos. First discovered in 2014 by the research group MalwareMustDie, XorDdos was named after its denial-of-service-related activities on Linux endpoints and servers as well as its usage of XOR-based encryption for its communications.<\/p>\n<p>XorDdos depicts the trend of malware increasingly targeting Linux-based operating systems, which are commonly deployed on cloud infrastructures and Internet of Things (IoT) devices. By compromising IoT and other internet-connected devices, XorDdos amasses botnets that can be used to carry out distributed denial-of-service (DDoS) attacks. Using a botnet to perform DDoS attacks can potentially create significant disruptions, such as the <a href=\"https:\/\/azure.microsoft.com\/blog\/business-as-usual-for-azure-customers-despite-24-tbps-ddos-attack\/?ranMID=24542&amp;ranEAID=TnL5HPStwNw&amp;ranSiteID=TnL5HPStwNw-QrFhTcj5NHbS49DwTEAxiA&amp;epi=TnL5HPStwNw-QrFhTcj5NHbS49DwTEAxiA&amp;irgwc=1&amp;OCID=AID2200057_aff_7593_1243925&amp;tduid=%28ir__f1adpj9cvckf62kijydwmqedqu2xtltt90ejoqbv00%29%287593%29%281243925%29%28TnL5HPStwNw-QrFhTcj5NHbS49DwTEAxiA%29%28%29&amp;irclickid=_f1adpj9cvckf62kijydwmqedqu2xtltt90ejoqbv00\">2.4 Tbps DDoS attack Microsoft mitigated<\/a> in August 2021. DDoS attacks in and of themselves can be highly problematic for numerous reasons, but such attacks can also be used as cover to hide further malicious activities, like deploying malware and infiltrating target systems.<\/p>\n<p>Botnets can also be used to compromise other devices, and XorDdos is known for using Secure Shell (SSH) brute force attacks to gain remote control on target devices. SSH is one of the most common protocols in IT infrastructures and enables encrypted communications over insecure networks for remote system administration purposes, making it an attractive vector for attackers. Once XorDdos identifies valid SSH credentials, it uses root privileges to run a script that downloads and installs XorDdos on the target device.<\/p>\n<p>XorDdos uses evasion and persistence mechanisms that allow its operations to remain robust and stealthy. Its evasion capabilities include obfuscating the malware\u2019s activities, evading rule-based detection mechanisms and hash-based malicious file lookup, as well as using anti-forensic techniques to break process tree-based analysis. We observed in recent campaigns that XorDdos hides malicious activities from analysis by overwriting sensitive files with a null byte. It also includes various persistence mechanisms to support different Linux distributions.&nbsp;<\/p>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"747\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-1.-Typical-attack-vector-for-XorDdos-malware_ccexpress-1024x747.png\" alt=\"Figure 1 displays a diagram depicting a typical attack flow for XorDdos malware. The attacker communicates with a bot to SSH brute force a target device and download XorDdos. The malware then performs several techniques for evasion and persistence before connecting with the attacker's C2 server to send data and receive commands.\" class=\"wp-image-114540\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-1.-Typical-attack-vector-for-XorDdos-malware_ccexpress-1024x747.png 1024w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-1.-Typical-attack-vector-for-XorDdos-malware_ccexpress-300x219.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-1.-Typical-attack-vector-for-XorDdos-malware_ccexpress-768x560.png 768w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-1.-Typical-attack-vector-for-XorDdos-malware_ccexpress.png 1207w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Figure 1. A typical attack vector for XorDdos malware<\/figcaption><\/figure>\n<p>XorDdos may further illustrate another trend observed in various platforms, in which malware is used to deliver other dangerous threats. We found that devices first infected with XorDdos were later infected with additional malware such as the Tsunami backdoor, which further deploys the XMRig coin miner. While we did not observe XorDdos directly installing and distributing secondary payloads like Tsunami, it\u2019s possible that the trojan is leveraged as a vector for follow-on activities.<\/p>\n<p><a href=\"https:\/\/www.microsoft.com\/security\/business\/threat-protection\/endpoint-defender?rtc=1\">Microsoft Defender for Endpoint<\/a> protects against XorDdos by detecting and remediating the trojan\u2019s multi-stage, modular attacks throughout its entire attack chain and any potential follow-on activities on endpoints. In this blog post, we detail our in-depth analysis of XorDdos to help defenders understand its techniques and protect their networks from this stealthy malware.<\/p>\n<p>This blog post covers the following topics:<\/p>\n<ul>\n<li><a href=\"#Initial_access\">Initial access<\/a><\/li>\n<li><a href=\"#XorDdos_payload\">XorDdos payload analysis<\/a>\n<ul>\n<li><a href=\"#Detection_evasion\">Detection evasion capabilities<\/a><\/li>\n<\/ul>\n<ul>\n<li><a href=\"#Persistence_mechanisms\">Persistence mechanisms<\/a><\/li>\n<\/ul>\n<ul>\n<li><a href=\"#Argument-based_code-flow\">Argument-based code-flow<\/a><\/li>\n<\/ul>\n<ul>\n<li><a href=\"#Malicious_activity\">Malicious activity threads<\/a><\/li>\n<\/ul>\n<ul>\n<li><a href=\"#DDoS_attack\">DDoS attack thread pool<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#Defending_against\">Defending against Linux platform threats<\/a><\/li>\n<li><a href=\"#Detection_details\">Detection details<\/a><\/li>\n<li><a href=\"#Hunting_queries\">Hunting queries<\/a><\/li>\n<li><a href=\"#Indicators\">Indicators<\/a><\/li>\n<\/ul>\n<h2 id=\"Initial_access\">Initial access<\/h2>\n<p>XorDdos propagates primarily via SSH brute force. It uses a malicious shell script to try various root credential combinations across thousands of servers until finding a match on a target Linux device. As a result, we see many failed sign-in attempts on devices successfully infected by the malware:<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"196\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-2.-Failed-sign-in-attempts-on-a-device-affected-by-XorDdos.png\" alt=\"Figure 2's line chart depicts the increasing amount of failed sign-in attempts by a device infected by XorDdos. \" class=\"wp-image-114375\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-2.-Failed-sign-in-attempts-on-a-device-affected-by-XorDdos.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-2.-Failed-sign-in-attempts-on-a-device-affected-by-XorDdos-300x74.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-2.-Failed-sign-in-attempts-on-a-device-affected-by-XorDdos-768x188.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 2. Failed sign-in attempts on a device affected by XorDdos<\/figcaption><\/figure>\n<p>Our analysis determined two of XorDdos\u2019 methods for initial access. The first method involves copying a malicious ELF file to temporary file storage <em>\/dev\/shm <\/em>and then running it. Files written at <em>\/dev\/shm<\/em> are deleted during system restart, thus concealing the source of infection during forensic analysis.<\/p>\n<p>The second method involves running a bash script that performs the following activities via the command line:<\/p>\n<ol type=\"1\">\n<li>Iterates the following folders to find a writable directory:\n<ul>\n<li>\/<em>bin<\/em><\/li>\n<li>\/<em>home<\/em><\/li>\n<li>\/<em>root<\/em><\/li>\n<li>\/<em>tmp<\/em><\/li>\n<li>\/<em>usr<\/em><\/li>\n<li>\/<em>etc<\/em><\/li>\n<\/ul>\n<\/li>\n<li>If a writable directory is found, changes the working directory to the discovered writable directory.<\/li>\n<li>Uses the <em>curl<\/em> command to download the ELF file payload from the remote location <em>hxxp:\/\/Ipv4PII_777789ffaa5b68638cdaea8ecfa10b24b326ed7d\/1[.]txt<\/em> and saves the file as &nbsp;<em>ygljglkjgfg0.<\/em><\/li>\n<li>Changes the file mode to \u201cexecutable\u201d.<\/li>\n<li>Runs the ELF file payload.<\/li>\n<li>Moves and renames the Wget binary to evade rule-based detections triggered by malicious usage of the Wget binary. In this case, it renames the Wget binary to <em>good<\/em> and moves the file to the following locations:\n<ul>\n<li><em>mv \/usr\/bin\/wget \/usr\/bin\/good<\/em><\/li>\n<li><em>mv \/bin\/wget \/bin\/good<\/em><\/li>\n<\/ul>\n<\/li>\n<li>Attempts to download the ELF file payload for a second time, now only using the file <em>good<\/em> and not the Wget binary.<\/li>\n<li>After running the ELF file, uses an anti-forensic technique that hides its past activity by overwriting the content of the following sensitive files with a newline character:<\/li>\n<\/ol>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td><strong>Sensitive File<\/strong><strong><\/strong><\/td>\n<td><strong>Description<\/strong><strong><\/strong><\/td>\n<\/tr>\n<tr>\n<td>\/root\/.bash_history<\/td>\n<td>Contains the commands that were run earlier<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/wtmp<\/td>\n<td>Contains login related record for users<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/btmp<\/td>\n<td>Contains record of failed login attempt<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/lastlog<\/td>\n<td>Contains the recent login information for users<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/secure<\/td>\n<td>Contains information related to security such as logs for authentication failure, sudo logins, and authorization privileges<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/boot.log<\/td>\n<td>Contains information related to system boot and message logged via system startup processes<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/cron<\/td>\n<td>Contains information related to cron job launch, success and failure error logs<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/dmesg<\/td>\n<td>Contains information related to kernel ring buffer messages, hardware devices, drivers, etc.<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/firewalld<\/td>\n<td>Contains logs related to firewall activities<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/maillog<\/td>\n<td>Contains information related to a mail server running on the system<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/messages<\/td>\n<td>Contains generic system activity messages<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/spooler<\/td>\n<td>Contains messages from usenet<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/syslog<\/td>\n<td>Contains generic system activity messages<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/yum.log<\/td>\n<td>Contains the package logs related to installationremoveupdate activities done via yum utility<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"844\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-3.-Remote-bash-script-command-used-for-initial-access.png\" alt=\"Figure 3 displays the remote bash script command used for initial access\" class=\"wp-image-114501\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-3.-Remote-bash-script-command-used-for-initial-access.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-3.-Remote-bash-script-command-used-for-initial-access-284x300.png 284w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-3.-Remote-bash-script-command-used-for-initial-access-768x810.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 3. Remote bash script command used for initial access<\/figcaption><\/figure>\n<p>Whichever initial access method is used, the result is the same: the running of a malicious ELF file, which is the XorDdos malware. In the next section, we do a deep dive into the XorDdos payload.<\/p>\n<h2 id=\"XorDdos_payload\">XorDdos payload analysis<\/h2>\n<p>The XorDdos payload we analyzed for this research is a 32-bit ELF file that was not stripped, meaning it contained debug symbols that detailed the malware\u2019s dedicated code for each of its activities. The inclusion of debug symbols makes it easier to debug and reverse engineer non-stripped binaries, as compared to stripped binaries that discard these symbols. In this case, the non-stripped binary includes the following source-code file names associated with the symbol table entries as part of the <em>.strtab<\/em> section in the ELF file:<\/p>\n<ul>\n<li>crtstuff.c<\/li>\n<li>autorun.c<\/li>\n<li>crc32.c<\/li>\n<li>encrypt.c<\/li>\n<li>execpacket.c<\/li>\n<li>buildnet.c<\/li>\n<li>hide.c<\/li>\n<li>http.c<\/li>\n<li>kill.c<\/li>\n<li>main.c<\/li>\n<li>proc.c<\/li>\n<li>socket.c<\/li>\n<li>tcp.c<\/li>\n<li>thread.c<\/li>\n<li>findip.c<\/li>\n<li>dns.c<\/li>\n<\/ul>\n<p>The above list of source-code file names indicate that the binary is programmed in C\/C++ and that its code is modular.<\/p>\n<h3 id=\"Detection_evasion\"><em>Detection evasion capabilities<\/em><\/h3>\n<p>XorDdos contains modules with specific functionalities to evade detection, as detailed below. <strong><\/strong><\/p>\n<p><strong>Daemon processes<\/strong><\/p>\n<p>A daemon process is a process that runs in the background rather than under the control of users and detaches itself from the controlling terminal, terminating only when the system is shut down. Similar to some Linux malware families, the XorDdos trojan uses daemon processes, as detailed below, to break process tree-based analysis:<\/p>\n<ol type=\"1\">\n<li>The malware calls the subroutine <em>daemon(__nochdir, __noclose) <\/em>to set itself as a background daemon process<em>,<\/em> which internally calls<em> fork()<\/em> and <em>setsid()<\/em>. The <em>fork()<\/em> API creates a new child process with the same process group-id as the calling process.<\/li>\n<li>After the successful call to the <em>fork()<\/em> API, the parent stops itself by returning \u201c<em>EXIT_SUCCESS<\/em> (0)\u201d. The purpose is to ensure that the child process is not a group process leader, which is a prerequisite for the <em>setsid()<\/em> API call to be successful. It then calls <em>setsid()<\/em> to detach itself from the controlling terminal.<\/li>\n<li>The daemon subroutine also has a provision to change the directory to the root directory (&#8220;<strong>\/<\/strong>&#8220;) if the first parameter <em>__nochdir<\/em> is called with a value equal to \u201c0\u201d. One reason for the daemon process to change the directory to the root partition (&#8220;<strong>\/<\/strong>&#8220;)is because running the process from the mounted file system prevents unmounting unless the process is stopped. &nbsp;<\/li>\n<li>It passes the second parameter <em>__noclose <\/em>as \u201c0\u201d to redirect standard input, standard output, and standard error to <em>\/dev\/null<\/em>. It does this by calling <em>dup2<\/em> on the file descriptor for <em>\/dev\/null<\/em>.<\/li>\n<li>The malware calls multiple signal APIs to ignore a possible signal from the controlling terminal and detach the current process from the standard stream and HangUp signals (SIGHUP) when the terminal session is disconnected. Performing this evasive signal suppression helps stop the effects of standard libraries trying to write to standard output or standard error, or trying to read from standard input, which could stop the malware\u2019s child process. The API <em>signal()<\/em> sets the disposition of the signal signum to the handler, which is either <em>SIG_IGN<\/em>, <em>SIG_DFL<\/em>, or the address of a programmer-defined signal handler. In this case, the second parameter is set to \u201cSIG_IGN=1\u201d, which ignores the signal corresponding to signum.<\/li>\n<\/ol>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"242\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-4.-Ignore-signals-associated-with-the-terminal-related-operations.png\" alt=\"Figure 4 displays how signals associated with terminal-related operations are ignored.\" class=\"wp-image-114504\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-4.-Ignore-signals-associated-with-the-terminal-related-operations.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-4.-Ignore-signals-associated-with-the-terminal-related-operations-300x91.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-4.-Ignore-signals-associated-with-the-terminal-related-operations-768x232.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 4. Ignore signals associated with the terminal-related operations<\/figcaption><\/figure>\n<p><strong>XOR-based encryption<\/strong><\/p>\n<p>As its name suggests, XorDdos uses XOR-based encryption to obfuscate data. It calls the <em>dec_conf<\/em> function to decode encoded strings using the XOR key \u201cBB2FA36AAA9541F0\u201d. The table below shows the decoded values of the obfuscated data used across the malware\u2019s various modules to conduct its activities.<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td><strong>Encrypted strings<\/strong><\/td>\n<td><strong>Decoded value<\/strong><\/td>\n<\/tr>\n<tr>\n<td>m7A4nQ_\/nA<\/td>\n<td>\/usr\/bin\/<\/td>\n<\/tr>\n<tr>\n<td>m [(n3<\/td>\n<td>\/bin\/<\/td>\n<\/tr>\n<tr>\n<td>m6_6n3<\/td>\n<td>\/tmp\/<\/td>\n<\/tr>\n<tr>\n<td>m4S4nAC\/n&amp;ZVx1aA\/TB<\/td>\n<td>\/var\/run\/gcc.pid<\/td>\n<\/tr>\n<tr>\n<td>m.[$n__#4%Cx1aB]0<\/td>\n<td>\/lib\/libudev.so<\/td>\n<\/tr>\n<tr>\n<td>m.[$n3<\/td>\n<td>\/lib\/<\/td>\n<\/tr>\n<tr>\n<td>m4S4nAC\/nA<\/td>\n<td>\/var\/run\/<\/td>\n<\/tr>\n<tr>\n<td>!#Ff3VE.-7x17V[_<\/td>\n<td>cat resolv.conf<\/td>\n<\/tr>\n<tr>\n<td>&lt;Encrypted_Remote_URL&gt;<\/td>\n<td>hxxp:\/\/aa.hostasa[.]org\/config.rar<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p><strong>Process name spoofing<\/strong><\/p>\n<p>When a process is launched, arguments are provided to its main function as null-terminated strings, where the first argument is always the process image path. To spoof its process name, XorDdos zeroes out all argument buffers while running and overrides its first argument buffer containing the image path with a fake command line, such as <em>cat resolv.conf<\/em>.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"577\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/5-test_ccexpress.png\" alt=\"Figure 5 displays how process name spoofing is achieved by modifying memory associated with argument vectors.\" class=\"wp-image-114519\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/5-test_ccexpress.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/5-test_ccexpress-300x216.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/5-test_ccexpress-768x554.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 5. Process name spoofing achieved by modifying memory associated with argument vectors.<\/figcaption><\/figure>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"129\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-6.-Output-of-the-\u2018ps-aef-contains-an-entry-for-cat-resolv.conf_.png\" alt=\"Figure 6 displays the output of the 'ps -aef' containing an entry for &quot;cat resolv.conf&quot;. \" class=\"wp-image-114387\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-6.-Output-of-the-\u2018ps-aef-contains-an-entry-for-cat-resolv.conf_.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-6.-Output-of-the-\u2018ps-aef-contains-an-entry-for-cat-resolv.conf_-300x48.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-6.-Output-of-the-\u2018ps-aef-contains-an-entry-for-cat-resolv.conf_-768x124.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 6. Output of the \u2018ps -aef\u2019 contains an entry for \u201ccat resolv.conf\u201d<\/figcaption><\/figure>\n<p><strong>Kernel rootkit<\/strong><\/p>\n<p>Some XorDdos samples install a kernel rootkit. A rootkit is a kernel module that hides the presence of malicious code by modifying operating systems data structures. The XorDdos kernel rootkit generally has following capabilities:<\/p>\n<ul>\n<li>Provide root access<\/li>\n<li>Hide the kernel module<\/li>\n<li>Hide the malware\u2019s processes<\/li>\n<li>Hide the malware\u2019s network connections and ports<\/li>\n<\/ul>\n<p>Based on the debug symbols found in the rootkit, it\u2019s likely that XorDdos\u2019 rootkit code was inspired by an open-source project called&nbsp;<a href=\"https:\/\/github.com\/jermeyyy\/rooty\">rooty<\/a>. The following table describes the symbols found in the rootkit and their corresponding functionalities:<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td><strong>Function&nbsp;name&nbsp;&nbsp;<\/strong><\/td>\n<td><strong>Description&nbsp;&nbsp;<\/strong><\/td>\n<\/tr>\n<tr>\n<td>give_root&nbsp;&nbsp;<\/td>\n<td>Provides&nbsp;a&nbsp;root&nbsp;privilege&nbsp;by&nbsp;setting&nbsp;a&nbsp;new&nbsp;set&nbsp;of&nbsp;credentials&nbsp;and assigning its UID, GID to &#8220;0&#8221;<\/td>\n<\/tr>\n<tr>\n<td>module_hide<\/td>\n<td>Hides the rootkit kernel module<\/td>\n<\/tr>\n<tr>\n<td>module_show<\/td>\n<td>Unhides the rootkit kernel module<\/td>\n<\/tr>\n<tr>\n<td>get_udp_seq_show<\/td>\n<td>Hides the UDP4 connection by hooking <em>\/proc\/net\/udp<\/em>Hides the UDP6 connection by hooking&nbsp;<em>\/proc\/net\/udp6<\/em><\/td>\n<\/tr>\n<tr>\n<td>get_tcp_seq_show<\/td>\n<td>Hides the TCP4 connection by hooking <em>\/proc\/net\/tcp<\/em>Hides the TCP6 connection by hooking&nbsp;<em>\/proc\/net\/tcp6<\/em><\/td>\n<\/tr>\n<tr>\n<td>hide_udp4_port<\/td>\n<td>Adds a provided port to a list of hidden UDP4 ports<\/td>\n<\/tr>\n<tr>\n<td>unhide_udp4_port<\/td>\n<td>Deletes a provided port from a list of hidden UDP4 ports<\/td>\n<\/tr>\n<tr>\n<td>hide_udp6_port<\/td>\n<td>Adds a provided port to a list of hidden UDP6 ports<\/td>\n<\/tr>\n<tr>\n<td>unhide_udp6_port<\/td>\n<td>Deletes a provided port from a list of hidden UDP6 ports<\/td>\n<\/tr>\n<tr>\n<td>hide_tcp4_port<\/td>\n<td>Adds a provided port to a list of hidden TCP4 ports<\/td>\n<\/tr>\n<tr>\n<td>unhide_tcp4_port<\/td>\n<td>Deletes a provided port from a list of hidden TCP4 ports<\/td>\n<\/tr>\n<tr>\n<td>hide_tcp6_port<\/td>\n<td>Adds a provided port to a list of hidden TCP6 ports<\/td>\n<\/tr>\n<tr>\n<td>unhide_tcp6_port<\/td>\n<td>Deletes a provided port from a list of hidden TCP6 ports<\/td>\n<\/tr>\n<tr>\n<td>unhide_allz<\/td>\n<td>Iterates list of all hidden ports and deletes all entries<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p><strong>Process and port hiding<\/strong><\/p>\n<p>The malware tries to hide its processes and ports using its kernel rootkit component. Hiding a process assists the malware in evading rule-based detections.<\/p>\n<p>The <em>\/proc<\/em> filesystem contains information related to all running processes. A user-mode process can get any process specific information by reading the <em>\/proc<\/em> directory that contains the subdirectory for each running process on the system, such as:<\/p>\n<ul>\n<li><em>\/proc\/7728<\/em> &#8211; Contains process-id (PID) 7728-related information<\/li>\n<li><em>\/proc\/698<\/em> &#8211; Contains PID 698-related information<\/li>\n<\/ul>\n<p>Running the <em>strace -e open ps<\/em> command checks the traces of the open call on <em>\/proc\/$pid<\/em> to fetch information on running processes as part of the <em>ps<\/em> command.<\/p>\n<pre class=\"wp-block-preformatted\">&gt; strace -e open ps open(\u201c\/proc\/3922\/status\u201d, O_RDONLY)     = 6 open(\u201c\/proc\/4324\/stat\u201d, O_RDONLY)       = 6 open(\u201c\/proc\/4324\/status\u201d, O_RDONLY)     = 6 open(\u201c\/proc\/5559\/stat\u201d, O_RDONLY)       = 6 open(\u201c\/proc\/5559\/status\u201d, O_RDONLY)     = 6 open(\u201c\/proc\/5960\/stat\u201d, O_RDONLY)       = 6 open(\u201c\/proc\/5960\/status\u201d, O_RDONLY)     = 6 open(\u201c\/proc\/5978\/stat\u201d, O_RDONLY)       = 6 open(\u201c\/proc\/5978\/status\u201d, O_RDONLY)     = 6 <\/pre>\n<p>If the malware hides the <em>$pid<\/em> specific directory, it can conceal fetching the corresponding process from a user mode.<\/p>\n<p>In this case, the malware has a provision for communicating with its rootkit component <em>\/proc\/rs_dev<\/em> by sending input and output control (IOCTL) calls with additional information to take appropriate action. IOCTL is one way to communicate between the user-mode service and kernel device driver. The malware uses the number \u201c0x9748712\u201d to uniquely identify its IOCTL calls from other IOCTL calls in the system.<\/p>\n<p>Along with this number, it also passes an integer array. The first entry in the array corresponds to the command, and the second entry stores the value to act on, such as <em>$pid<\/em>.<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>Usage<\/strong><\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>Check if its rootkit driver is present<\/td>\n<\/tr>\n<tr>\n<td>1, 2<\/td>\n<td>Hide or unhide &lt;PID&gt;<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>Hide &lt;port&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3 id=\"Persistence_mechanisms\"><em>Persistence mechanisms<\/em><\/h3>\n<p>XorDdos uses various persistence mechanisms to support different Linux distributions when automatically launching upon system startup, as detailed below.<\/p>\n<p><strong>Init script<\/strong><\/p>\n<p>The malware drops an <em>init<\/em> script at the location <em>\/etc\/init.d<\/em>. <em>Init<\/em> scripts are startup scripts used to run any program when the system starts up. They follow the Linux Standard Base (LSB)-style header section to include default <em>runlevels<\/em>, descriptions, and dependencies.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"490\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-7.-Content-of-the-init-script-dropped-at-the-location-etc-init.d-HFLgGwYfSC.elf_.png\" alt=\"Figure 7 displays the content of the init script dropped at the location \/etc\/init.d\/HFLgGwYfSC.elf. \" class=\"wp-image-114390\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-7.-Content-of-the-init-script-dropped-at-the-location-etc-init.d-HFLgGwYfSC.elf_.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-7.-Content-of-the-init-script-dropped-at-the-location-etc-init.d-HFLgGwYfSC.elf_-300x184.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-7.-Content-of-the-init-script-dropped-at-the-location-etc-init.d-HFLgGwYfSC.elf_-768x470.png 768w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-7.-Content-of-the-init-script-dropped-at-the-location-etc-init.d-HFLgGwYfSC.elf_-392x240.png 392w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 7. Content of the init script dropped at the location <em>\/etc\/init.d\/HFLgGwYfSC.elf<\/em><\/figcaption><\/figure>\n<p><strong>Cron script<\/strong><\/p>\n<p>The malware creates a <em>cron<\/em> script at the location <em>\/<\/em><em>etc\/cron.hourly\/gcc.sh<\/em>.The <em>cron<\/em> script passes parameters with the following content:<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"114\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-8.-Content-of-the-gcc.sh-script.png\" alt=\"Figure 8 displays the contents of the gcc.sh script. \" class=\"wp-image-114393\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-8.-Content-of-the-gcc.sh-script.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-8.-Content-of-the-gcc.sh-script-300x43.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-8.-Content-of-the-gcc.sh-script-768x109.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 8. Content of the <em>gcc.sh<\/em> script<\/figcaption><\/figure>\n<p>It then creates a <em>\/etc\/crontab<\/em> file to run <em>\/etc\/cron.hourly\/gcc.sh <\/em>every three minutes:<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"69\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-9.-System-command-to-delete-the-etc-cron.hourly-gcc.sh-entry-from-the-etc-crontab-file-and-add-a-new-entry.png\" alt=\"Figure 9 displays the system command to delete the \/etc\/cron.hourly\/gcc.sh entry from \/etc\/crontab file and add a new entry. It reads &quot;system(&quot;sed -i '\/\\\/etc\\\/cron.hourly\\\/gcc.sh\/d' \/etc\/crontab &amp;&amp; echo '*\/3 * * * * root \/etc\/cron.hourly\/gcc.sh' &gt;&gt; \/etc\/crontab&quot;);\" class=\"wp-image-114396\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-9.-System-command-to-delete-the-etc-cron.hourly-gcc.sh-entry-from-the-etc-crontab-file-and-add-a-new-entry.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-9.-System-command-to-delete-the-etc-cron.hourly-gcc.sh-entry-from-the-etc-crontab-file-and-add-a-new-entry-300x26.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-9.-System-command-to-delete-the-etc-cron.hourly-gcc.sh-entry-from-the-etc-crontab-file-and-add-a-new-entry-768x66.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 9. System command to delete the <em>\/etc\/cron.hourly\/gcc.sh<\/em> entry from the <em>\/etc\/crontab<\/em> file and add a new entry<\/figcaption><\/figure>\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-10.-The-content-of-the-file-etc-crontab.png\" alt=\"Figure 10 reads :*\/3 * * * * root \/etc\/cron.hourly\/gcc.sh&quot;\" class=\"wp-image-114399\" width=\"800\" height=\"43\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-10.-The-content-of-the-file-etc-crontab.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-10.-The-content-of-the-file-etc-crontab-300x16.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-10.-The-content-of-the-file-etc-crontab-768x41.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 10. The content of the file <em>\/etc\/crontab<\/em><\/figcaption><\/figure>\n<p><strong>System V runlevel<\/strong><\/p>\n<p>A <em>runlevel<\/em> is a mode of <em>init<\/em> and the system that specifies what system services are operating for Unix System V-Style operating systems. <em>Runlevels<\/em> contain a value, typically numbered zero through six, which each designate a different system configuration and allows access to a different combination of processes. Some system administrators set a system\u2019s default <em>runlevel<\/em> according to their needs or use <em>runlevels<\/em> to identify which subsystems are working, such as whether the network is operational. The <em>\/etc\/rc&lt;run_level&gt; <\/em>directory contains symbolic links (<em>symlinks<\/em>), which are soft links that point to the original file. These <em>symlinks<\/em> point to the scripts that should run at the specified <em>runlevel<\/em>.<\/p>\n<p>The malware creates a <em>symlink<\/em> for the <em>init<\/em> script dropped at the location <em>\/etc\/init.d\/&lt;base_file_name&gt; <\/em>with the directories associated with <em>runlevels<\/em> 1 through 5 at \/<em>etc\/rc&lt;run_level&gt;.d\/S90&lt;base_file_name&gt;<\/em> and <em>\/etc\/rc.d\/rc&lt;run_level&gt;.d\/S90&lt;base_file_name&gt;.<\/em><\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"326\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-11.-Installation-of-rc.d-directorys-symlink-scripts-with-etc-init.d-base_file_name.png\" alt=\"Figure 11 displays the installation of rc.d directory's symlink scripts with \/etc\/init.d\/<base_file_name&gt;.\" class=\"wp-image-114402\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-11.-Installation-of-rc.d-directorys-symlink-scripts-with-etc-init.d-base_file_name.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-11.-Installation-of-rc.d-directorys-symlink-scripts-with-etc-init.d-base_file_name-300x122.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-11.-Installation-of-rc.d-directorys-symlink-scripts-with-etc-init.d-base_file_name-768x313.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 11. Installation of <em>rc.d<\/em> directory\u2019s symlink scripts with <em>\/etc\/init.d\/&lt;base_file_name&gt;<\/em><\/figcaption><\/figure>\n<p><strong>Auto-start services<\/strong><\/p>\n<p>The malware runs a command to install startup services that automatically run XorDdos at boot. The malware\u2019s <em>LinuxExec_Argv2<\/em> subroutine runs the system API with the provided arguments.<\/p>\n<p>The commands <em>chkconfig \u2013add &lt;service_name&gt;<\/em> and <em>update-rc.d<\/em> then add a service that starts the daemon process at boot.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"102\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-12.-chkconfig-and-update-rc.d-commands-install-the-startup-service.png\" alt=\"Figure 12 displays chkconfig and update-rc.d commands installing the startup service\" class=\"wp-image-114405\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-12.-chkconfig-and-update-rc.d-commands-install-the-startup-service.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-12.-chkconfig-and-update-rc.d-commands-install-the-startup-service-300x38.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-12.-chkconfig-and-update-rc.d-commands-install-the-startup-service-768x98.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 12. <em>chkconfig<\/em> and <em>update-rc.d<\/em> commands install the startup service<\/figcaption><\/figure>\n<h3 id=\"Argument-based_code-flow\"><em>Argument-based code-flow<\/em><\/h3>\n<p>XorDdos has specific code paths corresponding to the number of arguments provided to the program. This flexibility makes its operation more robust and stealthy. The malware first runs without any argument and then later runs another instance with different arguments, such as PIDs and fake commands, to perform capabilities like clean-up, spoofing, and persistence.<\/p>\n<p>Before handling the argument-based control, it calls the <em>readlink<\/em> API with the first parameter as <em>\/proc\/self\/exe<\/em> to fetch its full process path. The full path is used later to create auto-start service entries and read the file\u2019s content.<\/p>\n<p>In this section, we will cover the main tasks carried out as part of the different arguments provided:<\/p>\n<p><strong>1: Standard code path without any provided arguments<\/strong><\/p>\n<p>This code path depicts the malware\u2019s standard workflow, which is also the typical workflow where XorDdos runs as part of the entries created in system start-up locations.<\/p>\n<p>The malware first checks whether it\u2019s running from the locations <em>\/usr\/bin\/<\/em>, <em>\/bin\/<\/em>, or <em>\/tmp\/<\/em>. If it\u2019s not running from these locations, then it creates and copies itself using a 10-character string name on those locations, as well as <em>\/lib\/<\/em> and <em>\/var\/run\/<\/em>.<\/p>\n<p>It also creates a copy of itself at the location <em>\/lib\/libudev.so<\/em>. To evade hash-based malicious file lookup, it performs the following steps, which modify the file hash to make every file unique:<\/p>\n<ul>\n<li>Opens the file for writing only<\/li>\n<li>Calls <em>lseek (fd, 0, SEEK_END)<\/em> to point at the last position in the file<\/li>\n<li>Creates a random 10-character string<\/li>\n<li>Writes the string at the end of the file with an additional null byte<\/li>\n<\/ul>\n<p>After modifying the file, it runs the binary, performs a double<em> fork()<\/em>, and deletes its file from the disk.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"163\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-13.-The-end-of-the-malware-file-contains-two-random-strings-wieegnexuk-and-yybrdajydg-indicating-that-the-original-malware-binary-was-modified-twice.png\" alt=\"Figure 13 displays the end of the malware file containing two random strings, \u2018wieegnexuk\u2019 and \u2018yybrdajydg,\u2019 indicating that the original malware binary was modified twice\" class=\"wp-image-114462\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-13.-The-end-of-the-malware-file-contains-two-random-strings-wieegnexuk-and-yybrdajydg-indicating-that-the-original-malware-binary-was-modified-twice.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-13.-The-end-of-the-malware-file-contains-two-random-strings-wieegnexuk-and-yybrdajydg-indicating-that-the-original-malware-binary-was-modified-twice-300x61.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-13.-The-end-of-the-malware-file-contains-two-random-strings-wieegnexuk-and-yybrdajydg-indicating-that-the-original-malware-binary-was-modified-twice-768x156.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 13. The end of the malware file contains two random strings, \u2018wieegnexuk\u2019 and \u2018yybrdajydg,\u2019 indicating that the original malware binary was modified twice<\/figcaption><\/figure>\n<p><strong>2: Clean-up code path<\/strong><\/p>\n<p>In this code path, the malware runs with another argument provided as the PID, for example:<\/p>\n<ul>\n<li><em>\/usr\/bin\/jwvwvxoupv 4849<\/em><\/li>\n<\/ul>\n<p>Using the above example, the malware shares the 64-byte size memory segment with the IPC key \u201c0xDA718716\u201d to check for another malware process provided as an argument. If not found, it runs its own binary without any argument and calls the <em>fork()<\/em> API twice to make sure the grandchild process has no parent. This results in the grandchild process being adopted by the <em>init<\/em> process, which disconnects it from the process tree and acts as an anti-forensic technique.<\/p>\n<p>Additionally, it performs the following tasks on a provided <em>$pid<\/em>:<\/p>\n<ul>\n<li>Fetches the process file name corresponding to the provided <em>$pid<\/em><\/li>\n<li>Deletes the file for the provided <em>$pid<\/em><\/li>\n<li>Deletes the installed <em>init<\/em> services:\n<ul>\n<li>Deletes <em>\/etc\/init.d\/&lt;file_name&gt;<\/em><\/li>\n<\/ul>\n<ul>\n<li>For <em>runlevels<\/em> 1-5, unlinks and deletes <em>\/etc\/rc&lt;runlevel&gt;.d\/S90&lt;file_name&gt;<\/em><\/li>\n<\/ul>\n<ul>\n<li>Performs the command <em>chkconfig \u2013del &lt;file_name&gt;<\/em><\/li>\n<\/ul>\n<ul>\n<li>Performs the command <em>update-rc.d &lt;file_name&gt; remove<\/em><\/li>\n<\/ul>\n<\/li>\n<li>Ends the process that was provided as an argument.<\/li>\n<\/ul>\n<p><strong>3: Process name spoofing code path<\/strong><\/p>\n<p>The malware spawns new dropped binaries with two additional arguments: a fake command line and its PIDs, for example:<\/p>\n<ul>\n<li><em>\/usr\/bin\/jwvwvxoupv \u201ccat resolv.conf\u201d 4849<\/em><\/li>\n<li><em>\/usr\/bin\/jwvwvxoupv gnome-terminal 4849<\/em><\/li>\n<li><em>\/usr\/bin\/jwvwvxoupv top 4849<\/em><\/li>\n<li><em>\/usr\/bin\/jwvwvxoupv pwd 4849<\/em><\/li>\n<li><em>\/usr\/bin\/kagbjahdic id 4849<\/em><\/li>\n<\/ul>\n<p>The fake commands can include:<\/p>\n<ul>\n<li><em>cat resolv.conf<\/em><\/li>\n<li><em>netstat -an<\/em><\/li>\n<li><em>bash<\/em><\/li>\n<li><em>whoami<\/em><\/li>\n<li><em>id<\/em><\/li>\n<li><em>cd \/etc<\/em><\/li>\n<li><em>ifconfig eth0<\/em><\/li>\n<li><em>ifconfig<\/em><\/li>\n<li><em>echo \u201cfind\u201d<\/em><\/li>\n<li><em>uptime<\/em><\/li>\n<li><em>sh<\/em><\/li>\n<li><em>top<\/em><\/li>\n<li><em>gnome-terminal<\/em><\/li>\n<li><em>su<\/em><\/li>\n<li><em>netstat -antop<\/em><\/li>\n<li><em>grep \u201cA\u201d<\/em><\/li>\n<li><em>who<\/em><\/li>\n<li><em>ls -la<\/em><\/li>\n<li><em>pwd<\/em><\/li>\n<li><em>route -n<\/em><\/li>\n<li><em>ps -ef<\/em><\/li>\n<li><em>ls<\/em><\/li>\n<li><em>sleep 1<\/em><em><\/em><\/li>\n<\/ul>\n<p>In this code path, the malware uses process name spoofing to hide from the process tree by modifying its fake command line at runtime. It then hides its process by calling <em>HidePidPort<\/em> with command \u201c1\u201d and reads the content of the file on disk related to the current process.<\/p>\n<p>It then enters a five-second loop to perform the following checks:<\/p>\n<ul>\n<li>Fetches the file name specific to the <em>$pid<\/em> provided as part of the third argument by calling the <em>readlink<\/em> API on <em>\/proc\/$pid\/exe<\/em>.<\/li>\n<li>If the <em>readlink<\/em> call fails, that likely indicates that the file on disk doesn\u2019t exist. In this case, it:\n<ul>\n<li>Intends to delete all service-related entries for the <em>$pid<\/em> but fails. This appears to be due to a code flaw that allows a zeroed-out buffer to be passed as a service name when the buffer is supposed to be filled from a successful <em>readlink<\/em> API call.<\/li>\n<\/ul>\n<ul>\n<li>Creates directories similar to the standard code path scenario.<\/li>\n<\/ul>\n<ul>\n<li>Calls the <em>stat<\/em> API for the file <em>\/lib\/libudev.so<\/em>. If the <em>stat<\/em> API returns a non-zero value, then it attempts to copy the content of the current process\u2019s image-file fetched earlier to the following locations with a random name:\n<ul>\n<li><em>\/usr\/bin\/<\/em><\/li>\n<\/ul>\n<ul>\n<li><em>\/bin\/<\/em><\/li>\n<\/ul>\n<ul>\n<li><em>\/tmp\/<\/em> &nbsp;&nbsp;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>Copies the <em>\/lib\/libudev.so<\/em> file to the same three directories listed above if the <em>stat<\/em> API call is successful on <em>\/lib\/libudev.so<\/em>.<\/li>\n<\/ul>\n<ul>\n<li>Changes the hash of the written or copied file and then runs it without passing any parameters.<\/li>\n<\/ul>\n<\/li>\n<li>If the <em>readlink<\/em> call is successful and returns the count of bytes copied, sleeps for one second and then loops for the remaining time out of five seconds.<\/li>\n<li>Unhides the current process and the <em>$pid<\/em> that was provided as part of the third argument.<\/li>\n<li>Deletes the on-disk file for the current process.<\/li>\n<\/ul>\n<p><strong>4: Known locations code path without any provided arguments<\/strong><\/p>\n<p>This code path is similar to the standard code path, with the main difference being that the malware runs from one of the following locations:<\/p>\n<ul>\n<li><em>\/usr\/bin\/<\/em><\/li>\n<li><em>\/bin\/<\/em><\/li>\n<li><em>\/tmp\/<\/em><\/li>\n<\/ul>\n<p>Once it runs from one of these locations, the malware calls the following functions to perform various tasks:<\/p>\n<ol type=\"1\">\n<li><em>InstallSYS<\/em><strong> <\/strong>\u2013 The name suggests that this function is a wrapper that should deploy a rootkit driver, but it only zeroes-out two local arrays.<\/li>\n<\/ol>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"194\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-14.-Dummy-InstallSYS-routine.png\" alt=\"Figure 14 displays a dummy InstallSYS routine that only zeros-out two local arrays. \" class=\"wp-image-114411\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-14.-Dummy-InstallSYS-routine.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-14.-Dummy-InstallSYS-routine-300x73.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-14.-Dummy-InstallSYS-routine-768x186.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 14. Dummy <em>InstallSYS <\/em>routine<\/figcaption><\/figure>\n<ol start=\"2\">\n<li><em>AddService<\/em> \u2013 Creates the persistent auto-start entries previously mentioned so that the malware runs when the system starts.<\/li>\n<li><em>HidePidPort<\/em> \u2013 Hides the malware\u2019s ports and processes.<\/li>\n<li><em>CheckLKM<\/em> \u2013 Checks whether the rootkit device is active or not. It uses a similar IOCTL call with the number \u201c0x9748712\u201d and command \u201c0\u201d to find if the rootkit is active. If the rootkit is active, it uses the owner value \u201c0xAD1473B8\u201d and group value \u201c0xAD1473B8\u201d to change the ownership of dropped files with the function <em>lchown(&lt;filename&gt;, 0xAD1473B8, 0xAD1473B8)<\/em>.<\/li>\n<li><em>decrypt_remotestr<\/em><strong> <\/strong>\u2013 Decodes remote URLs using the same XOR key, \u201cBB2FA36AAA9541F0\u201d, to decode <em>config.rar<\/em> and the other directories. After decoding the URLs, it adds them into a remote list, which is later used to communicate and fetch commands from the command and control (C2) server:\n<ul>\n<li>www[.]enoan2107[.]com:3306<\/li>\n<\/ul>\n<ul>\n<li>www[.]gzcfr5axf6[.]com:3306<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3 id=\"Malicious_activity\"><em>Malicious activity threads<\/em><\/h3>\n<p>After creating persistent entries, deleting evidence of its activities, and decoding <em>config.rar<\/em>, the malware initializes a cyclic&nbsp;redundancy check (CRC) table followed by an unnamed semaphore using the <em>sem_init<\/em> API. This semaphore is initialized with a<em>pshared<\/em> value set to \u201c0\u201d<em>, <\/em>making the resultant semaphore shared between all the threads. The semaphore is used to maintain concurrency between threads accessing a shared object, such as <em>kill_cfg<\/em> data.<\/p>\n<p>The malware then initializes three threads to perform malicious activities, such as stopping a process, creating a TCP connection, and retrieving <em>kill_cfg<\/em> data.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"221\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-15.-Semaphore-and-malicious-thread-initialization.png\" alt=\"Figure 15 displays the semaphore and malicious thread initialization\" class=\"wp-image-114414\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-15.-Semaphore-and-malicious-thread-initialization.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-15.-Semaphore-and-malicious-thread-initialization-300x83.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-15.-Semaphore-and-malicious-thread-initialization-768x212.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 15. Semaphore and malicious thread initialization<\/figcaption><\/figure>\n<p><strong>&nbsp;<em>kill_process<\/em><\/strong><\/p>\n<p>The <em>kill_process<\/em> thread performs the following tasks:<\/p>\n<ul>\n<li>Decodes encrypted strings<\/li>\n<li>Fetches file stats for <em>\/var\/run\/gcc.pid<\/em> or, if none exist, then creates the file<\/li>\n<li>Fetches file stats for <em>\/lib\/libudev.so<\/em> or, if none exist, then creates the directory <em>\/lib<\/em> and creates a copy of itself at the location <em>\/lib\/libudev.so<\/em><\/li>\n<li>Fetches the on disk file information associated with the current process; if it fails, then exits the loop and stops the current process<\/li>\n<li>Reads the content from <em>kill_cfg<\/em> and performs the corresponding actions, like stopping the process or deleting files, based on the matching specified keys in the configuration file, such as:\n<ul>\n<li><em>md5=<\/em><\/li>\n<\/ul>\n<ul>\n<li><em>filename=<\/em><\/li>\n<\/ul>\n<ul>\n<li><em>rmfile=<\/em><\/li>\n<\/ul>\n<ul>\n<li><em>denyip=<\/em><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong><em>tcp_thread<\/em><\/strong><\/p>\n<p>The <em>tcp_thread<\/em> triggers the connection with the C2 server decoded earlier using <em>decrypt_remotestr()<\/em>. It performs the following tasks:<\/p>\n<ul>\n<li>Reads the content of the file <em>\/var\/run\/gcc.pid <\/em>to get a unique 32-byte magic string that identifies the device while connecting with the C2 server; if the file doesn\u2019t exist, then it creates the file and updates it with a random 32-byte string.<\/li>\n<li>Calculates the CRC header, including details of the device such as the magic string, OS release version, malware version, rootkit presence, memory stats, CPU information, and LAN speed.<\/li>\n<li>Encrypts the data and sends it to the C2 server.<\/li>\n<li>Waits to receive any of the following commands from the C2 server and then acts on the command using the <em>exec_packet<\/em> subroutine.<\/li>\n<\/ul>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>Job<\/strong><\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>Stop<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>Create a thread pool for launching DDoS attacks<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>Download file<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>Update file<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>Send system information to the C2 server<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>Get configuration file to stop processes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"346\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-16.-Collection-of-system-information.png\" alt=\"Figure 16 displays code for the collection of system information.\" class=\"wp-image-114417\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-16.-Collection-of-system-information.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-16.-Collection-of-system-information-300x130.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-16.-Collection-of-system-information-768x332.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 16. Collection of system information<\/figcaption><\/figure>\n<p><strong><em>daemon_get_killed_process<\/em><\/strong><\/p>\n<p>The <em>daemon_get_killed_process<\/em>thread downloads the <em>kill_cfg<\/em> data from the remote URL decoded earlier (hxxp:\/\/aa[.]hostasa[.]org\/config[.]rar) and decrypts it using the same XOR key previously mentioned. It then sleeps for 30 minutes.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"343\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-17.-daemon_get_killed_process-thread-function-fetches-and-decodes-the-kill_cfg-data-from-remote-URL.png\" alt=\"Figure 17 displays code for the daemon_get_killed_process thread function fetching and decoding the kill_cfg data from remote URL.\" class=\"wp-image-114420\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-17.-daemon_get_killed_process-thread-function-fetches-and-decodes-the-kill_cfg-data-from-remote-URL.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-17.-daemon_get_killed_process-thread-function-fetches-and-decodes-the-kill_cfg-data-from-remote-URL-300x129.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-17.-daemon_get_killed_process-thread-function-fetches-and-decodes-the-kill_cfg-data-from-remote-URL-768x329.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 17. <em>daemon_get_killed_process<\/em> thread function fetches and decodes the <em>kill_cfg<\/em> data from the remote URL<\/figcaption><\/figure>\n<h3 id=\"DDoS_attack\"><em>DDoS attack thread pool<\/em><\/h3>\n<p>The malware calls <em>sysconf(_SC_NPROCESSORS_CONF) <\/em>to fetch the number of processors in the device. It then creates threads with twice the number of processors found on the device.<\/p>\n<p>Invoking each thread internally calls the thread routine <em>threadwork<\/em>. Using the global variable \u201cg_stop\u201d and commands received from the C2 server, <em>threadwork<\/em> then sends crafted packets 65,535 times to perform a DDoS attack.<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td><strong>Command<\/strong><\/td>\n<td><strong>Function<\/strong><\/td>\n<td><strong>Job<\/strong><\/td>\n<\/tr>\n<tr>\n<td>0x4<\/td>\n<td>fix_syn &nbsp;<\/td>\n<td>SYN flood attack<\/td>\n<\/tr>\n<tr>\n<td>0x5<\/td>\n<td>fix_dns &nbsp;<\/td>\n<td>DNS attack<\/td>\n<\/tr>\n<tr>\n<td>0xA<\/td>\n<td>fix_ack &nbsp;<\/td>\n<td>ACK flood attack<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 id=\"Defending_against\">Defending against Linux platform threats<\/h2>\n<p>XorDdos\u2019 modular nature provides attackers with a versatile trojan capable of infecting a variety of Linux system architectures. Its SSH brute force attacks are a relatively simple yet effective technique for gaining root access over a number of potential targets.<\/p>\n<p>Adept at stealing sensitive data, installing a rootkit device, using various evasion and persistence mechanisms, and performing DDoS attacks, XorDdos enables adversaries to create potentially significant disruptions on target systems. Moreover, XorDdos may be used to bring in other dangerous threats or to provide a vector for follow-on activities.<\/p>\n<p>XorDdos and other threats targeting Linux devices emphasize how crucial it is to have security solutions with comprehensive capabilities and complete visibility spanning numerous distributions of Linux operating systems. <a href=\"https:\/\/www.microsoft.com\/security\/business\/threat-protection\/endpoint-defender?rtc=1\">Microsoft Defender for Endpoint<\/a> offers such visibility and protection to catch these emerging threats with its <a href=\"https:\/\/docs.microsoft.com\/microsoft-365\/security\/defender-endpoint\/next-generation-protection?view=o365-worldwide\">next-generation antimalware<\/a> and <a href=\"https:\/\/docs.microsoft.com\/microsoft-365\/security\/defender-endpoint\/overview-endpoint-detection-response?view=o365-worldwide\">endpoint detection and response (EDR)<\/a> capabilities. Leveraging threat intelligence from integrated threat data, including client and cloud heuristics, machine learning models, memory scanning, and behavioral monitoring, Microsoft Defender for Endpoint can detect and remediate XorDdos and its multi-stage, modular attacks. This includes detecting and protecting against its use of a malicious shell script for initial access, its drop-and-execution of binaries from a world-writable location, and any potential follow-on activities on endpoints.<\/p>\n<p>Defenders can apply the following mitigations to reduce the impact of this threat:<\/p>\n<ul>\n<li>Encourage the use of&nbsp;<a href=\"https:\/\/www.microsoft.com\/edge\">Microsoft Edge<\/a>\u2014available on Linux and various platforms\u2014or other web browsers that support&nbsp;<a href=\"https:\/\/docs.microsoft.com\/deployedge\/microsoft-edge-security-smartscreen\">Microsoft Defender SmartScreen<\/a>, which identifies and blocks malicious websites, including phishing sites, scam sites, and sites that contain exploits and host malware.<\/li>\n<li>Use&nbsp;<a href=\"https:\/\/docs.microsoft.com\/microsoft-365\/security\/defender-endpoint\/device-discovery?view=o365-worldwide\">device discovery<\/a>&nbsp;to find unmanaged Linux devices on your network and onboard them to Microsoft Defender for Endpoint.&nbsp;<\/li>\n<li>Turn on&nbsp;<a href=\"https:\/\/docs.microsoft.com\/microsoft-365\/security\/defender-endpoint\/configure-block-at-first-sight-microsoft-defender-antivirus?view=o365-worldwide\" target=\"_blank\" rel=\"noreferrer noopener\">cloud-delivered protection<\/a>&nbsp;in Microsoft Defender Antivirus or the equivalent for your antivirus product to use cloud-based machine learning protections that can block a huge majority of new and unknown variants.&nbsp;<\/li>\n<li>Run&nbsp;<a href=\"https:\/\/docs.microsoft.com\/microsoft-365\/security\/defender-endpoint\/edr-in-block-mode?view=o365-worldwide\" target=\"_blank\" rel=\"noreferrer noopener\">EDR in block mode<\/a>&nbsp;so that Microsoft Defender for Endpoint can block malicious artifacts, even when your non-Microsoft antivirus doesn\u2019t detect the threat or when Microsoft Defender Antivirus is running in passive mode.<\/li>\n<li>Enable&nbsp;<a href=\"https:\/\/docs.microsoft.com\/microsoft-365\/security\/defender-endpoint\/enable-network-protection?view=o365-worldwide\" target=\"_blank\" rel=\"noreferrer noopener\">network protection<\/a>&nbsp;to prevent applications or users from accessing malicious domains and other malicious content on the internet.&nbsp;<\/li>\n<li>Enable&nbsp;<a href=\"https:\/\/docs.microsoft.com\/microsoft-365\/security\/defender-endpoint\/automated-investigations?view=o365-worldwide\">investigation and remediation<\/a>&nbsp;in full automated mode to allow Microsoft Defender for Endpoint to take immediate action on alerts to resolve breaches, significantly reducing alert volume.&nbsp;<\/li>\n<\/ul>\n<p>As threats across all platforms continue to grow in number and sophistication, security solutions must be capable of providing advanced protection on a wide range of devices, regardless of the operating system in use. Organizations will continue to face threats from a variety of entry points across devices, so Microsoft continues to heavily invest in protecting all the major platforms and providing extensive capabilities that organizations needed to protect their networks and systems. <a><\/a><a><\/a><a><\/a><a><\/a><\/p>\n<h3 id=\"Detection_details\">Detection details<\/h3>\n<p>Microsoft Defender for Endpoint detects and blocks XorDdos components and behavior as the following malware:<\/p>\n<ul>\n<li>DoS:Linux\/Xorddos.A<\/li>\n<li>DoS:Linux\/Xorddos!rfn<\/li>\n<li>Trojan:Linux\/Xorddos<\/li>\n<li>Trojan:Linux\/Xorddos.AA<\/li>\n<li>Trojan:Linux\/Xorddos!rfn<\/li>\n<li>Behavior:Linux\/Xorddos.A<\/li>\n<\/ul>\n<p>When XorDdos is detected on a device, Microsoft 365 Defender raises an alert, which shows the complete attack chain, including the process tree, file information, user information, and prevention details.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"774\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-18.-Microsoft-365-Defender-alert-for-detection-of-XorDdos-malware_ccexpress.png\" alt=\"\" class=\"wp-image-114483\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-18.-Microsoft-365-Defender-alert-for-detection-of-XorDdos-malware_ccexpress.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-18.-Microsoft-365-Defender-alert-for-detection-of-XorDdos-malware_ccexpress-300x290.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-18.-Microsoft-365-Defender-alert-for-detection-of-XorDdos-malware_ccexpress-768x743.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 18. Microsoft 365 Defender alert for detection of XorDdos malware<\/figcaption><\/figure>\n<p>The timeline view displays all of the detection and prevention events associated with XorDdos, providing details such as the MITRE ATT&amp;CK techniques and tactics, remediation status, and event entities graph.<\/p>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"108\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-19.-Microsoft-365-Defender-timeline-displaying-that-HFLgGwYfSC.elf-was-run-from-a-world-writable-directory-and-the-remediation-of-dropped-binaries_ccexpress.png\" alt=\"\" class=\"wp-image-114486\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-19.-Microsoft-365-Defender-timeline-displaying-that-HFLgGwYfSC.elf-was-run-from-a-world-writable-directory-and-the-remediation-of-dropped-binaries_ccexpress.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-19.-Microsoft-365-Defender-timeline-displaying-that-HFLgGwYfSC.elf-was-run-from-a-world-writable-directory-and-the-remediation-of-dropped-binaries_ccexpress-300x41.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-19.-Microsoft-365-Defender-timeline-displaying-that-HFLgGwYfSC.elf-was-run-from-a-world-writable-directory-and-the-remediation-of-dropped-binaries_ccexpress-768x104.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 19. Microsoft 365 Defender timeline displaying that <em>HFLgGwYfSC.elf<\/em> was run from a world-writable directory and the remediation of dropped binaries<\/figcaption><\/figure>\n<p>Events with the following titles indicate threat activity related to XorDdos:<\/p>\n<ul>\n<li>The content of libudev.so was collected into libudev.so.6<\/li>\n<li>bash process performed System Information Discovery by invoking ifconfig<\/li>\n<li>gcc.sh was executed after being dropped by HFLgGwYfSC.elf<\/li>\n<li>A shell command was executed by crond<\/li>\n<li>SUID\/SGID process unix_chkpwd executed<\/li>\n<\/ul>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"800\" height=\"362\" src=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-20.-Microsoft-365-Defender-timeline-with-an-event-on-a-suspicious-shell-command-run-by-crond-after-it-was-dropped-from-HFLgGwYfSC.elf_ccexpress.png\" alt=\"\" class=\"wp-image-114492\" srcset=\"https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-20.-Microsoft-365-Defender-timeline-with-an-event-on-a-suspicious-shell-command-run-by-crond-after-it-was-dropped-from-HFLgGwYfSC.elf_ccexpress.png 800w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-20.-Microsoft-365-Defender-timeline-with-an-event-on-a-suspicious-shell-command-run-by-crond-after-it-was-dropped-from-HFLgGwYfSC.elf_ccexpress-300x136.png 300w, https:\/\/www.microsoft.com\/security\/blog\/uploads\/securityprod\/2022\/05\/Figure-20.-Microsoft-365-Defender-timeline-with-an-event-on-a-suspicious-shell-command-run-by-crond-after-it-was-dropped-from-HFLgGwYfSC.elf_ccexpress-768x348.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption>Figure 20. Microsoft 365 Defender timeline with an event on a suspicious shell command run by <em>crond <\/em>after it was dropped from <em>HFLgGwYfSC.elf<\/em><\/figcaption><\/figure>\n<h3 id=\"Hunting_queries\">Hunting queries<\/h3>\n<p>To locate malicious activity related to XorDdos activity, run the following advanced hunting queries in Microsoft 365 Defender or Microsoft Defender Security Center:<\/p>\n<p><strong>Failed sign-ins<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">DeviceLogonEvents | where InitiatingProcessFileName == \"sshd\"     and ActionType == \"LogonFailed\" | summarize count() by dayOfYear = datetime_part(\"dayOfYear\", Timestamp) | sort by dayOfYear  | render linechart <\/pre>\n<p><strong>Creation of the XorDdos-specific dropped files<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">DeviceFileEvents | extend FullPath=strcat(FolderPath, FileName) | where FullPath in (\"\/etc\/cron.hourly\/gcc.sh\", \"\/lib\/libudev.so.6\", \"\/lib\/libudev.so\", \"\/var\/run\/gcc.pid\") <\/pre>\n<p><strong>Command-line of malicious process<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">DeviceProcessEvents | where ProcessCommandLine contains \"cat resolv.conf\" <\/pre>\n<h2 id=\"Indicators\">Indicators<\/h2>\n<h3>File information<\/h3>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td>File name:<\/td>\n<td>HFLgGwYfSC.elf<\/td>\n<\/tr>\n<tr>\n<td>File size:<\/td>\n<td>611.22 KB (625889 bytes)<\/td>\n<\/tr>\n<tr>\n<td>Classification:<\/td>\n<td>DoS:Linux\/Xorddos.A<\/td>\n<\/tr>\n<tr>\n<td>MD5:<\/td>\n<td>2DC6225A9D104A950FB33A74DA262B93<\/td>\n<\/tr>\n<tr>\n<td>Sha1:<\/td>\n<td>F05194FB2B3978611B99CFBF5E5F1DD44CD5E04B<\/td>\n<\/tr>\n<tr>\n<td>Sha256:<\/td>\n<td>F2DF54EB827F3C733D481EBB167A5BC77C5AE39A6BDA7F340BB23B24DC9A4432<\/td>\n<\/tr>\n<tr>\n<td>File type:<\/td>\n<td>ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU\/Linux 2.6.9, not stripped<\/td>\n<\/tr>\n<tr>\n<td>First submission in VT:<\/td>\n<td>2022-01-25 05:32:10 UTC<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3>Dropped files<\/h3>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td><strong>Dropped file path<\/strong><\/td>\n<td><strong>File type<\/strong><\/td>\n<td><strong>SHA-256<\/strong><\/td>\n<\/tr>\n<tr>\n<td>\/etc\/init.d\/HFLgGwYfSC.elf<\/td>\n<td>Shell Script<\/td>\n<td>6E506F32C6FB7B5D342D1382989AB191C6F21C2D311251D8F623814F468952CF<\/td>\n<\/tr>\n<tr>\n<td>\/etc\/cron.hourly\/gcc.sh<\/td>\n<td>Shell Script<\/td>\n<td>CBB72E542E8F19240130FC9381C2351730D437D42926C6E68E056907C8456459<\/td>\n<\/tr>\n<tr>\n<td>\/lib\/libudev.so<\/td>\n<td>ELF<\/td>\n<td>F2DF54EB827F3C733D481EBB167A5BC77C5AE39A6BDA7F340BB23B24DC9A4432<\/td>\n<\/tr>\n<tr>\n<td>\/run\/gcc.pid<\/td>\n<td>Text<\/td>\n<td>932FEEF3AB6FCCB3502F900619B1F87E1CB44A7ADAB48F2C927ECDD67FF6830A<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/djtctpzfdq<\/td>\n<td>ELF<\/td>\n<td>53F062A93CF19AEAA2F8481B32118A31B658A126624ABB8A7D82237884F0A394<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/dmpyuitfoq<\/td>\n<td>ELF<\/td>\n<td>798577202477C0C233D4AF51C4D8FB2F574DDB3C9D1D90325D359A84CB1BD51C<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/fdinprytpq<\/td>\n<td>ELF<\/td>\n<td>2B4500987D50A24BA5C118F506F2507362D6B5C63C80B1984B4AE86641779FF3<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/jwvwvxoupv<\/td>\n<td>ELF<\/td>\n<td>359C41DA1CBAE573D2C99F7DA9EEB03DF135F018F6C660B4E44FBD2B4DDECD39<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/kagbjahdic<\/td>\n<td>ELF<\/td>\n<td>E6C7EEE304DFC29B19012EF6D31848C0B5BB07362691E4E9633C8581F1C2D65B<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/kkldnszwvq<\/td>\n<td>ELF<\/td>\n<td>EF0A4C12D98DC0AD4DB86AADD641389C7219F57F15642ED35B4443DAF3FF8C1E<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/kndmhuqmah<\/td>\n<td>ELF<\/td>\n<td>B5FBA27A8E457C1AB6573C378171F057D151DC615D6A8D339195716FA9AC277A<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/qkxqoelrfa<\/td>\n<td>ELF<\/td>\n<td>D71EA3B98286D39A711B626F687F0D3FC852C3E3A05DE3F51450FB8F7BD2B0D7<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/sykhrxsazz<\/td>\n<td>ELF<\/td>\n<td>9D6F115F31EE71089CC85B18852974E349C68FAD3276145DAFD0076951F32489<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/tcnszvmpqn<\/td>\n<td>ELF<\/td>\n<td>360A6258DD66A3BA595A93896D9B55D22406D02E5C02100E5A18382C54E7D5CD<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/zalkpggsgh<\/td>\n<td>ELF<\/td>\n<td>DC2B1CEE161EBE90BE68561755D99E66F454AD80B27CEBE3D4773518AC45CBB7<\/td>\n<\/tr>\n<tr>\n<td>\/usr\/bin\/zvcarxfquk<\/td>\n<td>ELF<\/td>\n<td>175667933088FBEBCB62C8450993422CCC876495299173C646779A9E67501FF4<\/td>\n<\/tr>\n<tr>\n<td>\/tmp\/bin\/3200<\/td>\n<td>ELF(rootkit)<\/td>\n<td>C8F761D3EF7CD16EBE41042A0DAF901C2FDFFCE96C8E9E1FA0D422C6E31332EA<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3>Download URLs<\/h3>\n<ul>\n<li>www[.]enoan2107[.]com:3306<\/li>\n<li>www[.]gzcfr5axf6[.]com:3306<\/li>\n<li>hxxp:\/\/aa[.]hostasa[.]org\/config.rar<\/li>\n<\/ul>\n<p><em><strong>Ratnesh Pandey<\/strong>, <strong>Yevgeny Kulakov<\/strong>, and <strong>Jonathan Bar Or<\/strong><br \/>Microsoft 365 Defender Research Team<\/em><\/p>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/www.microsoft.com\/security\/blog\/2022\/05\/19\/rise-in-xorddos-a-deeper-look-at-the-stealthy-ddos-malware-targeting-linux-devices\/\">Rise in XorDdos: A deeper look at the stealthy DDoS malware targeting Linux devices<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/www.microsoft.com\/security\/blog\">Microsoft Security Blog<\/a>.<\/p>\n<p><a href=\"https:\/\/www.microsoft.com\/security\/blog\/2022\/05\/19\/rise-in-xorddos-a-deeper-look-at-the-stealthy-ddos-malware-targeting-linux-devices\/\" target=\"bwo\" >https:\/\/blogs.technet.microsoft.com\/mmpc\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>Credit to Author: Katie McCafferty| Date: Thu, 19 May 2022 16:00:00 +0000<\/strong><\/p>\n<p>Observing a 254% increase in activity over the last six months from a versatile Linux trojan called XorDdos, the Microsoft 365 Defender research team provides in-depth analysis into this stealthy malware&#8217;s capabilities and key infection signs.<\/p>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/www.microsoft.com\/security\/blog\/2022\/05\/19\/rise-in-xorddos-a-deeper-look-at-the-stealthy-ddos-malware-targeting-linux-devices\/\">Rise in XorDdos: A deeper look at the stealthy DDoS malware targeting Linux devices<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/www.microsoft.com\/security\/blog\">Microsoft Security Blog<\/a>.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10759,10378],"tags":[4500,10496,3764,10516,22453,714],"class_list":["post-19094","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-security","tag-cybersecurity","tag-linux","tag-malware","tag-microsoft","tag-microsoft-security-intelligence","tag-security"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/19094","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=19094"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/19094\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=19094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=19094"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=19094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}