4
Most read
5
Most read
15
Most read
Sticky Keys to the
Kingdom
PRE-AUTH SYSTEM RCE ON WINDOWS IS MORE COMMON THAN YOU THINK
DENNIS MALDONADO & TIM MCGUFFIN
LARES
About Us
• Dennis Maldonado
• Adversarial Engineer – LARES Consulting
• Founder
• Houston Locksport
• Houston Area Hackers Anonymous (HAHA)
• Tim McGuffin
• RedTeam Manager – LARES Consulting
• 10-year DEFCON Goon
• DEFCON CTF Participant
• Former CCDCTeam Coach
www.lares.com
History
• “How to ResetWindows Passwords” websites
• Replace sethc.exe or utilman.exe with cmd.exe
• Reboot, Press Shift 5x orWIN+U
• net user (username) (password)
• Login!
• Nobody ever cleans up after themselves
• Can be used as a backdoor/persistence method
• NoWindows Event Logs are generated when backdoor is executed
Implementation
• Binary Replacement
• Replace any of the accessibility tool binaries
• Requires elevated rights
• Registry (Debugger Method)
• HKLMSoftwareMicrosoftWindows
NTCurrentVersionImage File Execution
Optionssethc.exe
• Debugger REG_SZ C:WindowsSystem32cmd.exe
• Requires elevated rights
Windows Accessibility Tools
Binary Description How to access
C:WindowsSystem32sethc.exe Accessibility shortcut keys Shift 5 times
C:WindowsSystem32Utilman.exe Utility Manager Windows Key + U
C:WindowsSystem32osk.exe On-Screen Keyboard
Locate the option on the screen using the
mouse
C:WindowsSystem32Magnify.exe Magnifier Windows Key + [Equal Sign]
C:WindowsSystem32Narrator.exe Narrator Windows Key + Enter
C:WindowsSystem32DisplaySwitch.exe Display Switcher Windows Key + P
C:WindowsSystem32AtBroker.exe
Manages switching of apps between
desktops
Have osk.exe, Magnify.exe,
or Narrator.exe open then lock the
computer. AtBroker.exe will be executed
upon locking and unlocking
Limitations
• Elevated access or offline system required
• Replacing binary must be Digitally Signed
• Replacing binary must exist in System32
• Replacing binary must exist inWindows “Protected File” list
• You can’t use any old Binary, but you can cmd.exe /c file.bat
Background
• While working with an Incident ResponseTeam:
• Uncovered dozens of vulnerable hosts via file checks
• Identification was done from the filesystem side
• Missed the debugger method
• Missed any unmanaged boxes
• Needed a network-based scanner
Background
• We wanted to write out own network-based tool
• Started down the JavaRDP/Python Path
• Ran across @ztgrace’s PoC script, Sticky Keys Hunter
• It worked, and was a great starting point
• Similar to “PeepingTom”
• Opens a Remote Desktop connection
• Sends keyboard presses
• Saves screenshot to a file
• To do list including automatic command prompt detection and multi-threading
Our Solution – Sticky Key Slayer
• Parallelized scanning of multiple hosts
• Automated command prompt detection
• Detailed logging
• Error handling
• Performance improvements
• Bash
DEMO
VIDEO:
HTTPS://WWW.YOUTUBE.COM/WATCH?V=JY4HG4A1FYI
Sticky Keys to the Kingdom
Sticky Keys to the Kingdom
Sticky Keys to the Kingdom
Sticky Keys to the Kingdom
Tools Usage
• ./stickyKeysSlayer.sh -v -j 8 -t 10 targetlist.txt
• -v
• Verbose output
• -j <num_of_jobs>
• Jobs to run (defaults to 1)
• -t <time_in_seconds>
• Timeout in seconds (defaults to 30 seconds)
• targetlist.txt
• Hosts list delimited by line
Limitations
• Ties up a LinuxVM while scanning
• Needed for window focus and screenshotting
• Will not alert on anything that is not cmd.exe
• Ran across taskmgr.exe, mmc.exe, other custom applications
Statistics
• On a large Business ISP:
• Over 100,000 boxes scanned
• About 571 Command Prompts
• 1 out of 175
• All types of Institutions
• Educational Institutions
• Law Offices
• Manufacturing Facilities
• Gaming companies
• Etc…
Recommendations
• Remediation
• Delete or replace the affected file (sethc.exe, utilman.exe, …)
• sfc.exe /scannnow
• Remove the affected registry entry
• Treat this as an indicator of compromise
• Prevention and Detection
• Restrict local administrative access
• Enable full disk encryption
• Network LevelAuthentication for Remote Desktop Connection
• End point monitoring
• Netflow analysis
Tool Release
• Code is on Github
• https://github.com/linuz/Sticky-Keys-Slayer
• Contribute
• Report Issues
• Send us feedback
• Slides
• http://www.slideshare.net/DennisMaldonado5/sticky-keys-
to-the-kingdom
• DemoVideo
• https://www.youtube.com/watch?v=Jy4hg4a1FYI
www.lares.com
Questions
www.lares.com

