GithubHelp home page GithubHelp logo

gmh5225 / weetabix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from janieldary/weetabix

0.0 1.0 0.0 1.58 MB

A C++ PoC implementation for enumerating Windows Fibers directly from memory

C++ 100.00%

weetabix's Introduction

BlackHat USA 2023 presentation - From Dead Data to Digestion: Extracting Windows Fibers for Your Digital Forensics Diet

https://www.youtube.com/watch?v=lWrBv1Cig1M&ab_channel=BlackHat

https://www.blackhat.com/us-23/briefings/schedule/#from-dead-data-to-digestion-extracting-windows-fibers-for-your-digital-forensics-diet-32832

*PowerPoint slides included in this repository


Weetabix

image

This tool demonstrates a PoC technique for enumerating Windows Fibers from process memory allowing defenders to distinguish legitimate from malicious Fiber use.

Weetabix identifies which Threads are running Fibers then extracts:

  • The currently executing Fiber.
  • Any associated Dormant Fibers.
  • Their Fiber Data.
  • Their Fiber local storage slots.
  • And any associated Fiber callback functions in use.

Weetabix then applies a set of enrichments such as memory protections, symbol+module resolutions & entropy scores to allow one to distinguish legitimate from malicious fiber use.

Usage

image

Detection use cases with sample output from Weetabix

Malicious callback manipulation

Tested against a Fiber whoes default Fiber local storage callbacks have been overwritten with malicous callbacks. The malicious callbacks are executed whenever the fiber/thread exits or the associated Fiber Local Storage slot is freed.

Weetabix finds two suspicous callbacks

  1. A callback to a mapped module in the Downloads directory.
  2. A callback into unbacked RWX memory.

image

Unorthodox use of Fibers by CobaltStrike's Artifact kit when using Thread Stack Spoofing

This reveals only a single fiber being used on a thread. This is irregular since Fibers were designed with multi-tasking in mind so one would expect two or more fibers/Thread. In addition

  1. FiberData points to unbacked memory.
  2. There is no Fiber local storage which is non-standard behaviour.
  3. There are no callbacks functions which is non-standard behaviour.

image

NOTES

  • This tool requires symbols to be correctly configured on Windows for callback symbol resolution.
  • PoC was tested on Windows 10 19044. Targets x64 processes.
  • Built around newer implementation of Fiber Local Storage (Windows 10 1903 onwards).

Credit

weetabix's People

Contributors

janieldary avatar

Watchers

 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.