Connect with our team of offensive security, AI security and pen testing experts at Black Hat Europe 2023. Learn More

Connect with our team of offensive security, AI security and pen testing experts at Black Hat Europe 2023. Learn More

Managed Detection & Response

Eradicate cyberthreats with world-class intel and expertise

Managed Security Services

Expand your team’s capabilities and strengthen your security posture

Consulting & Professional Services

Tap into our global team of tenured cybersecurity specialists

Penetration Testing

Subscription- or project-based testing, delivered by global experts

Database Security

Get ahead of database risk, protect data and exceed compliance requirements

Email Security & Management

Catch email threats others miss with layered security & maximum control

Co-Managed SOC (SIEM)

Eliminate alert fatigue, focus your SecOps team, stop threats fast, and reduce cyber risk

Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
The Trustwave Approach
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Platform
SpiderLabs Fusion Center
Security Operations Centers
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Yet Another Archive Format Smuggling Malware

The use of novel disk image files to encapsulate malware distributed via spam has been a theme that we have highlighted over the past couple of years. As anticipated, we have seen more disk image file formats being used, in addition to .ISO, .IMG, and .DAA which we blogged about.

We recently spotted another file format being used. These spams, spoofing courier companies, contain a malicious WIM (Windows Imaging Format) file disguised as an invoice or consignment note. WIM is a file-based disk image format developed by Microsoft. The file format serves to deploy Windows software components and updates ever since Windows Vista. This format uses a ".wim" extension and its content can be extracted using archiving tools like 7Zip, PowerISO, and PeaZip. Below are some samples from this campaign.

Figure 1Figure 1: A DHL spam containing a fake invoice attachment
Figure 2
Figure 2: A DHL spam containing multiple malicious attachments disguised as consignment documents
Figure 3
Figure 3: A spam spoofing AlphaTrans containing a fake invoice attachment


The attachments, although they have a ‘.wim.001’ file extension which denotes that they are the first part of a larger WIM file, have the complete file structure of a WIM file. Using the ImageX tool, we verified that all the WIM attachments we collected are not compressed and have one file only.

Figure 4
Figure 4: The information about the WIM attached in Fig. 1 using the tool ImageX


Opening the WIM files in a hex editor, its immediately noticeable that an executable file is hiding in them. Using the archiving tool 7Zip as displayed in Fig. 3, the EXE file bearing the same name as its WIM container can be extracted.

Figure 5
Figure 5: The WIM attachment shown in Fig. 1 viewed using the tool Hiew


All the WIM files we gathered from our samples contain Agent Tesla malware. This threat is a Remote Access Trojan (RAT) written in .Net which can take full control over a compromised system and can exfiltrate data via HTTP, SMTP, FTP, and Telegram. In 2020, Agent Tesla was one of the predominant RATs and early this year, we reported that this malware is still actively getting distributed in spam emails.

Figure 6
Figure 6: The SMTP process of the Agent Tesla malware contained in Fig. 5 using DNSpy


Figure 7
Figure 7: The Agent Tesla malware extracted from the spam seen in this blog



Encapsulating malware in an unusual archive file format is one of the common ways to bypass gateways and scanners. However, this strategy also poses a hurdle – the target system must recognize the file type or at least have a tool which can unpack and process the file. In contrast to the more popular .IMG and .ISO disk image files, WIM files are not supported by Windows built-in ability to mount disk image files. Moreover, the other popular archive utilities WinRAR and WinZip do not recognize the WIM disk image. WIM files can be processed with the widely used 7Zip.

In terms of suspiciousness, an inbound email containing a WIM file is not usual and should raise a few flags. Administrators could look to block these outright. Trustwave MailMarshal detects these threats bundled inside unusual disk imaging containers using a combination of its unpacking engine and its multi-layered threat detection technology.


WIM Files:
DHL Airway 3426983794.wim.001 (782102 bytes)    SHA1: 91E3FE9AF48482484A4AAC9573D1FB13CB428738
Invoice_for_part_shipped(Feb 19,2021).wim.001 (634678 bytes)    SHA1: D37C13A36A92114A927860B7021EB0C71BE73FBF
Monthly Statement.wim.001 (747278 bytes)    SHA1: 2498342105E1C196C73960654E751D441925ED5C

Agent Tesla:
DHL Airway 3426983793.exe (780800 bytes)    SHA1: 62FC617343B3D823362C8D9EA89AA676F79CE972
DHL Airway 3426983794.exe (780800 bytes)    SHA1: 62FC617343B3D823362C8D9EA89AA676F79CE972
Invoice_for_part_shipped(Feb 19,2021).exe (633344 bytes)    SHA1: F02FAFB08125D877584F73D5077DFCA95D66318C
Monthly Statement.exe (745984 bytes)     SHA1: 236D1F71EB2EFA0C24E7EBA4390FEFE3691F1C68

DHL Airway 3426983793.tar.001 (782336 bytes)    SHA1: E31107CCE2AA0DCF8B8C064EFEACAD5508C69D29

Latest SpiderLabs Blogs

The 2023 Retail Services Sector Threat Landscape: A Trustwave Threat Intelligence Briefing

The annual holiday shopping season is poised for a surge in spending, a fact well-known to retailers, consumers, and cybercriminals alike. The latter group, however, is poised to exploit any...

Read More

Pwning Electroencephalogram (EEG) Medical Devices by Default

Overall Analysis of Vulnerability Identification – Default Credentials Leading to Remote Code Execution During internal network testing, a document was discovered titled the “XL Security Site...

Read More

Hidden Data Exfiltration Using Time, Literally

I was looking at my watch last week and my attention was moved towards the seconds over at the right of the watch face, incrementing nicely along as you’d expect. Now, I don’t know if I’d just spent...

Read More