Windows 10

Specially crafted Windows 10 themes and theme packs can be used in 'Pass-the-Hash' attacks to steal Windows account credentials from unsuspecting users.

Windows allows users to create custom themes that contain customized colors, sounds, mouse cursors, and the wallpaper that the operating system will use.

Windows users can then switch between different themes as desired to change the appearance of the operating system.

Change Windows theme
Change Windows theme

A theme's settings are saved under the %AppData%\Microsoft\Windows\Themes folder as a file with a .theme extension, such as 'Custom Dark.theme.'

Windows 10 theme file
Windows 10 theme file

Windows themes can then be shared with other users by right-clicking on an active theme and selecting 'Save theme for sharing,' which will package the theme into a '.deskthemepack' file.

These desktop theme packs can then be shared via email or as downloads on websites, and installed by double-clicking them.

Custom themes can be used to steal Windows passwords

This weekend security researcher Jimmy Bayne (@bohops) revealed that specially crafted Windows themes could be used to perform Pass-the-Hash attacks.

Pass-the-Hash attacks are used to steal Windows login names and password hashes by tricking a user into accessing a remote SMB share that requires authentication.

When trying to access the remote resource, Windows will automatically try to login to the remote system by sending the Windows user's login name and an NTLM hash of their password.

In a Pass-the-Hash attack, the sent credentials are harvested by the attackers, who then attempt to dehash the password to access the visitors' login name and password.

In a test previously done by BleepingComputer, dehashing an easy password took approximately 4 seconds to crack!

Cracking NTLM password hash in four seconds
Cracking NTLM password hash in four seconds

In the new method discovered by Bayne, an attacker can create a specially crafted .theme file and change the desktop wallpaper setting to use a remote authentication-required resource, such as the one below.

Malicious Windows theme file
Malicious Windows theme file
Source: Jimmy Bayne

When Windows tries to access the remote authentication-required resource, it will automatically try to log into the share by sending the NTLM hash and login name for the logged into an account.

Automatically try to log in to the resource
Automatically try to log in to the resource
Source: Jimmy Bayne

The attacker can then harvest the credentials and dehash the password using special scripts, so it's in its clear text form.

Harvesting Windows credentials
Harvesting Windows credentials
Source: Jimmy Bayne

As Pass-the-Hash attacks will send the account used to login to Windows, including a Microsoft account, this type of attack is becoming more problematic.

Since Microsoft moving away from local Windows 10 accounts and towards Microsoft accounts, remote attackers can use this attack to more easily access a myriad of remote services offered by Microsoft.

This includes being able to potentially access email, Azure, or accessible corporate networks remotely.

Bayne stated that he disclosed this attack to Microsoft earlier this year, but was told it would not be fixed as it is a "feature by design."

Protecting against malicious theme files

To protect against malicious theme files, Bayne advised that you block or re-associate the .theme, .themepack, and .desktopthemepackfile extensions to a different program.

Harvesting credentials
Harvesting credentials

Doing so, though, will break the Windows 10 Themes feature, so only use it if you do not need to switch to another theme.

Windows users can configure a group policy named 'Network security: Restrict NTLM: Outgoing NTLM traffic to remote servers' and set it to 'Deny All' to prevent your NTLM credentials from being sent to remote hosts.

Restrict NTLM: Outgoing NTLM traffic to remote servers
Restrict NTLM: Outgoing NTLM traffic to remote servers

Please note, that configuring this option may cause issues in enterprise environments that use remote shares.

For more detailed information on how to enable this policy, and the Registry values for Windows 10 Home users, you can read our dedicated 'Understanding the Windows Credential Leak Flaw and How to Prevent It' article.

Finally, BleepingComputer suggests adding multi-factor authentication to your Microsoft accounts to prevent them from being accessed remotely by attackers who successfully steal your credentials.

Related Articles:

Windows 10 KB5046613 update released with fixes for printer bugs

New Windows Themes zero-day gets free, unofficial patches

Exploit released for new Windows Server "WinReg" NTLM Relay attack

Windows 10 KB5044273 update released with 9 fixes, security updates

Windows 10 KB5043131 update released with 9 changes and fixes