windowsdanger
A REALLY Danger Windows Driver, Turn Any threads Ring0!
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.1%) to scientific vocabulary
Keywords
Repository
A REALLY Danger Windows Driver, Turn Any threads Ring0!
Statistics
- Stars: 9
- Watchers: 2
- Forks: 5
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md
WindowsDanger
WindowsDanger is an open-source project that help developers to Learn Windows Kernel and other x86 Features.
But, We are NOT modify/patch Windows Code
We Directly Modify x86 Context Instead
So, We will not bypass PatchGuard, Using Official Test-Mode Instead
This driver Dreamed to assist developers accessing and manipulating system resources more conveniently. By installing and launching this driver, you can elevate all threads to Ring0, allowing for full control over low-level hardware and system resources.
⚠️ Warning: Please be aware that using WindowsDanger may result in system instability, data loss, or other unintended consequences. Use with caution and perform testing in a safe environment.
This project is still under development. For more quick access, please use the QEMUDangerx86 project.
Ke386SetIoAccessMap and Ke386IoSetAccessProcess is NOT available in Win10/Server 2019 and above. It's better to learn how the x86 CPU work within TSS and IOPM, I just did that😎
Currently achieved: - Disable Write-Protection by modifiy CR0 - Hack Ring3 Segment in GDT to Ring0 - Hack TSS IOPM (0~FF) - Insert new user-callable IDT entries 78H and 79H, 78H will hack IOPL -> 3, while 79H will hack thread's CS & SS to Ring0 - Disable SMAP/SMEP by modify CR4 - Adapt Multi-Processor System
Known Issues:
- I'm lazy to bakup registers in interrupts-handler, so backup urself
- I'm lazy to hack EXE thread to CS=0x30, and I hate bullshit code to do that
- So I just hack it with CS=0x10 instead😎
- I'm also lazy to add bullshit hook to #GP/#PF handler to id CS=0x30
- So u'll face BSOD if ur EXE crashed
Ideas:
- Use soft int instruct from Ring3, and ret directly with kernel-context
- Hack IOPL is the same, but with RFLAGS hacked then iretq
Features
- Ring3 thread can touch IO (0~FF) directly after
int 078h - Elevate any threads to Ring0 for full control over low-level system resources by simply
int 079h - Facilitate hardware debugging and kernel-hack study
- Tested on Windows Server 2022 x64, on Hyper-V
Hint
- I recommend u play on QEMU / Physical PC, as Hyper-V may acting strange.
- I found Azure Hypervisor may strict on vmexit, if u hack CR0/GDT, u'll recieve undef exception.
Unknown exception - code c0000096 (!!! second chance !!!) WindowsDanger!Disable_WriteProtect+0x9: fffff802`662c112e 0f22c0 mov cr0,rax - If u buy PC / Network-Card, make sure it support NT-Kernel-Dbg. U can search those info on MS-Learn.
Installation
MUST Attach Kernel Debugger to prevent BSOD, because int 3 will trigger BSOD without Kernel Debugger.
- Download the latest version of the WindowsDanger driver.
- Copy the driver file to an appropriate directory (e.g.,
C:\kd). - Run the following command with administrator privileges to install the driver:
C
sc create WindowsDanger type= kernel binPath= C:\kd\WindowsDanger.sys
- Start the driver:
C sc start WindowsDanger
Play
IoCTL_Caller: Send Requests to our Kernel Driver. Supported Commands:
- 0 : Disable Write-Protection by modifiy CR0
- 1 : Hack Ring3 Segment in GDT to Ring0 & Hack TSS_IOPM
- 2 : Mapping CR3 to a Virtual Address
- 3 : Insert new user-callable IDT entries 78H and 79H
- 4 : Disable SMAP/SMEP by modify CR4
InterruptTester: Test our new IDT entries 78H and 79H
- 78H : Hack IOPL -> 3
- 79H : Hack current thread -> Ring0-Kernel !!
Please note, before you use int 078h/079h, you must Hack the GDT, Disable SMAP/SMEP, and Insert new IDT entries by (1, 4, 3).
Uninstallation
Stop the driver:
C sc stop WindowsDangerRemove the driver:
C sc delete WindowsDangerDelete the driver file.
Learning Resources
- Lab Experiment HandBooks: Contains Microsoft-Student-Ambassador Workshop, and some dbg logs
- Download WinDbg
- Install WDK
- Read Kernel Debugging Document on the Microsoft Learn
- Read My Experiment log for more details
- Cource: Arch2001x86-64OS_Internals
License
WindowsDanger is licensed under the MIT License. Please refer to the LICENSE file for more information.
Contributing
We welcome your contributions to the WindowsDanger project! Please see CONTRIBUTING.md for how to get started.
Support and Feedback
If you encounter any issues while using WindowsDanger, or have any suggestions and feedback, please submit your concerns on the Issues page.
Disclaimer
WindowsDanger is intended for learning and research purposes only. The use of this driver may result in system instability, data loss, or other unintended consequences. The project authors and contributors are not responsible for any damages or losses resulting from the use of this driver. By using WindowsDanger, you agree to assume all risks.
Owner
- Name: SuperHacker UEFI
- Login: UEFI-code
- Kind: user
- Repositories: 108
- Profile: https://github.com/UEFI-code
Microsoft Learn Student Ambassador | Bionic Researcher | Software Engineer | BISTU
Citation (CITATION.cff)
cff-version: 1.0.0
message: If you use this software, please cite it as below.
title: WindowsDanger
authors:
- family-names: WindowsDanger Team
url: https://github.com/UEFI-code/WindowsDanger
preferred-citation:
type: opensource-software-toolkit
title: "WindowsDanger: An open-source project for learning and hacking Windows kernel"
authors:
- family-names: Zhang
given-names: Shizhuo
GitHub Events
Total
- Watch event: 3
- Push event: 18
- Fork event: 2
- Commit comment event: 2
Last Year
- Watch event: 3
- Push event: 18
- Fork event: 2
- Commit comment event: 2
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| UEFI-code | z****g@h****m | 83 |
| UEFI-code | 1****1@q****m | 5 |
| = | = | 5 |