All Projects → SweetIceLolly → Prevent_Process_Creation

SweetIceLolly / Prevent_Process_Creation

Licence: MIT license
Record & prevent process creation in kernel mode

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Prevent Process Creation

windows-process-monitor
A demo solution to illustrate approaches on getting information about processes and block/allow their start
Stars: ✭ 89 (+187.1%)
Mutual labels:  driver, process-monitor
KMAC
Some usefull info when reverse engineering Kernel Mode Anti-Cheat
Stars: ✭ 31 (+0%)
Mutual labels:  driver, kernel-driver
Mirage
kernel-mode Anti-Anti-Debug plugin. based on intel vt-x && ept technology
Stars: ✭ 272 (+777.42%)
Mutual labels:  driver, windbg
Driver.NET
Lightweight and flexible library to load and communicate with kernel drivers on Windows.
Stars: ✭ 59 (+90.32%)
Mutual labels:  driver, kmdf
Wdbgark
WinDBG Anti-RootKit Extension
Stars: ✭ 450 (+1351.61%)
Mutual labels:  driver, windbg
windbg-workspace
No description or website provided.
Stars: ✭ 23 (-25.81%)
Mutual labels:  windbg
r8125-esxi
Realtek RTL8125 driver for ESXi 6.7
Stars: ✭ 163 (+425.81%)
Mutual labels:  driver
aioch
aioch - is a library for accessing a ClickHouse database over native interface from the asyncio
Stars: ✭ 145 (+367.74%)
Mutual labels:  driver
nrf24
nrf24l01 linux device driver
Stars: ✭ 20 (-35.48%)
Mutual labels:  kernel-driver
rust-memcache
memcache client for rust
Stars: ✭ 106 (+241.94%)
Mutual labels:  driver
crystal-mysql
MySQL connector for Crystal
Stars: ✭ 102 (+229.03%)
Mutual labels:  driver
rssd
Rohde & Schwarz SCPI Driver (in Python)
Stars: ✭ 25 (-19.35%)
Mutual labels:  driver
theCore
theCore: C++ embedded framework
Stars: ✭ 76 (+145.16%)
Mutual labels:  driver
ridesharing-ios
Ridesharing driver & rider sample apps using HyperTrack SDK
Stars: ✭ 97 (+212.9%)
Mutual labels:  driver
ControlBlockService2
This is the driver for the ControlBlock re.v 2.X, a power switch and input/output/gameapd gadget for the Raspberry Pi
Stars: ✭ 18 (-41.94%)
Mutual labels:  driver
DbgPkg
Scripts to prepare Windows system for debugging.
Stars: ✭ 30 (-3.23%)
Mutual labels:  windbg
tarantool-php
PECL PHP driver for Tarantool
Stars: ✭ 82 (+164.52%)
Mutual labels:  driver
moon c
문c 블로그 with ARM64 Linux Kernel 5.x
Stars: ✭ 17 (-45.16%)
Mutual labels:  driver
fluent-provider
A provider for including Fluent in Vapor applications
Stars: ✭ 13 (-58.06%)
Mutual labels:  driver
SQLCallStackResolver
Utility to resolve SQL Server callstacks to their correct symbolic form using just PDBs and without a dump file
Stars: ✭ 55 (+77.42%)
Mutual labels:  windbg

Prevent_Process_Creation

Record & prevent process creation in kernel mode

Study Notes

  1. Use PsSetCreateProcessNotifyRoutineEx to register a routine. PsSetCreateProcessNotifyRoutine has limited functionality.
  2. Using PsSetCreateProcessNotifyRoutineEx requires the image that contains the callback pointer to have IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY set in its image header. Otherwise, the function call will return STATUS_ACCESS_DENIED. (https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-pssetcreateprocessnotifyroutineex#return-value) To do this, add /integritycheck in linker parameters. (https://social.technet.microsoft.com/wiki/contents/articles/255.forced-integrity-signing-of-portable-executable-pe-files.aspx)
  3. To print PCUNICODE_STRING using DbgPrint, use %wZ format specifier.
  4. To turn off "Spectre Mitigation", go to project properties - C/C++ - Code Generation - set "Spectre Mitigation" to "Disabled".
  5. Loading a x86 driver on a x64 system will fail. StartService will give an error code 1275, which is "This driver has been blocked from loading". When you meet this error, think about architecture first, then think about if the system is really blocking it from loading.
  6. Remember to set DriverObject->DriverUnload in DriverEntry, or the driver won't be unloaded correctly. Some drivers I previously wrote didn't do this, so those drivers can't unload correctly. If the driver is not unloaded correctly, you won't be able to load it for a second time and CreateService will give an error code 1073, which is "The specified service already exists".
  7. If DriverEntry doesn't return STATUS_SUCCESS, user mode process that called StartService will receive an error even the code in the driver is executed.
  8. To prevent a process creation, modify CreateInfo parameter in PcreateProcessNotifyRoutineEx routine. (https://webcache.googleusercontent.com/search?q=cache:4vxTVzmlrd4J:https://bitnuts.de/articles/blocking_process_creation_using_a_windows_kernel_driver.html+&cd=11&hl=en&ct=clnk&gl=ca) e.g.
CreateInfo->CreationStatus = STATUS_ACCESS_DENIED;
  1. The above CreationStatus will cause a error popup when you trying to create a new process. To avoid a error message popup, we can set CreateInfo0>CreationStatus to STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY. (https://blog.csdn.net/a907763895/article/details/52863952)
  2. This method is only available for Windows Vista and above. I havn't test it on Windows XP. (https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-pssetcreateprocessnotifyroutineex#requirements)

Notes for Windbg

Finally I figured it out how to use Windbg... (I am too stupid XD)

  1. You need to install the correct version of WDK. Using the newest version is strongly suggested... Or the debugger will likely fail to connect.
  2. How to set host computer IP: bcdedit /dbgsettings net hostip:w.x.y.z port:n (https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/setting-up-a-network-debugging-connection#setting-up-the-target-computer)
  3. DbgPrint prints nothing: Enter ed nt!KD_DEFAULT_MASK 8 in Windbg to enable verbose output. (https://reverseengineering.stackexchange.com/questions/16685/how-can-i-receive-dbgprint-messages-in-windbg-on-windows-10)
  4. Using x /D xx!yy to show symbols.
  5. Load symbols: .sympath+ folder, then .reload
  6. Good reference: https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debug-universal-drivers--kernel-mode-
  7. We can use !process to list processes. !process PID verbose_level

What I want to do

Now I finally figured it out how to prevent process creation in Windows 10 x64. I am going to figure it out how to prevent file creation / deletion using kernel mode driver. I will need to learn more about file system minifilter. After doing that, I may make a simple driver that communicates with my user-mode process to show warnings when it detects process creation and file creation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].