Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

kernel mode anti cheat

License

NotificationsYou must be signed in to change notification settings

donnaskiez/ac

Repository files navigation

open source anti cheat (lol) which I made for fun.

features

  • Attached thread detection
  • Process module .text section integrity checks
  • NMI stackwalking via isr iretq
  • APC, DPC stackwalking
  • Return address exception hooking detection
  • Chained .data pointer detection (iffy)
  • Handle stripping via obj callbacks
  • Process handle table enumeration
  • System module device object verification
  • System module .text integrity checks
  • Removal of threads cid table entry detection
  • Driver dispatch routine validation
  • Extraction of various hardware identifiers
  • EPT hook detection
  • Various image integrity checks both of driver + module
  • Hypervisor detection
  • HalDispatch and HalPrivateDispatch routine validation
  • Dynamic import resolving & encryption
  • Malicious PCI device detection via configuration space scanning
  • Win32kBase_DxgInterface routine validation

architecuture

  • todo!

planned features

Theres a long list of features I still want to implement, the question is whether I can be bothored implementing them. I would say I'd accept pull requests for new features but I would expect high quality code and thorough testing with verifier (both inside a vm and bare metal).

example

  • I have recorded an example of the program running with CS2. Note that vac was obviously disabled.If you decide to test with a steam game do not forget to launch in insecure mode
  • Shown are the kernelVERBOSE level logs in DebugView along with the usermode application console and some additional performance benchmarking things.
  • (You can find the video here)[https://youtu.be/b3mH7w8pOxs]

known issues

windows versions tested:

  • Win10 22H2
  • Win11 22H2

how to build

RequiresVisual Studio and theWDK for compilation.

test signing mode

Before we continue, ensure you enable test signing mode as this driver is not signed.

  1. Open a command prompt as Administrator
  2. Enter the following commands:
bcdedit -set TESTSIGNING onbcdedit /debug on
  1. Restart Windows

building and running the project

  1. Clone the project i.egit clone git@github.com:donnaskiez/ac.git
  2. Open the project in visual studio
  3. SelectRelease - No Server - Win10 orRelease - No Server - Win11 depending on the version of Windows you will be running the driver on.
  4. Build the project in visual studio, if you experience any build issues - check the drivers project settings are the following:
    • Inf2Cat -> General -> Use Local Time toYes
    • C/C++ -> Treat Warnings As Errors toNo
    • C/C++ -> Spectre Mitigation toDisabled
  5. Move thedriver.sys file located inac\x64\Release - No Server\ into theWindows\System32\Drivers directory
    • You can rename the driver if you would like
  6. Use theOSR Loader and selectdriver.sys (or whatever you named it) that you moved to the Windows drivers folder.DO NOT REGISTER THE SERVICE YET.
  7. UnderService Start selectSystem. This is VERY important!
  8. ClickRegister Service.Do NOT clickStart Service!
  9. Restart Windows.
  10. Once restarted, open the program you would like to protect. This could be anything i.e cs2, notepad etc.
    • if you do use a game to test, ensure the games anti-cheat is turned off before testing
  11. Open your dll injector of choice (I simply useProcess Hacker)
  12. Inject the dll found inac\x64\Release - No Server\ nameduser.dll into the target program

Logs will be printed to both the terminal output and the kernel debugger. See below for configuring kernel debugger output.

Note: The server is not needed for the program to function properly.

how to configure kernel debugging output

The kernel driver is setup to log at 4 distinct levels:

#defineLOG_ERROR_LEVEL  #define LOG_WARNING_LEVEL#defineLOG_INFO_LEVEL   #define LOG_VERBOSE_LEVEL

As the names suggest,ERROR_LEVEL is for errors,WARNING_LEVEL is for warnings.INFO_LEVEL is for general information regarding what requests the driver is processing andVERBOSE_LEVEL contains very detailed information for each request.

creating the registry key

If you are unfamiliar with the kernel debugging mask, you probably need to set one up. If you already have a debugging mask setup, you can skip tosetting the mask below.

  1. Open the Registry Editor
  2. Copy and paseComputer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager into the bar at the top and press enter
  3. On the left hand side, right clickSession Manager and selectNew -> Key
  4. Name the keyDebug Print Filter
  5. On the left hand side you should now seeDebug Print Filter, right click and selectNew -> DWORD (32 bit) Value
  6. Name the keyDEFAULT

setting the mask

  1. Within theDebug Print Filter registry, double click the key namedDEFAULT
  2. Determine the level(s) of logging you would like to see. For most people interested I would set eitherINFO_LEVEL orVERBOSE_LEVEL. Remember that if you setINFO_LEVEL, you will see allINFO_LEVEL,WARNING_LEVEL andERROR_LEVEL logs. Ie you see all logs above and including your set level.
ERROR_LEVEL    = 0x3WARNING_LEVEL  = 0x7INFO_LEVEL     = 0xfVERBOSE_LEVEL  = 0x1f
  1. Enter the value for the given logging level (seen above)
  2. ClickOk and restart Windows.

filtering debug output

If you choose to useINFO_LEVEL orVERBOSE_LEVEL there may be many logs from the kernel so we want to filter them out.

windbg

With WinDbg connected to the target:

  1. Pause the target using theBreak button
  2. Use the command:.ofilter donna-ac*

debugview

  1. ClickEdit -> Filter/Highlight
  2. Set theInclude string todonna-ac*

License

We have decided to put this Project underAGPL-3.0!https://choosealicense.com/licenses/agpl-3.0/

contact

feel free to dm me on discord or uc @donnaskiez


[8]ページ先頭

©2009-2025 Movatter.jp