Evilnum APT used Python-based RAT PyVil in recent attacks

Pierluigi Paganini September 04, 2020

The Evilnum APT group has added a new weapon to its arsenal, it is a Python-based spy RAT, dubbed PyVil, designed to target FinTech organizations.

The Evilnum APT group was first spotted in 2018 while using the homonym malware. Over the years, the group added new tools to its arsenal, including custom and homemade malware along with software purchased from the Golden Chickens malware-as-a-service (MaaS) provider.

The group aimed at harvesting financial information from financial technology companies, such as trading platforms. Most of the targets are located in the EU and in the UK, but experts also observed attacks against companies in Australia and Canada.

According to researchers at Cybereason, now the threat actor has added a new tool to its arsenal, it is a Python-based remote access trojan (RAT), dubbed PyVil.

“In recent weeks, the Nocturnus team has observed new activity by the group, including several notable changes from tactics observed previously. These variations include a change in the chain of infection and persistence, new infrastructure that is expanding over time, and the use of a new Python-scripted Remote Access Trojan (RAT) Nocturnus dubbed PyVil RAT. ” reads the report published by Cybereason.

The PyVil RAT supports multiple functionalities including:

  • Keylogger
  • Running cmd commands
  • Taking screenshots
  • Downloading more Python scripts for additional functionality 
  • Dropping and uploading executables
  • Opening an SSH shell
  • Collecting information such as Anti-virus products installed, USB devices connected, and Chrome version.

The PyVil RAT was recently employed in attacks against FinTech companies across the U.K. and E.U. Attackers carried out spear-phishing emails using the Know Your Customer regulations (KYC) as a lure.

PyVil RAT was compiled with py2exe to build the Windows executable and the Python code inside the py2exe is obfuscated with extra layers, in order to prevent decompilation of the payload.

The researchers extracted the first layer of Python code using a memory dump, it decodes and decompresses the second layer. The second layer of Python code decodes and loads to memory the main RAT and the imported libraries.

The PyVil RAT stores the malware settings (i.e. version, command-and-control (C2) domains) in a configuration module. The malware communicates with the C2 communications via POST HTTP requests and uses RC4 encryption with a hardcoded key encoded with Base64.

Experts noticed that the command and control infrastructure used by the Evilnum APT is expanding.

“While the C2 IP address changes every few weeks, the list of domains associated with this IP address keeps growing,” continues the report published by the experts. “A few weeks ago, three domains associated with the malware were resolved to the same IP address. Shortly thereafter, the C2 IP address of all three domains changed. In addition, three new domains were registered with the same IP address and were used by the malware. A few weeks later, this change occurred again. The resolution address of all domains changed in the span of a few days, with the addition of three new domains.”

The attacks employing the PyVil RAT are characterized by a new infection chain that includes a multi-process delivery procedure of the payload, while past attacks used only a first-stage JavaScript Trojan with backdoor capabilities to establish an initial foothold on a target.

During the infection phase, threat actors also used modified versions of legitimate executables to avoid detection.

The new infection chain starts by including just one LNK file in the ZIP archive attached to spear-phishing messages. When the LNK file is executed, a JavaScript file is called, which acts only as a first-stage dropper (the file name is ddpp.exe).

“The ddpp.exe executable appears to be a version of [Oracle] Java Web Start Launcher, modified to execute malicious code,” according to Cybereason. “When comparing the malware executable with the original Oracle executable, we can see the similar metadata between the files. The major difference at first sight is that the original Oracle executable is signed, while the malware is not.”

The malware achieve persistence using the Run registry key, it creates a scheduled task named “Dolby Selector Task” for ddpp.exe.

The “Dolby Selector Task” acts as a second stage malware that retrieves a payload by unpacking shellcode. The shellcode connects to the C2 using a GET request, and in turn receives another encrypted executable, which it saves to disk as “fplayer.exe.”

The fplayer.exe is crafted to appear as a modified version of [Nvidia’s legitimate] Stereoscopic 3D driver Installer.

Upon executing the fplayer.exe file, another shellcode is unpacked, which connects the C2 and downloads the final payload that is decrypted and loaded to memory.

evilnum unleashes-pyvil-rat

“This innovation in tactics and tools is what allowed the group to stay under the radar, and we expect to see more in the future as the Evilnum group’s arsenal continues to grow.” concludes the report.

[adrotate banner=”9″][adrotate banner=”12″]

Pierluigi Paganini

(SecurityAffairs – hacking, Evilnum)

[adrotate banner=”5″]

[adrotate banner=”13″]



you might also like

leave a comment