66 Windows Sticky Keys Attack

Braedyn Case

Sticky Keys is a Windows accessibility feature that lets you press keyboard shortcuts (like Ctrl + Alt + Delete or Ctrl + V) one key at a time instead of holding them down simultaneously. When you tap a modifier key (like Shift, Ctrl, or Alt), it “sticks” electronically until you press your next key. The Sticky Keys attack is a technique used to gain system-level access without a password. This attack is well-known and fairly old; it can still be used to gain unauthorized access to many modern machines today.

This lab involves using the Windows command line, and incorrect commands can permanently damage your VM so please proceed with caution!

Phase 0 – Professional Alignment

Enterprise security depends on protecting both logical and physical access to information systems. In this chapter, you will examine the Windows Sticky Keys attack, a historical privilege escalation technique that demonstrates how physical access and operating system recovery features can be abused to bypass authentication. These activities reinforce the importance of securing endpoints through full-disk encryption, secure boot processes, physical security controls, and system hardening to prevent unauthorized administrative access.

DCWF Work Roles

The knowledge and skills developed in this chapter align with the following Department of Defense Cyber Workforce Framework (DCWF) work roles:

  • 451 – System Security Analyst
  • 541 – Cyber Defense Analyst
  • 531 – Systems Administrator

NICE Work Roles

This chapter supports competencies associated with the following NICE Workforce Framework for Cybersecurity work roles:

  • Cyber Defense Analyst
  • Systems Administrator
  • Vulnerability Assessment Analyst

Professional Skills

By completing this chapter, you will begin developing the ability to:

  • Evaluate operating system authentication mechanisms for security weaknesses.
  • Demonstrate a historical privilege escalation technique within an isolated laboratory.
  • Assess the security risks associated with physical access to enterprise systems.
  • Identify operating system features that can be abused to bypass authentication.
  • Recommend security controls that mitigate local privilege escalation attacks.
  • Document security findings and mitigation strategies to strengthen enterprise endpoint protection.

What You’ll Be Able to Do

After completing this chapter, you should be able to:

  • Explain how the Windows Sticky Keys attack bypassed authentication on vulnerable systems.
  • Demonstrate the attack within an authorized laboratory environment.
  • Analyze why unrestricted physical access increases enterprise security risk.
  • Identify operating system and hardware protections that prevent this class of attack, including full-disk encryption and secure boot technologies.
  • Evaluate the effectiveness of modern Windows security controls against local privilege escalation techniques.
  • Recommend enterprise hardening measures that reduce the risk of unauthorized physical access attacks.

LEARNING OBJECTIVES

  • Explore weaknesses in the Windows Recovery feature.
  • Gain system-level access without a password.

PREREQUISITES

DELIVERABLES

  • Research and write a few sentences about how to defend against Sticky Keys.

RESOURCES

CONTRIBUTORS AND TESTERS

  • Antionette Hults, Cybersecurity Student, ERAU-Prescott
  • Mathew J. Heath Van Horn, PhD

NOTE: This lab exploits the out-of-the-box weaknesses of Windows 11 HOME; it will not work on Windows 11 Pro. To make sure that you can complete this lab, please make sure that you are running Windows 11 HOME by clicking the Windows Key + R and typing winver to check your Windows Version inside your virtual machine. If you want to use Windows 11 Pro, or can’t get access to a Windows 11 Home virtual machine, ensure that BitLocker is disabled on the target virtual machine.

Screenshot Instructions
Figure 0.5 – Check Windows Edition

Phase I – Prepare the lab

