All Projects → HuskyHacks → ShadowSteal

HuskyHacks / ShadowSteal

Licence: BSD-3-Clause License
Pure Nim implementation for exploiting CVE-2021-36934, the SeriousSAM local privilege escalation

Programming Languages

nim
578 projects
python
139335 projects - #7 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to ShadowSteal

H4cker
This repository is primarily maintained by Omar Santos and includes thousands of resources related to ethical hacking / penetration testing, digital forensics and incident response (DFIR), vulnerability research, exploit development, reverse engineering, and more.
Stars: ✭ 10,451 (+5518.82%)
Mutual labels:  exploit, exploit-development
HackingAllTheThings
My documentation and tools for learn ethical hacking.
Stars: ✭ 66 (-64.52%)
Mutual labels:  exploit, exploit-development
exploiting
Exploiting challenges in Linux and Windows
Stars: ✭ 122 (-34.41%)
Mutual labels:  exploit, exploit-development
Gef
GEF (GDB Enhanced Features) - a modern experience for GDB with advanced debugging features for exploit developers & reverse engineers ☢
Stars: ✭ 4,197 (+2156.45%)
Mutual labels:  exploit, exploit-development
readhook
Red-team tool to hook libc read syscall with a buffer overflow vulnerability.
Stars: ✭ 31 (-83.33%)
Mutual labels:  exploit, exploit-development
SubRosa
Basic tool to automate backdooring PE files
Stars: ✭ 48 (-74.19%)
Mutual labels:  exploit, exploit-development
ronin-exploits
A Ruby micro-framework for writing and running exploits
Stars: ✭ 36 (-80.65%)
Mutual labels:  exploit, exploit-development
Rage
Rage allows you to execute any file in a Microsoft Office document.
Stars: ✭ 68 (-63.44%)
Mutual labels:  exploit
APSoft-Web-Scanner-v2
Powerful dork searcher and vulnerability scanner for windows platform
Stars: ✭ 96 (-48.39%)
Mutual labels:  exploit
Umbraco-RCE
Umbraco CMS 7.12.4 - (Authenticated) Remote Code Execution
Stars: ✭ 61 (-67.2%)
Mutual labels:  exploit
x64dbgpylib
Port of windbglib to x64dbgpy, in an effort to support mona.py in x64dbg.
Stars: ✭ 46 (-75.27%)
Mutual labels:  exploit
Cloak-And-Dagger
An overlay attack example
Stars: ✭ 22 (-88.17%)
Mutual labels:  exploit
MalwareDatabase
One of the few malware collection
Stars: ✭ 37 (-80.11%)
Mutual labels:  exploit
wowned
Authentication bypass for outdated WoW emulation authentication servers
Stars: ✭ 32 (-82.8%)
Mutual labels:  exploit
evilMACHO
Malicious use of macho, such as dump-runtime-macho, function-hook.
Stars: ✭ 13 (-93.01%)
Mutual labels:  exploit
doona
Network based protocol fuzzer
Stars: ✭ 64 (-65.59%)
Mutual labels:  exploit
sqlinjection-training-app
A simple PHP application to learn SQL Injection detection and exploitation techniques.
Stars: ✭ 56 (-69.89%)
Mutual labels:  exploit
Gr33k
图形化漏洞利用集成工具
Stars: ✭ 361 (+94.09%)
Mutual labels:  exploit
exploit
My exploitDB.
Stars: ✭ 16 (-91.4%)
Mutual labels:  exploit
CVE-2021-44228-PoC-log4j-bypass-words
🐱‍💻 ✂️ 🤬 CVE-2021-44228 - LOG4J Java exploit - WAF bypass tricks
Stars: ✭ 760 (+308.6%)
Mutual labels:  exploit

ShadowSteal | CVE-2021-36934

Pure Nim implementation for exploiting CVE-2021-36934, the SeriousSAM Local Privilege Escalation (LPE). Not OPSEC safe.... yet ;). I do not claim credit for the discovery of this exploit.

Quick Start

Build with Docker

Getting started with ShadowSteal is now easier than ever thanks to Docker! Don't wanna mess with installing Nim dependencies? I got you, fam! Run the Python script to create the Docker build environment, compile the binary, transfer it back to your host, and then kill the container.

Install Docker on your host (look up the documentation for how to install for different OS), then run the ShadowSteal Python script in the main dir:

$ git clone https://github.com/HuskyHacks/ShadowSteal.git && cd ShadowSteal
$ sudo python3 ShadowSteal.py && cd bin/ && ls -l

Build from Source

