Coder Social home page Coder Social logo

bestedrofthemarket's Introduction

Little AV/EDR Evasion Lab for training & learning purposes. (๐Ÿ—๏ธ under construction..)โ€‹

 ____            _     _____ ____  ____     ___   __   _____ _
| __ )  ___  ___| |_  | ____|  _ \|  _ \   / _ \ / _| |_   _| |__   ___
|  _ \ / _ \/ __| __| |  _| | | | | |_) | | | | | |_    | | | '_ \ / _ \
| |_) |  __/\__ \ |_  | |___| |_| |  _ <  | |_| |  _|   | | | | | |  __/
|____/_\___||___/\__| |_____|____/|_| \_\  \___/|_|     |_| |_| |_|\___|
|  \/  | __ _ _ __| | _____| |_
| |\/| |/ _` | '__| |/ / _ \ __|
| |  | | (_| | |  |   <  __/ |_           Yazidou - github.com/Xacone
|_|  |_|\__,_|_|  |_|\_\___|\__|


BestEDROfTheMarket is a naive user-mode EDR (Endpoint Detection and Response) project, designed to serve as a testing ground for understanding and bypassing EDR's user-mode detection methods that are frequently used by these security solutions.
These techniques are mainly based on a dynamic analysis of the target process state (memory, API calls, etc.),

Feel free to check this short article I wrote that describe the interception and analysis methods implemented by the EDR.

Defensive Techniques โš”๏ธโ€‹

In progress:


Usage ๐Ÿ“œ

        Usage: BestEdrOfTheMarket.exe [args]

                 /help Shows this help message and quit
                 /v Verbosity                 
                 /iat IAT hooking
                 /stack Threads call stack monitoring
                 /nt Inline Nt-level hooking
                 /k32 Inline Kernel32/Kernelbase hooking
                 /ssn SSN crushing
BestEdrOfTheMarket.exe /stack /v /k32
BestEdrOfTheMarket.exe /stack /nt
BestEdrOfTheMarket.exe /iat

Structure & Config files โš™๏ธ

๐Ÿ“ BestEdrOfTheMarket/
    ๐Ÿ“„ BestEdrOfTheMarket.exe
    ๐Ÿ“ DLLs/
        ๐Ÿ“„ Kernel32.dll
        ๐Ÿ“„ ntdll.dll
        ๐Ÿ“„ iat.dll
    ๐Ÿ“ TrigerringFunctions.json
    ๐Ÿ“ YaroRules.json
    ๐Ÿ“„ jsoncpp.dll

YaroRules.json: Contains a json array filled with the patterns you would like to be identified while monitoring threads call stacks.

{
	"Patterns": [
		"d2 65 48 8b 52 60 48 8b 52 18 48 8b 52 20 48 8b 72 50 48",
		"49 be 77 73 32 5f 33 32 00 00",
                "..."
    ]
}

TrigerringFunctions.json: Describes the functions that are already hooked or/and to hook:

โ„น๏ธ Note on call stack monitoring: Some NT routines are more appropriate and less exposed to false positives, for instance, it is strongly recommended to monitor the NtCreateFile when targeting an encrypted shellcode loader, but you should avoid it when targeting a reflective loader in favor of NtCreateUserProcess, which is better suited.

{
  "DLLBasedHooking": {
    "NTDLL.dll": [
      "NtAllocateVirtualMemory",
      "..."
    ],
    "KERNELBASE.dll": [
      "VirtualAlloc"
      "..."
    ],
    "KERNEL32.dll": [
      "VirtualAlloc"
      "..."
    ]
  },
  "StackBasedHooking": {
    "Functions": [
      "NtCreateUserProcess",
      "..."
    ]
  },
  "SSNCrushingRoutines": {
    "Functions": [
      "NtCreateSection"
      "..."
    ]
  },
  "IATHooking": {
    "Functions": [
      "VirtualAlloc",
      "..."
    ]
  }
}
  • DLLBasedHooking: Not modifiable ๐Ÿšซโ€‹โ€‹, changing its values will have absolutely no effect at all. Information purposes only.
  • StackBasedHooking: Modifiable โœ…, the functions you specify here will be monitored and their call will trigger an analysis of the calling thread's call stack.
  • SSNCrushingRoutines: Modifiable โœ…, the NT-level routines you will specify here will be attributed a corrupted SSN, Be careful of specifying NT-Level routines ONLY !
  • IATHooking: Modifiable โœ…, the functions you specify here will be hooked at IAT level

If you don't compile your own DLLs, take a look at the functions already hooked into the DLLs provided in sources.

Releases ๐Ÿ“ฆ

Disclaimer โš ๏ธโ€‹

  • Don't link the EDR to programs that are too CPU-intensive/thread-creating, as some detection techniques such as call stack analysis constantly monitor the stack state of each thread and this can quickly increase the load on the EDR, it's more relevant (that's also the point) that you link the tool to your own artifacts and keep in mind that a good evasive artifact tries to be as discrete as possible.

bestedrofthemarket's People

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.