Cyber Security News

New Loki Backdoor Attacking macOS Systems

Cody Thomas developed Apfell, an open-source macOS post-exploitation framework, in 2018 and evolved into Mythic, a cross-platform framework that addresses the limitations of existing tools. 

Mythic provides a unified interface for managing agents written in various languages for different platforms, which allows for flexibility and customization, enabling the creation of agents with specific functionalities. 

Currently, the official Mythic repository houses over two dozen agents, where the Loki agent employs a modified djb2 hashing algorithm to obscure API functions and commands, which involves using a different magic number (2231) compared to the original Havoc agent. 

The hash value is calculated by iterating through the string, shifting the value left by 5 bits, adding the original hash value, and then adding the current character, which makes it more difficult to analyze and identify the agent’s behavior.

An example of the data sent before encryption by the July version of Loki, with the UUID visible on the right

The Loki loader, a piece of malware, sends encrypted information about the infected system to a command-and-control server.

In response, the server sends a DLL that the loader loads into the infected device’s memory, which handles further communication with the server. 

Both the May and July versions of the loader use similar encryption methods but have minor differences in data serialization and UUID handling. 

The May version sends a plaintext UUID, while the July version encodes it. After the initial connection, the loader transfers control to the DLL, which continues the malicious activity.

Traffic from the May version after encryption with plaintext UUID

The analyzed malware, stagger_1.1.dll, is a Windows x64 executable based on the Havoc agent, which communicates with a C2 server using a series of hashed commands, including file transfer, process management, and environment manipulation. 

The agent does not support traffic tunneling natively, but attackers frequently use third-party tools like ngrok or gTunnel to access private networks, which was observed being loaded and executed in memory to avoid detection.

Processing command hashes

According to Securelist, Russian companies in various industries have been targeted by a sophisticated malware campaign, likely delivered via email attachments, where the attackers, using publicly available tools, have successfully compromised over a dozen organizations. 

Victims are believed to have been tricked into opening malicious files, leading to the installation of the Loki malware.

Despite extensive research, attribution to a specific threat actor remains challenging due to the attackers’ evasive tactics and use of common tools.

The popularity of open-source post-exploitation frameworks has grown, with attackers increasingly using them to control and modify victim devices remotely.

These frameworks, like July and May loaders, often employ techniques that evade detection and attribution. 

Specific file hashes, network traffic patterns, and command-and-control (C2) addresses associated with these frameworks are indicators of compromise.

The main module, gTunnel, and ngrok are key components used for tunneling and establishing communication with the attacker.

Simulating Cyberattack Scenarios With All-in-One Cybersecurity Platform – Watch Free Webinar

Balaji

BALAJI is an Ex-Security Researcher (Threat Research Labs) at Comodo Cybersecurity. Editor-in-Chief & Co-Founder - Cyber Security News & GBHackers On Security.

Recent Posts

Indonesia Government Data Breach – Hackers Leaked 82 GB of Sensitive Data Online

Hackers have reportedly infiltrated and extracted a vast 82 GB of sensitive data from the Indonesian…

5 hours ago

IBM AIX TCP/IP Vulnerability Lets Attackers Exploit to Launch Denial of Service Attack

IBM has issued a security bulletin warning of two vulnerabilities in its AIX operating system…

7 hours ago

Apache Auth-Bypass Vulnerability Lets Attackers Gain Control Over HugeGraph-Server

The Apache Software Foundation has issued a security alert regarding a critical vulnerability in Apache…

7 hours ago

USA Launched Cyber Attack on Chinese Technology Firms

The Chinese National Internet Emergency Center (CNIE) has revealed two significant cases of cyber espionage…

7 hours ago

Node.js systeminformation Package Vulnerability Exposes Millions of Systems to RCE Attacks

A critical command injection vulnerability in the popular systeminformation npm package has recently been disclosed, exposing millions…

2 days ago

Skuld Malware Using Weaponized Windows Utilities Packages To Deliver Malware

Researchers discovered a malware campaign targeting the npm ecosystem, distributing the Skuld info stealer through…

3 days ago