Giter Site home page Giter Site logo

mamor5409 / darkwidow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from reveng007/darkwidow

0.0 0.0 0.0 1.02 MB

Indirect Dynamic Syscall, SSN + Syscall address sorting via Modified TartarusGate approach + Remote Process Injection via APC Early Bird + Spawns a sacrificial Process as target process + (ACG+BlockDll) mitigation policy on spawned process + PPID spoofing (Emotet method) + Api resolving from TIB + API hashing

License: MIT License

C++ 40.39% C 57.54% Assembly 1.94% Batchfile 0.14%

darkwidow's Introduction

DarkWidow

This is a Dropper/PostExploitation Tool (or can be used in both situations) targeting Windows.

Capabilities:

  1. Indirect Dynamic Syscall
  2. SSN + Syscall address sorting via Modified TartarusGate approach
  3. Remote Process Injection via APC Early Bird
  4. Spawns a sacrificial Process as the target process
  5. ACG(Arbitrary Code Guard)/BlockDll mitigation policy on spawned process
  6. PPID spoofing (MITRE ATT&CK TTP: T1134.004)
  7. Api resolving from TIB (Directly via offset (from TIB) -> TEB -> PEB -> resolve Nt Api)
  8. Cursed Nt API hashing

Bonus: If blessed with Admin privilege =>

  1. Disables Event Log via killing EventLog Service Threads (MITRE ATT&CK TTP: T1562.002)

Disadv: If threads are resumed, all events that occurred during the suspension of Event Logger, get logged Again!

So, thought of killing them instead!

"It's more Invasive than suspension, but the decision is always up to the operator. Besides, killing threads get logged on the kernel level" - @SEKTOR7net

While Killing only those threads in the indirect syscall implant, was facing an error. I was unable to get the "eventlog" SubProcessTag Value. So thought of killing all threads, i.e. killing the whole process (responsible svchost.exe). Yeah creating an IOC!.

= EDR/Ring-3/UserLand hook Bypass Probably! -> Don't have EDR to check it though ;(

Compile:

Directly via VS compiler:

image

  1. Also via compile.bat (prefer option 1.)
./compile.bat

Usage:

PS C:> .\x64\Release\indirect.exe
[!] Wrong!
[->] Syntax: .\x64\Release\indirect.exe <PPID to spoof>

In Action:

DarkWidow.mp4

Further Improvements:

  1. PPID spoofing (Emotet method)
  2. Much Stealthier Use Case of EventLog Disabling!

Portions of the Code and links those helped:

  1. TIB:

  2. GS and FS register:

  3. PEB LDR structure:

  4. TIB -> TEB -> PEB -> Resolve Nt API and API hashing

  5. ACG(Arbitrary Code Guard)/BlockDll mitigation policy:

  6. PPID Spoofing Detection:

    • PPID Spoofing Detect by @spotheplanet
    • If got time, I will be adding a detection Portion to this portion! -> [Remaining..............................................!]
  7. Moneta Detection and PESieve Detection:\

    • Moneta:
      alt text

    • PESieve:
      alt text

  8. Capa Scan:
    alt text

  9. How Thread Stack Looks of the Implant Process:

Implant Process Legit Cmd process
alt text alt text

It follows that by executing the return instruction in the memory of the ntdll.dll in the indirect syscall POC, the return address can be successfully spoofed, the ntdll.dll can be placed at the top of the call stack and the EDR will interpret a higher legitimacy. - @VirtualAllocEx from DirectSyscall Vs Indirect Syscall
Also thanks to, @peterwintrsmith!

  1. EventLogger Config, I used: image alt text

  2. Setting SeDebugPrivilege:
    From Here: alt text To Here: alt text

  3. Killing Event Log Threads:

Major Thanks for helping me out (Directly/indirectly (pun NOT intended :))):

  1. @SEKTOR7net
  2. @peterwintrsmith
  3. @Jean_Maes_1994
  4. @D1rkMtr
  5. @spotheplanet
  6. @0xBoku
  7. @winterknife
  8. @monnappa22
  9. @xpn
  10. @hlldz

I hope I didn't miss someone!

This project is a part of my journey to learn about EDR World! => Learning-EDR-and-EDR_Evasion

darkwidow's People

Contributors

reveng007 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.