Or, build from source by installing Nim and its dependencies:

$ sudo apt-get install nim
$ nimble install zippy argparse winim

Install the MinGW tool chain if it's not already installed.

$ sudo apt-get install mingw-w64
$ git clone https://github.com/HuskyHacks/ShadowSteal.git && cd ShadowSteal
$ make && cd bin/ && ls -l

Transfer to target...

PS C:\Users\husky\Desktop> .\ShadowSteal.exe -h

Summary

Due to some oversight by Microsoft, regular users have read permissions over the contents of the ...\System32\config\ folder in recent Windows builds. Among other things, this means that a low level user has read access to the SAM, System, and Security files in ...\System32\config.

1.png

Ooof. So what can we do with this?

Some very observant researchers (shout out @jonasLyk!) noticed that if a Windows host has been using a specific system restore configuration, "Volume Shadow Copies", then the host stores backup copies of these files that are accessible via the Win32 device namespace for these copies.

2.png

3.png

The SAM is normally locked during the host's operation, so accessing the SAM in ...\System32\config\ is out of the question. But these shadow volume copies are fair game for any user on the host due to this misconfiguration. Very nice!

ShadowSteal

ShadowSteal is a binary written in Nim to automate the enumeration and exfiltration of the SAM, System, and Security files from these shadow copies. It iterates through the possible locations of the shadow copies and, when it has found a target, it extracts the files to a zipped directory (think Bloodhound output).

4.png

Features:

  • Triage and Bruteforce mode, for thorough or rapid enumeration.
  • Automated extraction and rollup of target credentials.
  • Jeff Beezy mode. (wait, what?)
  • Integrated Docker build environment for easy complation!
  • Will enumerate all available HarddiskShadowCopy locations, pick the highest number dynamically, and target those for exploitation/extraction.

6.png

It's nothing earth shattering and the code is hacky, but it works and it was a fun build!

Installing from Source

Install Nim:

$ sudo apt-get install nim

Install dependencies:

$ nimble install zippy argparse winim

Install the MinGW tool chain if it's not already installed:

$ sudo apt-get install mingw-w64

Compile for 64-bit Windows:

$ make

Transfer to target and run it!

Usage

PS C:\Users\husky\Desktop> .\ShadowSteal.exe -h
[*] ShadowSteal! Identifies and extracts credentials that can be stolen due to the SeriousSAM (CVE-2021-36934) exploit. Searches from high to low, defaults searching 100 to 1.

Usage:
   [options]

Options:
  -h, --help
  -t, --triage               [*] Triage mode. Quick enumeration, tries to find quick wins.
  -bf, --bruteforce          [*] Bruteforce mode. Enumerates the entire range of possible locations (512 to 1). Takes a bit.
  -b, --bezos                [?] Jeff Bezos Mode

Triage mode

Limits location bruteforce to 10 to 1, decrementing with each attempt. Speedy and effective in most environments.

PS C:\Users\husky\Desktop> .\ShadowSteal.exe -t

Bruteforce mode

Searches all possible locations (512), decrementing down to 1. Try this to thoroughly enumerate the environment. Takes a few minutes.

PS C:\Users\husky\Desktop> .\ShadowSteal.exe -bf

Parsing Output

Transfer the output directory back to your attacker host and carve the data with Pypykatz. To install:

$ pip3 install pypykatz

To run Pypykatz:

$ pypykatz registry [yyyyMMddhhmm_SYSTEM] --sam [yyyyMMddhhmm_SAM] --security [yyyyMMddhhmm_SECURITY]

5.png

Release History

v.04.01 | the Docktastic update

Now features an easy pre-packaged Docker build environment! Just run the ShadowSteal.py script to set up the Docker environment, compile the binay, transfer it back out to your host, and kill the build containers. It just works! (Some assembly requied, i.e. you need Docker to run it).

v.03.69 | the N I C E update

Lean and mean. Optimized compile options added. HUGE performance increase due to compiler optimization, full bruteforce now takes place almost instantly. Huge thanks to @orbitalgun for the pseudo PR, glory be to your house and name!

v.02 THE JEFF BEEZY UPDATE

  • Bruteforce and Triage mode
  • A better search algo
  • Code cleanup
  • Jeff Beezy Mode
  • Lots of lessons learned from the first release!

v.01 THE LAUNCHPAD RELEASE

Stap in boiz, this trainwreck is a-rollin. This release was my rapid prototype and it was pretty terrible lol. Lots of fun to build though! Features:

  • "Working" code

References

Disclaimer

  • For legal, ethical use only.

7.png

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].