More Related Content

PDF
Derbycon - The Unintended Risks of Trusting Active Directory
PPTX
PowerShell for Practical Purple Teaming
PDF
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
PDF
0wn-premises: Bypassing Microsoft Defender for Identity
PDF
PHDays 2018 Threat Hunting Hands-On Lab
PPTX
Detection Rules Coverage
PDF
【de:code 2020】 Azure Sentinel - クラウドネイティブ SIEM&SOAR の活用
PPTX
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Derbycon - The Unintended Risks of Trusting Active Directory
PowerShell for Practical Purple Teaming
I'm in your cloud... reading everyone's email. Hacking Azure AD via Active Di...
0wn-premises: Bypassing Microsoft Defender for Identity
PHDays 2018 Threat Hunting Hands-On Lab
Detection Rules Coverage
【de:code 2020】 Azure Sentinel - クラウドネイティブ SIEM&SOAR の活用
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...

What's hot (20)

PDF
Bypass_AV-EDR.pdf
PPTX
Owasp Top 10 A1: Injection
PDF
How MITRE ATT&CK helps security operations
PDF
Secure Coding principles by example: Build Security In from the start - Carlo...
PDF
Red Team Methodology - A Naked Look
PDF
MITRE ATT&CKcon 2.0: Using Threat Intelligence to Focus ATT&CK Activities; Da...
PPTX
BlueHat v17 || Dangerous Contents - Securing .Net Deserialization
PDF
Secure coding presentation Oct 3 2020
PDF
Live Hacking like a MVH – A walkthrough on methodology and strategies to win big
PDF
Web Application Penetration Testing
PDF
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
PDF
Insecure direct object reference (null delhi meet)
PPT
PKI and Applications
PDF
A Threat Hunter Himself
PDF
No Easy Breach DerbyCon 2016
PDF
IDOR Know-How.pdf
PPTX
Building an Empire with PowerShell
PPTX
Catch Me If You Can: PowerShell Red vs Blue
PDF
When Insiders ATT&CK!
PPTX
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
Bypass_AV-EDR.pdf
Owasp Top 10 A1: Injection
How MITRE ATT&CK helps security operations
Secure Coding principles by example: Build Security In from the start - Carlo...
Red Team Methodology - A Naked Look
MITRE ATT&CKcon 2.0: Using Threat Intelligence to Focus ATT&CK Activities; Da...
BlueHat v17 || Dangerous Contents - Securing .Net Deserialization
Secure coding presentation Oct 3 2020
Live Hacking like a MVH – A walkthrough on methodology and strategies to win big
Web Application Penetration Testing
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
Insecure direct object reference (null delhi meet)
PKI and Applications
A Threat Hunter Himself
No Easy Breach DerbyCon 2016
IDOR Know-How.pdf
Building an Empire with PowerShell
Catch Me If You Can: PowerShell Red vs Blue
When Insiders ATT&CK!
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
Ad

Viewers also liked (13)

