SpiderLabs Blog

CrypKey License Service Allows Privilege Escalation | Trustwave

Written by Martin Rakhmanov | Nov 4, 2021 5:00:00 AM

Overview

CrypKey (https://www.crypkey.com/) is a third-party licensing service for Windows that integrates with existing software packages to prevent piracy and illegal duplication of software and data. I discovered that this service was installed on my system and decided to investigate it a little deeper. What I found was a trivial Privilege Escalation vulnerability and despite multiple attempts to get the vendor to patch the issue, a patch is still unavailable at the time of publication.

Attack Details

While reviewing the installed services on a Windows machine one day, I found an interesting service that runs as LocalSystem:

 

Examining filesystem activity on startup reveals access to publicly writable location:

 

The service is failing to open a file, which seems to be some configuration based on the extension.

Since the C:\ProgramData location allows any users to write to it, any unprivileged authenticated user can just create CrypKey directory and file CKCS.INI in it with the following content:

[..\\TEMP\\M.]

Once the service is restarted (for example, after the computer is rebooted), the following file access attempt will be made:

 

Now that we know what the service is looking for, let’s make it happy and add that file with the following content (again, no privileges required since the location is TEMP under WINDOWS):

[GENERAL]
STATUS=Enabled

Now, after another service restart, it will try to load a library:

 

With this, we now know exactly what library the service is looking for. All the attacker needs to do now is add a DLL called CKConfig.DLL under C:\WINDOWS\TEMP and it will be loaded, and its startup code executed as LOCALSYSTEM.

Summary

This flaw allows privilege escalation from any regular user to LOCALSYSTEM. It requires no special tools, only a text editor to modify two configuration files and any malware masked as a DLL.

Mitigation

We initially reached out to CrypKey in June with multiple attempts to communicate the seriousness of this vulnerability. The only response we received from the vendor was that it was not interested in patching this issue and the organization gave no further explanation. Over a period of several months, Trustwave SpiderLabs attempted to convince the vendor that the issue is critical and impacted its user base. Unfortunately, the vendor did not see the importance of a patch, and we have been forced to release this advisory without an associated patch.

For user’s unable to uninstall this software, we recommend auditing any access to the configuration file: C:\ProgramData\CrypKey\CKCS.INI

Reference

TWSL2021-019: Privilege Escalation in CrypKey License Software Licensing System