Skip to content

A Beacon Object File (BOF) that performs the complete ESC1 attack chain in a single execution: certificate request with arbitrary SAN (+SID), PKINIT authentication, and NT hash extraction via UnPAC-the-hash.

Notifications You must be signed in to change notification settings

RayRRT/ESC1-unPAC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESC1-unPAC BOF

Request a certificate with arbitrary SAN (and SID to bypass KB5014754 AKA Strong Mapping), authenticate via PKINIT, and extract the NT hash


Demo

Havoc:

esc1-unpac1.mp4

CS:

cobalt-poc1.mp4

Features

Feature Description
ESC1 Exploitation Request certificates with arbitrary Subject Alternative Name
KB5014754 Bypass Automatic SID inclusion for Strong Certificate Mapping
PKINIT Authentication Full RFC 4556 implementation with DH key exchange
UnPAC-the-hash Extract NT hash from PAC credentials
U2U Fallback User-to-User when PA-PAC-CREDENTIALS unavailable
Single BOF Complete attack chain in one command
Rubeus Compatible Kirbi output works with Rubeus/Mimikatz

Build

git clone https://github.com/RayRRT/ESC1-unPAC.git && cd ESC1-unPAC && chmod +x build.sh && ./build.sh

Usage

Havoc

  1. Scripts → Load Script → havoc/esc1-unpac.py

Cobalt Strike

  1. Script Manager → Load → cobaltstrike/esc1-unpac.cna

Command

esc1-unpac <CA> <Template> <UPN> [KDC]

Example

esc1-unpac EVILCA1.evilcorp.net\evilcorp-EVILCA1-CA ESC1Template [email protected]

Output

  • PFX certificate (base64, password: SpicyAD123)
  • TGT in kirbi format (Rubeus compatible)
  • NT Hash

References


⚠️ Disclaimer

This tool is intended for authorized security testing and educational purposes only. Unauthorized access to computer systems is illegal. Always obtain proper authorization before testing.


About

A Beacon Object File (BOF) that performs the complete ESC1 attack chain in a single execution: certificate request with arbitrary SAN (+SID), PKINIT authentication, and NT hash extraction via UnPAC-the-hash.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages