A security researcher from Colombia has found a way of gaining admin rights and boot persistence on Windows PCs that’s simple to execute and hard to stop –all the features that hackers and malware authors are looking for from an exploitation technique.
What’s more surprising, is that the technique was first detailed way back in December 2017, but despite its numerous benefits and ease of exploitation, it has not received either media coverage nor has it been seen employed in malware campaigns.
Discovered by Sebastián Castro, a security researcher for CSL, the technique targets one of the parameters of Windows user accounts known as the Relative Identifier (RID).
The RID is a code added at the end of account security identifiers (SIDs) that describes that user’s permissions group. There are several RIDs available, but the most common ones are 501 for the standard guest account, and 500 for admin accounts.
Castro, with help from CSL CEO Pedro García, discovered that by tinkering with registry keys that store information about each Windows account, he could modify the RID associated with a specific account and grant it a different RID, for another account group.
The technique does not allow a hacker to remotely infect a computer unless that computer has been foolishly left exposed on the Internet without a password.
But in cases where a hacker has a foothold on a system –via either malware or by brute-forcing an account with a weak password– the hacker can give admin permissions to a compromised low-level account, and gain a permanent backdoor with full SYSTEM access on a Windows PC.
Since registry keys are also boot persistent, any modifications made to an account’s RID remain permanent, or until fixed.
The attack is also very reliable, being tested and found to be working on Windows versions going from XP to 10 and from Server 2003 to Server 2016, although even older versions should be vulnerable, at least in theory.
“It is not so easy to detect when exploited, because this attack could be deployed by using OS resources without triggering any alert to the victim,” Castro told ZDNet in an interview last week.
“On the other hand, I think is easy to spot when doing forensics operations, but you need to know where to look at.
“It is possible to find out if a computer has been a victim of RID hijacking by looking inside the [Windows] registry and checking for inconsistencies on the SAM [Security Account Manager],” Castro added.
A dead giveaway is if a guest account’s SID ends with a “500” RID, a clear hint the guest account has admin rights and that someone has tampered with the registry keys.
The CSL researcher has created and released a module for the Metasploit Framework that automates the attack, for pen-testing purposes.
“We reached out Microsoft as soon as the module was developed, but we did not receive any kind of response from them,” Castro told us. “And no, it is not already patched.”
It is unclear why Microsoft hasn’t responded, but the researcher has been on a tour this summer, presenting his findings at various cyber-security conferences, such as Sec-T, RomHack, and DerbyCon. A video of his most recent presentation is embedded below.
“As far as I know, there was no internet documentation about this particular attack when I published the blog describing it,” Castro told ZDNet. “Since this is a simple technique, I do not think that only my company and I knew about this.”
But while some clever hacks like the one Castro has documented have been known to slip through and get no media coverage, they often don’t go unnoticed by malware authors.
RID hijacking is simple, stealthy, and persistent –just what hackers like most about Windows flaws. But in this case, RID hijacking appears to have slipped by malware authors as well.
“I am not aware of any malware using this persistence technique,” Castro told us. “I asked some malware analysts about it, but they told me they have not seen this implemented on malware.”