• Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language
    C#
  • Created almost 5 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

BlueHatIL 2020 - Staying # and Bringing Covert Injection Tradecraft to .NET

BlueHatIL 2020: Staying # and Bringing Covert Injection Tradecraft to .NET

Authors

Ruben Boonen (@FuzzySec) - Ruben is a member of of IBM’s X-Force Red Team, providing public & private sector clients assurance around the security posture of their products and infrastructure. Before joining IBM, Ruben worked in defense, on FireEye’s Technical Operations & Reverse Engineering (TORE) team, and offence as a senior security consultant. While Ruben has previously led a wide variety of engagements, along the way he developed a special interest for all things Windows. His current areas of research include Windows internals, privilege escalation, C#/PowerShell trade-craft and memory manipulation.

The Wover (@TheRealWover) - The Wover is an adversary emulation engineer who researches adversary groups and TTPs and develops tools and methodologies for emulating them. In a previous life, he was a software developer for "normal" (i.e. not-malware) applications. Now he spends his spare time developing open-source software for non-"normal" applications (don't call it malware). He is the co-creator of the Donut shellcode generation framework, a collaborator for the SharpSploit post-exploitation library, and has contributed to or created several other open-source projects and techniques.

Abstract

As .NET has taken over as the preferred platform for development on Windows, many attackers have chosen to take advantage of its features for post-exploitation tradecraft. Legitimate APIs can be leveraged for nearly every imaginable task, managed code can be loaded and executed from memory with extraordinary ease, and scalable monitoring for suspicious usage of .NET APIs is a problem yet to be solved. However, offensive .NET tools are still hindered by a fundamental weakness: the inability to leverage unmanaged code (such as the Win32/NT APIs) safe from observation by EDR. Managed code must eventually invoke unmanaged code in order to interface with the operating system. It is here that the attacker may be caught in the hooks of any system keen on watching for fundamentally malicious behavior. To expose the depth of tradecraft still unexplored in .NET and highlight the fragility of many existing detections, we will detail the tools we have built for evading these hooks.

All of our efforts have been integrated into SharpSploit, a .NET post-exploitation library written in C# that aims to highlight the attack surface of .NET and make the use of offensive .NET easier for red teamers. Over the past few months we have added numerous new tools and techniques for loading and executing unmanaged code safely from .NET. Unmanaged APIs may be safely accessed and modules loaded either from memory or from disk in the new DInvoke API, a dynamic replacement for .NET's PInvoke API. It also includes manual mapping, a generic syscall wrapper, a new technique we call Module Overloading, and more. Additionally, we have added a modular process injection API that allows tool developers to build their own injection technique. Simply select an allocation and injection primitive, pass in any options, and execute the result with your preferred payload. This exposes all possible design decisions to the user, and allows for easy adaptation when existing tools fail.

In our talk we will focus on explaining the fundamental tradecraft behind these new developments, the challenges and requirements associated with them, and how they can be adapted to suit your needs. Additionally, we will discuss how SharpSploit can be combined with other open-source projects to be integrated into a red team's tooling. As much as possible, we will also discuss how to counter and detect the techniques that we have developed. Finally, we will explain the community-focused development of these projects and how you too can contribute to advance open-source .NET tradecraft.

More Repositories

1

PowerShell-Suite

My musings with PowerShell
PowerShell
2,584
star
2

Sharp-Suite

Also known by Microsoft as Knifecoat 🌶️
C#
1,094
star
3

StandIn

StandIn is a small .NET35/45 AD post-exploitation toolkit
C#
678
star
4

Fermion

Fermion, an electron wrapper for Frida & Monaco.
CSS
639
star
5

PSKernel-Primitives

Exploit primitives for PowerShell
PowerShell
429
star
6

Resource-List

GitHub Project Resource List
324
star
7

DefCon25

UAC 0day, all day!
275
star
8

Unix-PrivEsc

Local UNIX PrivEsc Aggregation
C
244
star
9

Capcom-Rootkit

Capcom Rootkit POC
PowerShell
180
star
10

HackSysTeam-PSKernelPwn

PowerShell
136
star
11

Dendrobate

Managed code hooking template.
C#
126
star
12

DefCon24

DefCon24
PowerShell
118
star
13

BHUSA-2023

101
star
14

Driver-Template

Bare template for a Kernel Mode Driver
C#
50
star
15

SANS-HackFest-2023

46
star
16

BulkBindex

Winbindex bot to pull in binaries for specific releases
C#
43
star
17

IBM-RedCON-2020

IBM RedCON 2020 - Throwing an AquaWrench into the Kernel
43
star
18

AzureWireGuard

Automated WireGuard Deployment on Azure
42
star
19

BH-Arsenal-2019

SilkETW & SilkService
41
star
20

DefCon-Beijing-UAC

Slide deck for DefCon Beijing
39
star
21

WWHF-WayWest-2022

38
star
22

Magikarp

ECC Public Key Cryptography
C#
32
star
23

AdvSim.Cryptography

Simple and sane cryptographic wrapper library.
C#
30
star
24

DotNetToJScript-LanguageModeBreakout

C#
26
star
25

CapstoneKeystone-PowerShell

PowerShell Module Bindings for Capstone/Keystone
PowerShell
24
star
26

DLL-Template

Simple skeleton for a CPP DLL
C++
22
star
27

afl-frida-build

Ansible build for Afl++ Frida-Mode
CMake
19
star
28

SAFACon-Vienna

18
star
29

AdvSim.Compression

Simple and sane compression wrapper library.
C#
17
star
30

Presentations

A collection of my presentation materials.
15
star
31

BinaryNinja-Themes

Custom Binary Ninja Themes
12
star
32

AdventuresWithChef

A collection of Chef recipes, for learning and infrastructure automation.
Ruby
8
star
33

FuzzySecurity

4
star
34

FuzzySecurity.github.io

FuzzySecurity Archive
HTML
3
star