Trustwave and Cybereason Merge to Form Global MDR Powerhouse for Unparalleled Cybersecurity Value. Learn More

Trustwave and Cybereason Merge to Form Global MDR Powerhouse for Unparalleled Cybersecurity Value. Learn More

Services
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Microsoft Security
Unlock the full power of Microsoft Security
Offensive Security
Solutions to maximize your security ROI
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
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
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

ModSecurity Advanced Topic of the Week: Detecting Malware with Fuzzy Hashing

We witnessed a sophisticated phishing campaign on 16th August 2017, targeting victims by sending spoofed phishing email messages appearing to come from Xero. Xero is a New Zealand-based software company that develops cloud-based accounting software for small and medium-sized businesses. The scammers sent phishing email messages globally, impersonating Xero. These messages contained malicious links that trick the victim into downloading a zip archive, containing a malicious JavaScript file. On execution, this JavaScript downloads and launches banking malware on to the victim's computer that steals their personal and private information and leaves them vulnerable to the mercy of their attackers.

Analysis of the Email Header

We first analyzed the email header for the wealth of information provided there (see Figure 1). The name part of the "From" header field suggests that this message was sent from "Xero Billing Notifications", while the email address is pointing to the domain "xeronet.org" instead of the legit business "xero.com"

11782_c956440c-54ce-4711-8a98-5b100c70c157
Figure 1: Email Header