PPTX
Hacking Access Control Systems
PPTX
Getting Started in Information Security
PPTX
Metasploit for Web Workshop
PDF
Zpusob Vyuky Marketingove Komunikace Na Pef Czu V Praze
DOC
Same Origin Policy Weaknesses
PDF
Paměťové techniky
PDF
Techniky učení
PDF
ePUB 3 and Publishing e-books
PPTX
Evaluating and Selecting a Learning Management System
PPTX
Windows 7 Security
PPTX
Access Controls Attacks
PPTX
Kali net hunter
PPT
Building An Information Security Awareness Program
Hacking Access Control Systems
Getting Started in Information Security
Metasploit for Web Workshop
Zpusob Vyuky Marketingove Komunikace Na Pef Czu V Praze
Same Origin Policy Weaknesses
Paměťové techniky
Techniky učení
ePUB 3 and Publishing e-books
Evaluating and Selecting a Learning Management System
Windows 7 Security
Access Controls Attacks
Kali net hunter
Building An Information Security Awareness Program
Ad

Similar to Sticky Keys to the Kingdom (20)

PDF
Ranger BSides-FINAL
PPTX
Defending Your "Gold"
PPTX
Owning computers without shell access 2
PPTX
Windows Malware Techniques
PPTX
BSIDES-PR Keynote Hunting for Bad Guys
PPTX
Заполучили права администратора домена? Игра еще не окончена
PDF
Cleartext and PtH still alive
PPTX
Hogy jussunk ki lezárt hálózatokból?
KEY
Time tested php with libtimemachine
PPTX
PowerShell - Be A Cool Blue Kid
PDF
CNIT 121: 12 Investigating Windows Systems (Part 3)
PDF
Salt at school
PDF
CNIT 152 12. Investigating Windows Systems (Part 3)
PDF
CNIT 152: 12b Windows Registry
PDF
Automate Thyself
PDF
CNIT 152 12 Investigating Windows Systems (Part 2)
PDF
CNIT 152 10 Enterprise Service
PPTX
On non existent 0-days, stable binary exploits and
KEY
Monitoring and Debugging your Live Applications
PPTX
Pentest Apocalypse - SANSFIRE 2016 Edition
Ranger BSides-FINAL
Defending Your "Gold"
Owning computers without shell access 2
Windows Malware Techniques
BSIDES-PR Keynote Hunting for Bad Guys
Заполучили права администратора домена? Игра еще не окончена
Cleartext and PtH still alive
Hogy jussunk ki lezárt hálózatokból?
Time tested php with libtimemachine
PowerShell - Be A Cool Blue Kid
CNIT 121: 12 Investigating Windows Systems (Part 3)
Salt at school
CNIT 152 12. Investigating Windows Systems (Part 3)
CNIT 152: 12b Windows Registry
Automate Thyself
CNIT 152 12 Investigating Windows Systems (Part 2)
CNIT 152 10 Enterprise Service
On non existent 0-days, stable binary exploits and
Monitoring and Debugging your Live Applications
Pentest Apocalypse - SANSFIRE 2016 Edition

Recently uploaded (20)

PDF
sbt 2.0: go big (Scala Days 2025 edition)
PDF
Advancing precision in air quality forecasting through machine learning integ...
PPTX
Module 1 Introduction to Web Programming .pptx
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
SaaS reusability assessment using machine learning techniques
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
PPTX
Training Program for knowledge in solar cell and solar industry
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PPTX
Configure Apache Mutual Authentication
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
PDF
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
PDF
Co-training pseudo-labeling for text classification with support vector machi...
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PDF
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
sbt 2.0: go big (Scala Days 2025 edition)
Advancing precision in air quality forecasting through machine learning integ...
Module 1 Introduction to Web Programming .pptx
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
giants, standing on the shoulders of - by Daniel Stenberg
Lung cancer patients survival prediction using outlier detection and optimize...
Rapid Prototyping: A lecture on prototyping techniques for interface design
SGT Report The Beast Plan and Cyberphysical Systems of Control
SaaS reusability assessment using machine learning techniques
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
Training Program for knowledge in solar cell and solar industry
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
Configure Apache Mutual Authentication
NewMind AI Weekly Chronicles – August ’25 Week IV
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
Co-training pseudo-labeling for text classification with support vector machi...
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」