Enter the Microsoft Windows Recovery Environment.

  1. Start with a Windows Home VM running in VirtualBox,
  2. Start the Windows VM
  3. From the Windows lock screen, go to the bottom right corner and click on the power icon
  4.  Hold Shift and click Restart to enter the Recovery Environment

    NOTE: Sometimes when entering the Recovery Environment in VirtualBox, the VM gets stuck on a black screen. If this happens, go to the top of the VM window and click Machine > Reset to proceed.

     

    Screenshot Instructions
    Figure 1 – Restarting from lock screen

     

    Phase II – Exploit a windows weakness

    Use the Recovery Environment Command Prompt to exploit a weakness in Microsoft’s Accessibility tools (In this case, being sticky keys).

  5. Once in the Recovery Environment, click TroubleshootAdvanced Options Command Prompt
  6. Once in the command prompt, enter the two following commands
    1. Powershell Commands
    2. Powershell Commands
    3.  When prompted to overwrite C:\Windows\System32\sethc.exe type Yes
      Screenshot Instructions
      Figure 2 – Entering commands in Recovery command prompt

      NOTE: Windows Pro has BitLocker enabled by default, which would cause these commands to fail because the disk is encrypted. Windows Home doesn’t come with BitLocker by default, making devices running Windows Home vulnerable to this attack.

  7. Type exit to leave the command prompt
  8. Once out of the command prompt, click Continue to go back to the Windows lock screen
  9. Once on the lock screen, press the Shift key 5 times and wait for the pop-up to appear. You will notice that instead of the normal sticky keys prompt, a command prompt will open
  10.  type whoami into the command prompt “nt authority\system” should appear
    Screenshot Instructions
    Figure 3 – Command Prompt in lock screen

    Phase III – Create a new user

    We will now use the system account nt authority\system to create a new user and grant them administrator privileges, providing us with full access to the virtual machine.

  11. In the open command prompt type in the following commands to create the new user “Sticky” with the password “Test” then assign them as a system administrator
    1. net user Sticky Test /add

    2. net localgroup administrators Sticky /add

    3. Type exit to leave the command prompt
      Screenshot Instructions
      Figure 4 – Entering commands in elevated command prompt
  12. Restart the Virtual Machine by clicking Machine Reset
    Screenshot Instructions
    Figure 5 – Restarting VM

     

  13. Once the Virtual Machine restarts, go to the login screen; in the bottom left, there should be a new user called Sticky—click on Sticky and sign in using the password Test
    Screenshot Instructions
    Figure 6 – Login as Sticky

     

  14. Upon sign-in, follow the Microsoft Out-Of-Box Experience until you arrive at the Desktop, then navigate to Settings
  15. From Settings go to Accounts, the user Sticky will show as an Administrator giving full access to the virtual machine
    Screenshot Instructions
    Figure 7 – Newly made Sticky user with Administrator privileges

    Phase IV – Restoring the system to default

    Restoring the Stick Keys’ default behavior.

NOTE: This is the end of the Sticky Keys lab exercise. The next steps are only to restore sticky keys functionality and aren’t a part of the attack.

  1. From Settings, go to System Recovery 
  2. Find the option called Advanced Startup and click on Restart now
  3. Once in the Windows Recovery Environment click on Troubleshoot Advanced options Command Prompt
  4. Type in the following Command to restore sticky key functionality
    1. Custom Formatting screenshot
    2. When prompted to overwrite C:\Windows\System32\sethc.exe type Yes
  5.  Type exit to leave the command prompt
  6. Click on Continue to go back to the Windows lock screen
  7. Spam the shift key 5 times and the normal stick keys pop-up should appear
    Screenshot Instructions
    Figure 8 – Normal Stick Keys pop-up

Career Connection

Understanding historical attack techniques helps enterprise security professionals recognize why modern security controls exist and how they should be implemented. Systems administrators, cybersecurity analysts, and incident responders routinely evaluate endpoint security configurations to ensure that authentication mechanisms cannot be bypassed through physical access or recovery tools. The skills developed in this chapter reinforce the importance of combining operating system hardening, encryption, firmware security, and physical access controls to protect enterprise systems from local privilege escalation and unauthorized administrative access.

End of Lab

Feedback email
Figure 00 – Contact us via prmaster@erau.edu

 

License

Icon for the Creative Commons Attribution-NonCommercial 4.0 International License

Mastering Enterprise Networks (3rd Ed) Copyright © 2026 by Mathew J. Heath Van Horn is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License, except where otherwise noted.