A Deep Dive into 70 Layers of Obfuscated Data-Stealer Malware

Within the battle of hackers towards defenders, we persistently discover hackers attempting to disguise their true intent. We’ve analyzed an fascinating pattern that was armed with a number of layers of obfuscation. These packages had been fairly the problem. Nevertheless, the attackers haven’t but realized that no quantity of obfuscation can cover their intentions.

Key Findings

  • Two Python packages had been found with malware, fortified with a number of layers of obfuscation.
  • The Python malware implements a mess of methods to evade detection. 
  • The Python malware carried out a multi-stage payload supply and complete knowledge extraction capabilities.
  • The malware additionally comprises fallback mechanisms for knowledge exfiltration.
  • Checkmarx’s Provide Chain Intelligence clients are protected towards these assaults.

Dissecting the malware

Peeling again the layers of obfuscation

Nestled inside the “__init__.py” recordsdata of each packages, the malicious code is a jumble of a number of layers of obfuscation. As soon as un-obfuscated, we recovered disassembly code designed to fetch one other malicious payload from the url “hxxps[:]//rentry[.]co/pvtapi/raw”, put it aside underneath a random title with the .pyw extension, and execute it.

This secondary payload carried extra a number of layers of obfuscation. The lengths to which the attackers went to cover their intentions had been nothing wanting astonishing. Upon un-obfuscating it, we had been greeted with a second batch of malicious disassembly code. This one was extraordinarily lengthy and sophisticated, performing a mess of actions, however I’ll share right here the highlights of this subtle code. 

Gaining a foothold

As soon as activated, the script will get straight to enterprise. It asserts its authority by checking for administrative privileges and tries to bypass Consumer Account Management (UAC). The malware additionally conducts an web connectivity check then appears to be like for sandbox environments, all in a bid to evade detection. 

Subsequent steps

Numerous notable capabilities and courses had been discovered to be activated inside the script which allowed us to know the extent of its operation:

Disabling the gatekeeper: Home windows Defender

One of many malware’s preliminary tactical strikes is to execute a PowerShell script inside an elevated Powershell terminal to disable all safety options offered by Home windows Defender.

image 20

Blacklisting

The malware units up blacklists to keep away from detection in addition to particular targets.

image 22

Taking part in “Hide and Seek”: HideSelf & DeleteSelf

The ‘HideSelf’ perform makes use of the attrib command to cover recordsdata. by setting the file to be “hidden” and “system,” making it much less seen to the consumer in customary file searching home windows until they’ve configured their system to point out hidden and system recordsdata.

image 23

The ‘DeleteSelf’ perform is designed to take away this system’s personal executables and scripts from the system as soon as they’re now not wanted. If the file is an executable, the malware makes use of a method involving ping and del to take away itself from the system. If it isn’t an executable, the malware makes use of the os.take away perform to delete the file.

image 24

Reducing off the lifeline with ‘BlockSites’

The malware goes so far as to govern the Home windows hosts file to dam entry to an inventory safety and antivirus web sites, which incorporates virustotal.com, mcafee.com, bitdefender.com, and plenty of extra. This was most probably achieved to forestall the consumer from downloading antivirus software program or checking recordsdata on-line for viruses.

image 25

Screenshots and Webcam Seize 

A Powershell script is used to take screenshots after bypassing the execution coverage on Powershell: It captures screenshots of all accessible screens on the system and saves them as .png recordsdata within the present listing.

image 26

The malware additionally makes use of a perform known as ‘Webshot’, which captures webcam pictures if a specific setting (Settings.CaptureWebcam) is enabled. The photographs are saved in a short lived listing (TempFolder/Webcam). The captured pictures are saved within the camdir listing with filenames like “Webcam (1).bmp”, “Webcam (2).bmp”, and many others. If no pictures are captured, the listing is eliminated.

image 27

Browser and Discord Knowledge Mining 

The malware makes use of courses named ‘Browsers’ and ‘Chromium’ which embody strategies for extracting and decrypting knowledge from a wide range of browsers together with passwords, cookies, historical past, and autofill knowledge.

