As Emotet’s apparent hiatus continues, new malspam campaigns have risen to take its place (including a strange Emotet-Dridex hybrid eSentire reported in June [1]). Ostap has generally stayed out of the mainstream spotlight in the three years since its introduction [2] but appears each year with new modifications. Ostap’s most recent variant adds to its 2018 blacklist of processes the malware can detect and react to including VirtualBox and Hybrid Analysis. Interestingly, the authors also included the names of two security researchers in their blacklist: Hong Lee and Peter Wilson. The authors also removed Windows XP from the list, indicating they may no longer expect sandboxes to be running an XP environment. 

A critical difference from Emotet is Ostap’s destructive propagation feature. Upon failure to download the payload, Ostap will search out documents (such as *.xls, *.doc, *.pdf, *.txt, *.rtf, and *.odt) on all attached drives (including mapped network drives) and replace them with copies of itself. The functionality was first observed in 2017, as well as in current samples examined by eSentire’s Advanced Threat Analytics team. In this way, Ostap is able to propagate across network shares and removable media. 

Like Emotet, Ostap is delivered through email as an attached malicious document (MalDoc).  The MalDocs are typically disguised as Invoices, prompting a fraction of employees in financial roles to open them and activate the malware. At that point, internal security protocols become important.  Emotet and Ostap both abuse macro functionality in Microsoft documents. However, Ostap utilizes JavaScript (rather than PowerShell) to download the chosen payload.   

The Payload: Trickbot 

The Trickbot payload delivered by Ostap has been observed harvesting credentials from common applications such as Chrome, Firefox, Internet Explorer, Filezilla, Windows Remote Desktop Protocol, and VNC.  The malware can also infect PoS devices with a separate module [3]. 

Another Evolving Threat 

Ostap first arrived in 2016, a JavaScript loader delivering banking trojans and Point-of-Sale (PoS) malware. It was observed delivering Dridex, Tinba, and Ursnif [2]. In 2017, the authors added environment detection capabilities. If the malware detected any filepaths associated with anti-virus or monitoring applications like WireShark, it would not detonate. The authors also made minor adjustments to the malware’s C2 communication conventions to better evade network detection and included a feature that replaced all user documents with the Ostap MalDoc upon failure to download the payload [4]. In 2018, the blacklist was expanded and the script was heavily obfuscated. 

Recent Campaign Traces 

Jul 3 – Ostap source code is pasted on pastebin [5] 

July 22 – A public hybrid analysis sample points to Trickbot at 185.159.82[.]15 but fails to run, invoking a manufactured “document error”. [6] 

July 26 – Twitter User Jammy (@jcandt) on twitter observed Ostap serving Trickbot via 185.159.82[.]15/hollyhole951/c644.php 

July 30 – Twitter User Kirk Sayre (@bigmacjpg) observed trickbot being served from 185.130.104[.]236/deerhunter/inputok.php 

July 31 – eSentire observes Ostap delivering trickbot and begins deobfuscating the malware. Last public deobfuscation was 2018 [4]. C2 source was the same reported by Kirk Sayre (July 30). 

Aug 5 - During the writing of this article, TrendMicro published their own analysis on the malware delivered by the C2 reported by Jammy (July 26), but did not identify the JS dropper as Ostap [3].   

Indicators 

Most static indicators are outlined well by TrendMicro [3].  However, we include one that could be useful for network monitoring as well as propose a behavioral detection. 

C2: 185.159.82[.]15 

C2: 185.130.104[.]236

HTTP header response: RedSparrow

Machine detection of malicious documents: In general, Word macros spawning command interpreters (cmd.exe, powershell.exe, wscript.exe, cscript.exe, mshta.exe) is an indicator of malicious behavior and a popular vector for social engineering-based email spam. In the case of Ostap, wscript.exe is observed executing malicious JavaScript. 

Human detection of malicious documents: Malicious spam often arrives disguised as invoices, tax documents, and shipping orders.  Financial departments tend to be highly targeted.  Consider implementing protocols around email handling for the financial department that includes phishing awareness training and safe scrutiny of attached documents. 

References 

[1] https://www.esentire.com/blog/new-dridex-variant-evading-traditional-antivirus/ 

[2] https://www.securityweek.com/ostap-backdoor-installs-banking-trojans-pos-malware 

[3] https://blog.trendmicro.com/trendlabs-security-intelligence/latest-trickbot-campaign-delivered-via-highly-obfuscated-js-file/

[4] https://www.cert.pl/en/news/single/ostap-malware-analysis-backswap-dropper/ 

[5] https://pastebin.com/svT5pQup 

[6] https://www.hybrid-analysis.com/sample/f9c0dadd5184966384eecca53c3bb781d164ceab26777c2b611cb6bb592fea9d?environmentId=100 

threat intel logo
eSentire Threat Intel
Threat Intelligence Research Group

See the latest blog posts

Articles and reports written by eSentire staff and our Threat Intelligence Research Group.

Ready to get started?
We're here to help.

Get Started
Reach out to schedule a meeting and learn more about our Managed Detection and Response, Risk Advisory and Managed Prevention capabilities.