Analyzing the domain "xeronet.org", we learn that it was registered in China on the same day the campaign was launched (August 16, 2017, using a free yahoo email address (see Figure 2). The domain points to an IP 94.23.4.201 in France. Browsing to the site reveals a static HTML page with the heading "XERONET.ORG" and text Powered by VESTA.

11388_b674415c-eef7-4de0-94d1-36484072cd4b
Figure 2: Domain registration details

 

Analysis of the Email Message Body:

Analyzing the email body, it looks like a professionally crafted billing message that recommends that users view their bill invoice online by clicking on the invoice link (see Figure 3).

9639_647fc681-ceb3-411b-b3ad-c4713ecae37d
Figure 3: Email message body

 

The invoice link in the email body points to a URL hosted on the fake Xero domain, while the other URLs point to the legitimate Xero.com site. We also observed a different set of malicious URLs, two of which are noted here:

  1. hxxps://lakesambel-my(.)sharepoint(.)com/personal/contact_caravanparkbeechworth_com_au/_layouts/15/guestaccess.aspx?docid=03b4b6316d9ca4fa48971a9101a38b364&authkey=Afo8hRz5LV65-XWim02sZtg
  2. hxxps://barenbruguk-my(.)sharepoint(.)com/personal/jfrench_baruk_co_uk/_layouts/15/guestaccess.aspx?docid=3D0c6a2791db75141c2b5601c982deb2638&authkey=3DAQMGIKwV1pN27XNsERquBCQ

Browsing to either URL has the same result, the URLs load JavaScript into the browser that forces a ZIP file download on to the victim's computer. Figure 4 shows a detailed flow of one of the emails.

12034_d5f84df9-89ce-446f-859a-ea7bf39b6a0d
Figure 4: Flow of the attack

 

Analysis of Downloaded file

The malicious JavaScript: Xero Invoice.js

Unzipping Xero Invoice.zip extracts to: "Xero Invoice.js". This is a highly obfuscated JavaScript sample (see Figure 5). On further analysis, it appears to be a generic JavaScript downloader and executer, that employs the Microsoft ActiveX object MSXML2.XMLHTTP to download the malware payload. This object is used to send an arbitrary HTTP request, receive the response, and have the Microsoft XML Document Object Model (DOM) parse that response. The response is then saved to disk with the help of the Microsoft ADODB stream Active X object that saves the stream to the temp folder with a random name for the binary as: "%TEMP%\Y739Ayh.exe". This malware is downloaded from the hardcoded link:
hxxps://stakks-my(.)sharepoint(.)com/personal/accounts_stakks_com_au/_layouts/15/guestaccess.aspx?docid=0426cc21c900f4425bfd868cf0a9bc836&authkey=AdVBGQCO-SGtytiexhgUfw8. The downloaded payload is finally executed using the ActiveX WScript Shell object.

BSL_12270_e2a53024-87d9-47a2-9855-234dd5d2a0c5
Figure 5: Malicious obfuscated JavaScript sample

 

Any victim who double clicks on this JavaScript file may find it execute like any binary under Windows OS. This is facilitated by the Microsoft Windows Scripting Host (or WSH), which is a framework for running and automating scripts from the GUI using WScript.exe. The WSH supports various scripting formats like JScript and VBScript.

Analysis of the Malware Payload: Y739Ayh.exe

This is a sophisticated malware sample that performs multiple tasks. It first gathers information about the system, installed applications and users. This is followed by several system wide policy settings and configuration changes for Internet Explorer through the registry. The malware also attempts to hook benign windows processes like whoami.exe and net.exe. Figure 6 illustrates the flow of the processes spawned by the malware.

8926_41db46d1-a2a9-4bf9-bde3-cde5dfea5a03
Figure 6: Flow of the processes spawned by the malware

 

This executable turned out to be a variant of the Dridex banking trojan. When executed, Y739Ayh.exe performs a process hollowing technique to inject its malicious code into a legitimate process. It creates a suspended process of either of the two target processes: svchost.exe or spoolsv.exe, using the API CreateProcessInternalW(). Then the malicious code is written to the allocated virtual address region of the target process. After changing the entry point to the new code section, the malware then simply resumes the suspended process using the NTResumeThread() API. The main executable Y739Ayh.exe is then deleted.

However, if the executable is residing in Windows System directory, it skips the process hollowing routine and runs as a stand-alone process.

Reconnaissance

The malware probes the infected system by gathering computer name, system information as well as privilege information and integrity level. It uses built in Windows commands such as "whoami.exe /all" and "net.exe view" (see Figure 7) and then saves the result to a tmp file dropped in Windows %Temp% folder which is later ex-filtrated.

9963_742b9506-b33a-4f0b-af8e-50d98be3ea5d
Figure 7: Malware collecting system information with the whoami.exe command

 

It also gathers the list of installed software by querying the "DisplayName" and "DisplayVersion" value of the registry key:

HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall (see Figure 8).

BSL_8397_2783365e-5d28-4f95-a2b8-0941137cf25c
Figure 8: Registry values for installed software

 

This information is stored as XML format and is then encrypted and ex-filtrated to the control server.

Obfuscation

This malware uses a very common anti-analysis technique of indirectly calling APIs. This prevents defenders from conducting static analysis. For example in the code below, instead of directly calling the Windows API RegCloseKey(), it first calls a function that resolves the API given a pre-calculated hash. The first parameter passed is the dynamic library hash then the second one is the API hash , as shown In Figure 9.

3A9838D7h = Advapi32
945E62DCh = RegCloseKey

BSL_12081_d8760b3b-a2a3-466a-9f28-8db357ee028a
Figure 9: Obfuscation through API hash call

 

The folks at IBM posted a very good write-up of this API obfuscation technique.

At first execution, the malware sample attempts to make an outbound connection to the following IP addresses and ports:

  1. 174.100.16:443
  2. 121.243.232:1443
  3. 208.64.187:1443
  4. 236.218.169:4343
  5. 31.77.229:1443

From here, it attempts to download configuration with additional command and control nodes and additional bot modules. At the time of analysis, the bot failed to connect to its command and control server.

Dridex is designed to steal banking and personal information by injecting itself into web browsers such as Firefox, Chrome and Internet Explorer. It monitors browsing activity and steals sensitive information for target online banks listed in its configuration file.

The malware communicates with several hosts over different ports using SSL. The use of encrypted channels for communication over nonstandard ports adds to the sophistication of the malware.

The network communication has triggered several Emerging threat IDS rules, validating that this malware is a variant of Dridex, that is a known banking trojan, the rule description reads "ET TROJAN ABUSE.CH SSL Blacklist Malicious SSL certificate detected (Dridex)". Multiple AV vendors also classify the sample as a Trojan.

This campaign is designed to steal banking and personal information from global customers, by infecting their systems with banking trojans. The packaging of malicious JavaScript in a Zip archive that is accessed through a URL sent via a legit-looking phishing email, provides the perfect means to evade detection mechanisms.

Other Reports of Similar Phishing Campaigns

The Xeronet campaign was followed by a string of related campaigns using similar SharePoint URLs to target customers of online financial software services companies. Our research suggests that based on matching whois info, the cybercriminals behind this fresh wave of phishing attacks have been active in the past with similar campaigns using domains like (xeroaccounting.org , intuito.biz, quickbooks-support.biz, financialaccountant.info, myobaustralia.org, australiangovernments.com, btconnect.biz, drvenergy.com ). Let's take a look at a few such related campaigns that we've witnessed since the 20th August 2017 :

The fake MYOB campaign:

This campaign used fake MYOB statements to lure users into clicking on attacker controlled URLs. The campaign surfaced on 22nd August, 2017 and ended after a 24 hour period. MYOB is an Australian multinational corporation that provides tax, payroll, accounting and other services to small and medium businesses. To make their campaign as targeted and effective as possible, scammers registered a fake MYOB-like domain (myobemail.com) to send fraudulent phishing messages serving banking trojans.

  1. Similar to the Xeronet campaign, the domain myobemail.com also points to a French IP: 94.23.59.109
  2. The domain was created on 22nd August, 2017 and is registered to the same individual as the Dropboxa.com domain (mentioned later) i.e. Wang Wiet from Xiamin, China, with the email: whois-protect@hotmail.com.
  3. On browsing, it too reveals a similar static HTML page with the heading "MYOBEMAIL.COM" using the same font and same powered-by VESTA message (see Figure 10).
  4. Figure 11 shows a screenshot of the email message. This is a specially crafted message using a fake MYOB email template, enticing the victim to click to view the invoice. On clicking the "View Invoice" button the user's browser is taken to a sharepoint URL. The use of sharepoint for hosting malicious URLs is relatively new and it is interesting that this service is being abused for this campaign.
  5. The attackers used a similar sharepoint URL similar to the one used in the Xeronet campaign. This URL was active and upon accessing it with a browser, downloaded a zip file (another similarity with Xeronet) containing the malicious JavaScript (sample INV-P0719.js, with md5sum: d717b30c5799fcbd571ed44a54ffb187) in it.
  6. Upon executing the JavaScript it downloads a different malware, specifically the Ursnif Trojan. This malware also injects its code to Firefox, Chrome or IE, monitors online banking activity and later ex-filtrates captured data to its control server
  7. The URL shared via email is illustrated here: hxxps://crawfordltd-my(.)sharepoint.com/personal/brian_crawford-ltd_co_uk/_layouts/15/guestaccess.aspx?docid=0b0d2f24869b643a0a&authkey=3DAcjrc9zYJtukV1h2YDVyTXo
12544_ee3f228c-5e0d-4aa6-b123-f59fed4523ae
Figure 10: myobemail.com site content

 

11800_ca55bd8d-3c08-4c94-b63b-e0a4bda905c9
Figure 11: Fake MYOB email message

 

The Fake Quickbooks campaign:

This campaign used fake Quickbook statements to lure users into clicking on attacker controlled URLs. The campaign surfaced on 23rd August, 2017 and ended after a 24 hour period. QuickBooks is an accounting software package developed and marketed by Intuit. QuickBooks provides tax, payroll, accounting and other services to small and medium businesses, ranging from on-premise to cloud solutions. Scammers registered a fake quickbook-like domain (qbaccountants.net) to send fraudulent phishing messages.

  1. The domain qbaccountants.net was not pointing to any IP when tested.
  2. The domain was created on 20th August, 2017 and is registered to Wang Wiet from Xiamin, China, with the email: whois-protect@hotmail.com.
  3. This time browsing to the site qbaccountants.net doesn't work since as the site is not serving any content.
  4. A screenshot of the email message is show in Figure 12. This is a specially crafted message using a fake Quickbook-like email template, enticing the victim to click on the button to view an invoice, that requires prompt payment. After clicking the "View Invoice" button the user's browser is taken to a sharepoint URL.
  5. The attackers used a Sharepoint URL similar to the one used in the Xeronet campaign. At the time of testing this, the URL was not downloading any content and the URL seemed to be down. The URL shared via email is illustrated here: hxxps://officechoiceau-my(.)sharepoint.com/personal/brad_obrien_officechoice_com_au/_layouts/15/guestaccess.aspx?docid=0c38ed7472ef548cba04d894ec061f296&authkey=AbjI3ElfLWkKwdg3yJtoSIM
BSL_11408_b752102f-9ce7-40d4-b19d-47769798d82f
Figure 12: Fake Quickbook phishing email

 

The Fake Dropbox campaign:

This campaign used fake dropbox statements to lure users into clicking on attacker controlled URLs. The campaign surfaced on 21st August, 2017 and ended after a 24 hour period. Dropbox is a file hosting service. Scammers registered a fake dropbox-like domain to send fraudulent account statements as spam messages.

  1. Similar to the Xeronet campaign, the domain dropboxa.com too points to a French IP: 94.23.195.103
  2. The domain was created on 20th August, 2017 and is registered to Wang Wiet from Xiamin, China, with the email: whois-protect@hotmail.com.
  3. Browsing to the site dropboxa.com reveals a similar static HTML page with the heading "DROPBOXA.COM" using the same font and same powered-by VESTA message.
  4. A screenshot of the email message is show in Figure 13. This is a specially crafted message using a fake Dropbox email template and enticing the victim to click on the shared account statement.zip file. On clicking the "View File" button the user's browser is taken to a sharepoint URL.
  5. The attackers used a Sharepoint URL similar to the one used in the Xeronet campaign. At the time of testing this, the URL was not downloading any content and the URL seemed to be down. The URL shared via email is illustrated here: https://easyshed-my.sharepoint.com/personal/vicky_taylor_easyshed_com_au/_layouts/15/guestaccess.aspx?docid=05ab5a1c6f1364d5fac71e1ecb76ca2f6&authkey=Aafhr9BMCydDXxJRuWz6xYE
8898_406eec24-50cc-4538-8cef-46b9e6436501
Figure 13: Fake Dropbox phishing email

 

Conclusion

Attackers are leveraging the simplicity provided by the email infrastructure to distribute banking trojans to global victims. We observed one such campaign detected by our distributed honeypot sensors. These phishing messages contained a legit looking, yet spoofed email message from Xero, which is an accounting software company. The message was a professionally crafted billing message, suggesting that users to view their bill invoice online by clicking on the malicious invoice link. This malicious link leads to the download of a zip file containing a malicious obfuscated JavaScript file. Once executed, the malicious JavaScript file downloads and executes a sophisticated banking trojan onto the victim's computer. This banking trojan turned out to be a variant of the Dridex malware, targeted at stealing banking information from user's browser.

We also observed several similar campaigns throughout the week, targeting customers of other well known online accounting software companies. Such attacks have emerged as a recent trend on the attack landscape that exploit the trust that people associate with specific brands. As a mitigation measure, customers should avoid opening any email messages that appear suspicious, especially avoid opening any unknown downloaded files. Customers should also refrain from opening zip archives that come from unknown sources and avoid executing unknown file format like JavaScript, as a lot of malware has been seen recently being distributed by such scripts.

Acknowledgement

We would like to thank Gerald Carsula for his contributions and Phil Hay and Karl Sigler for their valuable comments and feedback.

ABOUT TRUSTWAVE

Trustwave is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.

Latest Intelligence

Discover how our specialists can tailor a security program to fit the needs of
your organization.

Request a Demo