GithubHelp home page GithubHelp logo

direct-syscalls-vs-indirect-syscalls's Introduction

Direct-Syscalls-vs-Indirect-Syscalls

Direct syscalls are a technique that has been, or is being, widely used by attackers and red teamers for various activities such as running shellcode or creating a memory dump of lsass.exe. However, depending on the EDR, direct syscalls may no longer be sufficient to bypass the EDR in the context of various attack techniques as of today (May 2023). This is because more and more vendors are implementing mechanisms in their products, such as callbacks, that can be used to determine the memory area from which the return statement is executed. If the return statement is executed outside the memory area of ntdll.dll, this is abnormal behaviour under Windows and a clear Indicator of Compromise (IOC).

In order to eliminate this IOC from the perspective of the attacker (red team), or to avoid detection by the EDR, direct syscalls can be replaced by indirect syscalls. Put simply, indirect syscalls are a sensible evolution of direct syscalls and allow, for example, the syscall statement and the return statement to be executed not in the memory of the assembly itself, but in the memory of the ntdll.dll, as is usual under Windows.

More details in my related blog post https://redops.at/en/blog/direct-syscalls-vs-indirect-syscalls

Disclaimer

The content and all code examples in this article are for research purposes only and must not be used in an unethical context! The code used is not new and I make no claim to it. The basis for the code comes, as so often, from the ired.team, thank you @spotheplanet for your brilliant work and sharing it with us all!

At the beginning of this blog post I would like to thank the following people who helped me with this topic: @NinjaParanoid, @Jean_Maes_1994, @ShitSecure and @NUL0x4C. If you are interested in malware, check out @NinjaParanoid's MOS course and join the MaldevAcademy project.

References

direct-syscalls-vs-indirect-syscalls's People

Contributors

virtualalllocex avatar

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.