Dark Reading is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Endpoint

4/21/2020
05:00 PM
Connect Directly
Twitter
LinkedIn
RSS
E-Mail
100%
0%

Researchers Use Microsoft Terminal Services Client in New Attack Method

The technique would enable attackers to run malicious code via Remote Desktop Protocol using DLL side-loading to bypass security controls.

Researchers have discovered a defense evasion technique that could allow attackers to run malicious code through the Microsoft Remote Desktop Protocol (RDP) using an attack tactic called DLL side-loading. The method leverages Microsoft Terminal Services Client (MSTSC). 

Cymulate team members were researching MSTSC and RDP when they discovered the technique, which can be used to bypass security controls, CTO Avihai Ben-Yossef writes in an email to Dark Reading. As far as the researchers know, this strategy has not been used in active attacks.

DLL side-loading, as it's labeled in the MITRE ATT&CK framework, can happen when programs "improperly or vaguely specify a required DLL." As a result, they may be open to a vulnerability in which an unintended DLL is loaded into the program. Attackers can take advantage of legitimate programs vulnerable to side-loading to load a malicious DLL and mask any malicious actions they take under the guise of a trusted system or process.

To run RDP, users access the MSTSC in Windows to take control of a remote computer or virtual machine using a network connection, the researchers explain in a blog post. MSTSC relies on a DLL file (mstscax.dll) as one of its resources. Researchers learned MSTSC performs delay-loading of mstscax.dll with a behavior that can lead to attackers slipping past security controls. The executable loads "mstscax.dll" with no integrity checks to validate the library's code, they say.

There are two ways to exploit this, Ben-Yossef explains. An attacker could replace the DLL mstscax.dll in the folder c:\windows\system32, which requires local administrative privileges. "Most attackers are gaining local administrative privileges in various techniques and therefore will be able to exploit this for post-exploitation and evasion usage," he continues.

In another scenario, an attacker could copy mstsc.exe to an external folder, placing the DLL in the same folder and running mstsc from there. This does not require admin privileges, Ben-Yossef notes. Microsoft says the mstsc should not be used outside the folder c:\windows\system32; however, this is not enforced, Ben-Yossef says.

Both scenarios let an attacker bypass security controls because malicious code runs under the context of mstsc.exe, which is a Microsoft-signed executable. The first scenario will allow attackers to persist, he adds, because mstsc.exe will run the malicious code every time it's used.

"Attackers can take advantage of the fact that most security controls are not securing mstsc.exe as it is a widespread software signed by Microsoft," Ben-Yossef explains. "So if a malicious code runs under its context, it has high chance of not being detected."

Cymulate contacted Microsoft to share its findings on April 12, and the company declined to develop a patch. Compromising the Remote Desktop client by planting DLLs in a trusted directory would require an attacker to have administrator privileges, Microsoft explains. The company offers additional guidance on how DLL planting vulnerabilities are handled. Based on where the malicious DLL can be planted, the vulnerability may fall into different categories.

Organizations that want to mitigate this threat can disable the use of mstsc.exe, use security controls to monitor malicious abnormal behavior being executed by mstsc.exe, and manually validate that the DLL mstscax.dll in the same folder as the real DLL signed by Microsoft, and not a fake one, Ben-Yossef says.

Related Content:

Check out The Edge, Dark Reading's new section for features, threat data, and in-depth perspectives. Today's featured story: "How Can I Help My Users Spot Disinformation?"

Kelly Sheridan is the Staff Editor at Dark Reading, where she focuses on cybersecurity news and analysis. She is a business technology journalist who previously reported for InformationWeek, where she covered Microsoft, and Insurance & Technology, where she covered financial ... View Full Bio
 

Recommended Reading:

Comment  | 
Print  | 
More Insights
Comments
Newest First  |  Oldest First  |  Threaded View
Manchester United Suffers Cyberattack
Dark Reading Staff 11/23/2020
As 'Anywhere Work' Evolves, Security Will Be Key Challenge
Robert Lemos, Contributing Writer,  11/23/2020
Cloud Security Startup Lightspin Emerges From Stealth
Kelly Sheridan, Staff Editor, Dark Reading,  11/24/2020
Register for Dark Reading Newsletters
White Papers
Video
Cartoon Contest
Write a Caption, Win an Amazon Gift Card! Click Here
Latest Comment: This comment is waiting for review by our moderators.
Current Issue
2021 Top Enterprise IT Trends
We've identified the key trends that are poised to impact the IT landscape in 2021. Find out why they're important and how they will affect you today!
Flash Poll
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2019-20934
PUBLISHED: 2020-11-28
An issue was discovered in the Linux kernel before 5.2.6. On NUMA systems, the Linux fair scheduler has a use-after-free in show_numa_stats() because NUMA fault statistics are inappropriately freed, aka CID-16d51a590a8c.
CVE-2020-29368
PUBLISHED: 2020-11-28
An issue was discovered in __split_huge_pmd in mm/huge_memory.c in the Linux kernel before 5.7.5. The copy-on-write implementation can grant unintended write access because of a race condition in a THP mapcount check, aka CID-c444eb564fb1.
CVE-2020-29369
PUBLISHED: 2020-11-28
An issue was discovered in mm/mmap.c in the Linux kernel before 5.7.11. There is a race condition between certain expand functions (expand_downwards and expand_upwards) and page-table free operations from an munmap call, aka CID-246c320a8cfe.
CVE-2020-29370
PUBLISHED: 2020-11-28
An issue was discovered in kmem_cache_alloc_bulk in mm/slub.c in the Linux kernel before 5.5.11. The slowpath lacks the required TID increment, aka CID-fd4d9c7d0c71.
CVE-2020-29371
PUBLISHED: 2020-11-28
An issue was discovered in romfs_dev_read in fs/romfs/storage.c in the Linux kernel before 5.8.4. Uninitialized memory leaks to userspace, aka CID-bcf85fcedfdd.