image 28

The malware additionally consists of courses designed to work together with Discord’s API to scrape varied kinds of consumer info. It captures knowledge related to the consumer’s account like username, consumer ID, e mail, telephone quantity, billing info, reward codes, and extra. The category makes use of HTTP requests to work together with Discord’s API, attempting to make use of the consumer’s Discord token to authenticate.

image 29

The malware goes a step additional and consists of inside it a ‘DiscordInjection’ perform that checks whether or not a setting (Settings.DiscordInjection) is enabled and whether it is enabled, it injects JavaScript into Discord.

It additionally performs job killing on Discord primarily based on its title, doubtless to ensure the injected code runs when Discord restarts.

image 30

In depth machine knowledge mining

The malware consists of capabilities for stealing a complete number of knowledge on the focused machine together with Cryptocurrency Wallets, System Info (Laptop Identify, Complete Bodily Reminiscence, UUID, CPU Particulars, GPU Particulars, Product Key, and many others), Antivirus Data, Process Listing, Wi-Fi Passwords, and clipboard knowledge.

image 31

The script additionally comprises code to steal widespread recordsdata from particular directories comparable to Desktop, Photos, Paperwork, Music, Movies, and Downloads. The code searches for recordsdata with particular key phrases like ‘secret’, ‘password’, ‘account’, ‘tax’, ‘key’, ‘pockets’, ‘backup’ and particular file extensions like .txt, .doc, .docx, .png, .pdf, .jpg, .jpeg, .csv, .mp3, .mp4, .xls, .xlsx.

The script additionally steals consumer knowledge associated to numerous gaming companies together with SteamUplay, and Roblox

StealTelegramSessions

The malware additionally comprises a perform known as StealTelegramSessions designed to go looking and steal Telegram classes if a setting (Settings.CaptureTelegram) is enabled. It identifies Telegram set up paths and copies the session knowledge (key_datas recordsdata and associated recordsdata) to a specified listing (TempFolder/Messenger/Telegram).

image 32

Final vacation spot

All of the stolen info is finally saved into varied recordsdata that are later archived with password safety, (the password used is – “blank123”).

After this, all these recordsdata are tried to be uploaded to both of the next file-sharing companies: http://gofile.io and “anonfiles.com”.  Nevertheless, in the event that they weren’t profitable or if the recordsdata had been too giant to start with, then the archived knowledge is exfiltrated to telegram by way of the next telegram bot API URL – https://api.telegram.org/bot6470601001:AAFb_C7msjRCEh8jwo_Q74aujh1TXUP0CsQ/sendMessage?chatid=1975115969

image 33

Ties to GitHub

As we dissected the disassembly code, we discovered direct references to ‘Hexa-Grabber,’ in addition to URLs pointing to what as soon as was its GitHub repository: https://github.com/Hexa-c/Hexa-Grabber. Nevertheless, the repository itself seems to have been taken down.

Conclusion

This Python malware is a posh risk on the earth of cyber threats. It goes to nice lengths to cover its tracks, disable safety measures, and exfiltrate a plethora of private and delicate info. Its a number of layers of obfuscation and multifaceted method make it a noteworthy topic of examine for safety researchers and a critical concern for end-users alike.

So, subsequent time you are tempted to obtain a Python bundle with out due diligence, bear in mind: the malware we have dissected at the moment may very well be simply the tip of the iceberg.

For additional particulars and inquiries please be at liberty to ship an e mail to [email protected].

Working collectively to maintain the open supply ecosystem secure.

Packages

IOC

  • hxxps[:]//rentry[.]co/pvtapi/uncooked
  • hxxps[:]//api[.]telegram[.]org/bot6470601001:AAFb_C7msjRCEh8jwo_Q74aujh1TXUP0CsQ/sendMessage?chatid=1975115969
  • hxxps[:]//github[.]com/Hexa-c/Hexa-Grabber

Recent articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here