Sticky Keys to the Kingdom

  • 1. Sticky Keys to the Kingdom PRE-AUTH SYSTEM RCE ON WINDOWS IS MORE COMMON THAN YOU THINK DENNIS MALDONADO & TIM MCGUFFIN LARES
  • 2. About Us • Dennis Maldonado • Adversarial Engineer – LARES Consulting • Founder • Houston Locksport • Houston Area Hackers Anonymous (HAHA) • Tim McGuffin • RedTeam Manager – LARES Consulting • 10-year DEFCON Goon • DEFCON CTF Participant • Former CCDCTeam Coach www.lares.com
  • 3. History • “How to ResetWindows Passwords” websites • Replace sethc.exe or utilman.exe with cmd.exe • Reboot, Press Shift 5x orWIN+U • net user (username) (password) • Login! • Nobody ever cleans up after themselves • Can be used as a backdoor/persistence method • NoWindows Event Logs are generated when backdoor is executed
  • 4. Implementation • Binary Replacement • Replace any of the accessibility tool binaries • Requires elevated rights • Registry (Debugger Method) • HKLMSoftwareMicrosoftWindows NTCurrentVersionImage File Execution Optionssethc.exe • Debugger REG_SZ C:WindowsSystem32cmd.exe • Requires elevated rights
  • 5. Windows Accessibility Tools Binary Description How to access C:WindowsSystem32sethc.exe Accessibility shortcut keys Shift 5 times C:WindowsSystem32Utilman.exe Utility Manager Windows Key + U C:WindowsSystem32osk.exe On-Screen Keyboard Locate the option on the screen using the mouse C:WindowsSystem32Magnify.exe Magnifier Windows Key + [Equal Sign] C:WindowsSystem32Narrator.exe Narrator Windows Key + Enter C:WindowsSystem32DisplaySwitch.exe Display Switcher Windows Key + P C:WindowsSystem32AtBroker.exe Manages switching of apps between desktops Have osk.exe, Magnify.exe, or Narrator.exe open then lock the computer. AtBroker.exe will be executed upon locking and unlocking
  • 6. Limitations • Elevated access or offline system required • Replacing binary must be Digitally Signed • Replacing binary must exist in System32 • Replacing binary must exist inWindows “Protected File” list • You can’t use any old Binary, but you can cmd.exe /c file.bat
  • 7. Background • While working with an Incident ResponseTeam: • Uncovered dozens of vulnerable hosts via file checks • Identification was done from the filesystem side • Missed the debugger method • Missed any unmanaged boxes • Needed a network-based scanner
  • 8. Background • We wanted to write out own network-based tool • Started down the JavaRDP/Python Path • Ran across @ztgrace’s PoC script, Sticky Keys Hunter • It worked, and was a great starting point • Similar to “PeepingTom” • Opens a Remote Desktop connection • Sends keyboard presses • Saves screenshot to a file • To do list including automatic command prompt detection and multi-threading
  • 9. Our Solution – Sticky Key Slayer • Parallelized scanning of multiple hosts • Automated command prompt detection • Detailed logging • Error handling • Performance improvements • Bash
  • 15. Tools Usage • ./stickyKeysSlayer.sh -v -j 8 -t 10 targetlist.txt • -v • Verbose output • -j <num_of_jobs> • Jobs to run (defaults to 1) • -t <time_in_seconds> • Timeout in seconds (defaults to 30 seconds) • targetlist.txt • Hosts list delimited by line
  • 16. Limitations • Ties up a LinuxVM while scanning • Needed for window focus and screenshotting • Will not alert on anything that is not cmd.exe • Ran across taskmgr.exe, mmc.exe, other custom applications
  • 17. Statistics • On a large Business ISP: • Over 100,000 boxes scanned • About 571 Command Prompts • 1 out of 175 • All types of Institutions • Educational Institutions • Law Offices • Manufacturing Facilities • Gaming companies • Etc…
  • 18. Recommendations • Remediation • Delete or replace the affected file (sethc.exe, utilman.exe, …) • sfc.exe /scannnow • Remove the affected registry entry • Treat this as an indicator of compromise • Prevention and Detection • Restrict local administrative access • Enable full disk encryption • Network LevelAuthentication for Remote Desktop Connection • End point monitoring • Netflow analysis
  • 19. Tool Release • Code is on Github • https://github.com/linuz/Sticky-Keys-Slayer • Contribute • Report Issues • Send us feedback • Slides • http://www.slideshare.net/DennisMaldonado5/sticky-keys- to-the-kingdom • DemoVideo • https://www.youtube.com/watch?v=Jy4hg4a1FYI www.lares.com

Editor's Notes