Giter VIP home page Giter VIP logo

ac's Introduction

ac

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 kernel VERBOSE 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

Requires Visual Studio and the WDK 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 on
bcdedit /debug on
  1. Restart Windows

building and running the project

  1. Clone the project i.e git clone [email protected]:donnaskiez/ac.git
  2. Open the project in visual studio
  3. Select Release - No Server - Win10 or Release - 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 to Yes
    • C/C++ -> Treat Warnings As Errors to No
    • C/C++ -> Spectre Mitigation to Disabled
  5. Move the driver.sys file located in ac\x64\Release - No Server\ into the Windows\System32\Drivers directory
    • You can rename the driver if you would like
  6. Use the OSR Loader and select driver.sys (or whatever you named it) that you moved to the Windows drivers folder. DO NOT REGISTER THE SERVICE YET.
  7. Under Service Start select System. This is VERY important!
  8. Click Register Service. Do NOT click Start 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 use Process Hacker)
  12. Inject the dll found in ac\x64\Release - No Server\ named user.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:

#define LOG_ERROR_LEVEL  
#define LOG_WARNING_LEVEL
#define LOG_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 and VERBOSE_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 to setting the mask below.

  1. Open the Registry Editor
  2. Copy and pase Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager into the bar at the top and press enter
  3. On the left hand side, right click Session Manager and select New -> Key
  4. Name the key Debug Print Filter
  5. On the left hand side you should now see Debug Print Filter, right click and select New -> DWORD (32 bit) Value
  6. Name the key DEFAULT

setting the mask

  1. Within the Debug Print Filter registry, double click the key named DEFAULT
  2. Determine the level(s) of logging you would like to see. For most people interested I would set either INFO_LEVEL or VERBOSE_LEVEL. Remember that if you set INFO_LEVEL, you will see all INFO_LEVEL, WARNING_LEVEL and ERROR_LEVEL logs. Ie you see all logs above and including your set level.
ERROR_LEVEL    = 0x3
WARNING_LEVEL  = 0x7
INFO_LEVEL     = 0xf
VERBOSE_LEVEL  = 0x1f
  1. Enter the value for the given logging level (seen above)
  2. Click Ok and restart Windows.

filtering debug output

If you choose to use INFO_LEVEL or VERBOSE_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 the Break button
  2. Use the command: .ofilter donna-ac*

debugview

  1. Click Edit -> Filter/Highlight
  2. Set the Include string to donna-ac*

License

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

contact

feel free to dm me on discord or uc @donnaskiez

ac's People

Contributors

donnaskiez avatar dword64 avatar sleekz avatar vxcall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ac's Issues

DetectAttachedThreadsProcessCallback

Maybe I'm wrong, but this function doesn't work for me.

I checked, and apc_state->Process always has a zero address.
I also attached to the process many times by various programs (Cheat Engine, x64dbg), and the check (apc_state->Process == protected_process) never passed.

Windows 10 22H2 19045.2846 on VMware was used for testing.

__writecr8(high_level)

sorry for asking but does functions disable all interrupts ?

__writecr8(high_level);
_disable();

in AMD processors, the CLGI instruction disables all interrupts globally, including SVM interrupts. Is there an equivalent comprehensive interrupt-disable instruction for Intel processors ?

InitiateEptFunctionAddressArrays unexpected behavior

I found a typo in the function InitiateEptFunctionAddressArrays while reviewing the code, which caused the function not to meet the unexpected behavior.

for (INT index = 0; index < EPT_PROTECTED_FUNCTIONS_COUNT; index++) {
UNICODE_STRING current_function;
RtlInitUnicodeString(&current_function, CONTROL_FUNCTIONS[index]);
PROTECTED_FUNCTION_ADDRESSES[index] =
MmGetSystemRoutineAddress(&current_function);

It should be corrected to:

for (INT index = 0; index < EPT_PROTECTED_FUNCTIONS_COUNT; index++) {
RtlInitUnicodeString(&current_function, PROTECTED_FUNCTIONS[index]);
PROTECTED_FUNCTION_ADDRESSES[index] =
MmGetSystemRoutineAddress(&current_function);
Please correct the code in the subsequent version. thank you :}

GetStringAtIndexFromSMBIOSTable failed

Windows 11
23H2
22631.3527

00000001 0.00000000 donna-ac : [VERBOSE] : Beginning driver entry routine...
00000002 0.00002300 donna-ac : [VERBOSE] : Initialising driver configuration
00000003 0.00016290 donna-ac : [VERBOSE] : Cpuid: EBX: 756e6547, ECX: 6c65746e, EDX: 49656e69
00000004 0.00023730 donna-ac : [ERROR] ::: GetStringAtIndexFromSMBIOSTable failed with status c0000225
00000005 0.00024110 donna-ac : [ERROR] ::: ParseSMBIOSTable 2 failed with status c0000225
00000006 0.00024310 donna-ac : [ERROR] ::: ParseSmbiosForGivenSystemEnvironment failed with status c0000225
00000007 0.00024520 donna-ac : [ERROR] ::: GatherSystemEnvironmentSettings failed with status c0000225
00000008 0.00024720 donna-ac : [ERROR] ::: InitialiseDriverConfigOnDriverEntry failed with status c0000225

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.