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
Commentary
How SolarWinds Busted Up Our Assumptions About Code Signing
Dr. Jethro Beekman, Technical Director,  3/3/2021
News
'ObliqueRAT' Now Hides Behind Images on Compromised Websites
Jai Vijayan, Contributing Writer,  3/2/2021
News
Attackers Turn Struggling Software Projects Into Trojan Horses
Robert Lemos, Contributing Writer,  2/26/2021
Register for Dark Reading Newsletters
White Papers
Video
Cartoon Contest
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
How Enterprises are Developing Secure Applications
How Enterprises are Developing Secure Applications
Recent breaches of third-party apps are driving many organizations to think harder about the security of their off-the-shelf software as they continue to move left in secure software development practices.
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2021-21510
PUBLISHED: 2021-03-08
Dell iDRAC8 versions prior to 2.75.100.75 contain a host header injection vulnerability. A remote unauthenticated attacker may potentially exploit this vulnerability by injecting arbitrary ‘Host’ header values to poison a web-cache or trigger redirections.
CVE-2020-27575
PUBLISHED: 2021-03-08
Maxum Rumpus 8.2.13 and 8.2.14 is affected by a command injection vulnerability. The web administration contains functionality in which administrators are able to manage users. The edit users form contains a parameter vulnerable to command injection due to insufficient validation.
CVE-2020-27576
PUBLISHED: 2021-03-08
Maxum Rumpus 8.2.13 and 8.2.14 is affected by cross-site scripting (XSS). Users are able to create folders in the web application. The folder name is insufficiently validated resulting in a stored cross-site scripting vulnerability.
CVE-2020-27838
PUBLISHED: 2021-03-08
A flaw was found in keycloak in versions prior to 13.0.0. The client registration endpoint allows fetching information about PUBLIC clients (like client secret) without authentication which could be an issue if the same PUBLIC client changed to CONFIDENTIAL later. The highest threat from this vulner...
CVE-2021-21503
PUBLISHED: 2021-03-08
PowerScale OneFS 8.1.2,8.2.2 and 9.1.0 contains an improper input sanitization issue in a command. The Compadmin user could potentially exploit this vulnerability, leading to potential privileges escalation.