New Nim-Based Malware Delivered via Weaponized Word Document

Hackers use weaponized Word documents to deliver malicious payloads through social engineering. 

By embedding malware or exploiting vulnerabilities in these documents, attackers trick users into opening them and leading to the execution of malicious code. 

While leveraging the familiarity and trust associated with such file format, this tactic is effective for several illicit purposes:-

  • Spreading malware
  • Gaining unauthorized access
  • Initiating other cyber attacks

Recently, cybersecurity researchers at Netskope identified a new Nim-based malware, which was delivered via weaponized Word documents by the threat actors.

Nim is a new language that sees a rising malware trend, and experts at Netskope Threat Labs note growing Nim-based threats, anticipating further popularity. 

Among them, the most notable one is “Dark Power” ransomware, which is also a variant of the Nim-based family that surfaced recently.

Nim-Based Malware via Word Document

The malicious Word doc drops the Nim backdoor, which is sent as an email attachment by a fake Nepali official. 

Despite macro security, APT malware, like Menorah, which used a similar tactic months ago, still leverages macros for payload delivery. 

Malicious Word file prior to enabling macro (Source – Netskope)

Besides this, opening the file shows a blank doc, prompts macro to enable, and then the clicking triggers the:-

  • Auto-routine
  • Code execution

VBA project uses passwords and obfuscation to dodge AV solutions. At the same time, the macros employ Chr( ) and string concatenation. 

Apart from this, the code is divided into four subroutines, and here below we have mentioned them:-

  • sch_task
  • hide_cons
  • read_shell
  • vb_chain

Word doc deploys Nim-based ‘conhost.exe’ backdoor on September 20, 2023. Nim is a versatile language that compiles the following languages together with Pythonic syntax:-

  • C
  • C++
  • JavaScript

Backdoor operates with user’s privileges, mimicking Nepali authority to deceive users. C&C server imitates government domains ([.]govnp[.]org).

Nim Backdoor (Source – Netskope)

Nim backdoor checks for analysis tools and terminates if found. Then, it fetches the hostname and encrypts it with the ‘bakery’ function.

Processes the backdoor avoids (Source – Netskope)

The encrypted hostname double-base64 encoded, which was:-

  • Spliced with C&C server URL
  • Suffixed with ‘.asp’

The C&C server issues the commands via HTTP GET, the response is decrypted by the ‘confectionary’ function, executed with cmd /c, and then the result is sent back to the server. 

Besides this, for encryption and decryption, “NPA” was used as the key, potentially Nepal Agent.

Contacted C2 hosts

Here below, we have mentioned all the C2 hosts that were contacted:-

  • mail[.]mofa[.]govnp[.]org
  • nitc[.]govnp[.]org
  • mx1[.]nepal[.]govnp[.]org
  • dns[.]govnp[.]org

The VBscript ‘OCu3HBg7gyI9aUaB.vbs‘ in the startup folder ensures access. Confirms internet connection, pings Google. 

On success, it runs ‘8lGghf8kIPIuu3cM.bat,’ and the batch file drops the files and creates tasks for payload. 

Meanwhile, the ‘d.bat’ establishes the persistent execution with the scheduled task ‘ConsoleHostManager.’

Scheduled Task (Source – Netskope)

Malware in rare languages challenges security experts, and the cross-compilation in Nim aids hackers in creating obstacles for security analysts.

IOCs

MD5

  • e2a3edc708016316477228de885f0c39
  • 777fcc34fef4a16b2276e420c5fb3a73
  • EF834A7C726294CE8B0416826E659BAA
  • 32C5141B0704609B9404EFF6C18B47BF

SHA-1

  • 3aa803baf5027c57ec65eb9b47daad595ba80bac
  • 5D2E2336BB8F268606C9C8961BED03270150CF65
  • 4CAE7160386782C02A3B68E7A9BA78CC5FFB0236
  • 0599969CA8B35BB258797AEE45FBD9013E57C133

SHA-256

  • b5c001cbcd72b919e9b05e3281cc4e4914fee0748b3d81954772975630233a6e
  • 696f57d0987b2edefcadecd0eca524cca3be9ce64a54994be13eab7bc71b1a83
  • 88FA16EC5420883A9C9E4F952634494D95F06F426E0A600A8114F69A6127347F
  • 1246356D78D47CE73E22CC253C47F739C4F766FF1E7B473D5E658BA1F0FDD662

Network

  • mail[.]mofa[.]govnp[.]org
  • nitc[.]govnp[.]org
  • mx1[.]nepal[.]govnp[.]org
  • dns[.]govnp[.]org
Tushar Subhra

Tushar is a Cyber security content editor with a passion for creating captivating and informative content. With years of experience under his belt in Cyber Security, he is covering Cyber Security News, technology and other news.

Recent Posts

Google Unveils New Intelligent, Real-Time Protections for Android Users

Google has once again raised the bar for mobile security by introducing two new AI-powered…

17 hours ago

Chinese National Faces 20 Years of Jail Time for Laundering Millions in Crypto

Daren Li, 41, a dual citizen of China and St. Kitts and Nevis, and a…

18 hours ago

Google to Issue CVEs for Critical Cloud Vulnerabilities

Google Cloud has announced a significant step forward in its commitment to transparency and security…

19 hours ago

GitLab Patches Critical Flaws Leads to Unauthorized Access to Kubernetes Cluster

GitLab has rolled out critical security updates to address multiple vulnerabilities in its Community Edition…

20 hours ago

Windows 0-Day Exploited in Wild with Single Right Click

A newly discovered zero-day vulnerability, CVE-2024-43451, has been actively exploited in the wild, targeting Windows systems…

21 hours ago

Automating Identity and Access Management for Modern Enterprises

Keeping track of who has access and managing their permissions has gotten a lot more…

2 days ago