Giter Site home page Giter Site logo

anti-afk's Introduction

Anti-afk

This project is a PoC

How it Works

The project will update LastHardwareAction every X seconds by the value of X. This will be done inside te process, so we just have to inject a CodeCave and then CreateRemoteThread on it. Please note that we need a Bypass in order to make use of CreateRemoteThread

The CodeCave

0x90,                                                                                           //nop     ;Used for Bypass
0x55,                                                                                           //push rbp
0x48, 0x8B, 0xEC,                                                                               //mov rbp, rsp
0x48, 0xB9, 0xDE, 0xAD, 0xBE, 0xEF, 0xDE, 0xAD, 0xBE, 0xEF,                                     //rcx, LastHardwareAction
0x51,                                                                                           //push rcx
0x48, 0xB9, 0x71, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                     //rcx, 000000000000000271
0xFF, 0x15, 0x02, 0x00, 0x00, 0x00, 0xEB, 0X08, 0xDE, 0xAD, 0xBE, 0xEF, 0xDE, 0xAD, 0xBE, 0xEF, //call KERNERL32.Sleep
0x59,                                                                                           //pop rcx
0x48, 0x8B, 0x19,                                                                               //mov rbx,[rcx]
0x48, 0x81, 0xC3, 0x71, 0x02, 0x00, 0x00,                                                       //rbx,00000271
0x48, 0x89, 0x19,                                                                               //[rcx],rbx
0xEB, 0xD5,                                                                                     //jmp (-> push rcx)
0x48, 0x8B, 0xE5,                                                                               //mov rsp, rbp
0x5D,                                                                                           //pop rbp
0xC3                                                                                            //ret

The Bypass

Something will add a "0xC3" or "ret" instruction at the start of our CodeCave. No big deal if we wan't to use all code of our cave. So a small work around is to start the Thread at CodeCave + 0x01.

in order to do this, we go to KERNEL32.BaseDumpAppcompatCacheWorker + 0x1E0, and see:

0xFF 0xE0       //jmp rax
0xCC            //int 3
0xCC            //int 3
0xCC            //int 3

So we know that RAX holds the start value of the Thread, so we patch the bytes to this:

0x48 0xFF 0xC0  //inc rax
0xFF 0xE0       //jmp rax

LastHardwareAction

I have made a short video to show some stuff about the LastHardwareAction. https://www.youtube.com/watch?v=o8J2HT-urkU&t=5s

Donate

BTC: 1FeribRHR98Crux3DEZPXzjLBpfmHTHKqJ

anti-afk's People

Contributors

evulpes avatar ferib avatar

Stargazers

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

Watchers

 avatar  avatar

anti-afk's Issues

Um sry for question here... X:

But how can i recive:
long CreateRemoteThreadPatchOffset = (long)GetProcAddress(GetModuleHandle("kernel32.dll"), "BaseDumpAppcompatCacheWorker") + **???????**;
Wanna use that thing on win 11 but totally idk how to get "+ 0x???" can u help please? :V

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.