Skip to main content

The HEKATOMB project




Because Domain Admin rights are not enough.
Hack them all.
🐍



Hekatomb is a python script that connects to LDAP directory to retrieve all computers and users informations.
Then it will download all DPAPI blob of all users from all computers.
Finally, it will extract domain controller private key through RPC uses it to decrypt all credentials.



Changelog


On last version (V 1.5) :
- Fix local packages importation error with pip installation
- Prevent crash when no computers are reachable
- Prevent null domain or null domain extension

V 1.4 :
- Fix LDAP search limitation to 1000 items
- Add LDAP filter for computers to select only "Enabled" computers
- Add function to scan SMB port with multi thread prior to get blob and master key files
- Add a progress bar for files collection
- Added 2 function modules to simplify code readability and maintainability

V 1.3 :
- Compare LDAP usernames with SMB users folders before trying to retrieve blob files to get them faster
- DNSTCP option is no more used, DNS resolution is trying on UDP first and with TCP if it fails

V 1.2.1 :
- Use of the ldap3 library instead of Impacket for LDAP requests
- Fix a bug that prevented querying trusted domains via an external domain account with administrator rights on the trusted domain controller
- Add -smb2 parameter to force the use of SMBv2 protocol when it is available
- LDAP and SMB communications are now more difficult to detect on the network

V 1.2.1 :
- Add installation with Pypi

V 1.2 :
- Increase the LDAP results limit of users or computers extraction (1000 previously)
- Add the possibility to specify a user or a computer to target
- Add the possibility to export results to a CSV file

V 1.1 :
- Domain controller private key extraction through RPC
- Credentials classification by computers and by users



What da fuck is this ?


On Windows, credentials saved in the Windows Credentials Manager are encrypted using Microsoft's Data Protection API and stored as "blob" files in user AppData folder.
Outside of a domain, the user's password hash is used to encrypt these "blobs".
When you are in an Active Directory environment, the Data Protection API uses the domain controller's public key to encrypt these blobs.
With the extracted private key of the domain controller, it is possible to decrypt all the blobs, and therefore to recover all the secrets recorded in the Windows identification manager of all the workstations in the domain.

Hekatomb automates the search for blobs and the decryption to recover all domain users' secrets ☠️

Installation


From Pypi for Debian-based :

pip3 install hekatomb

From BlackArch :

pacman -S hekatomb

BlackArch package


From github :

git clone https://github.com/ProcessusT/HEKATOMB
cd HEKATOMB
poetry install
poetry run hekatomb


Usage


Hekatomb uses Impacket syntax :

usage: hekatomb [-h] [-hashes LMHASH:NTHASH] [-pvk PVK] [-dns DNS] [-dnstcp] [-port [port]] [-just-user JUST_USER] [-just-computer JUST_COMPUTER] [-md5] [-debug] [-debugmax] target

Script used to automate domain computers and users extraction from LDAP and extraction of domain controller private key through RPC to collect and decrypt all users' DPAPI secrets saved in Windows credential manager.

positional arguments:
  target                [[domain/]username[:password]@]<targetName or address of DC>

options:
  -h, --help            Show this help message and exit

authentication:
  -hashes LMHASH:NTHASH     NTLM hashes, format is LMHASH:NTHASH

authentication:
  -pvk PVK                  Domain backup keys file
  -dns DNS                  DNS server IP address to resolve computers hostname
  -port [port]              Port to connect to SMB Server
  -smb2                     Force the use of SMBv2 protocol
  -just-user [USERNAME]     Test only specified username
  -just-computer [COMPUTER] Test only specified computer
  -md5                      Print md5 hash insted of clear passwords

verbosity:
  -csv                  Output the results in csv
  -debug                Turn DEBUG output ON
  -debugmax             Turn DEBUG output TO MAAAAXXXX


Example


hekatomb -hashes :ed0052e5a66b1c8e942cc9481a50d56 DOMAIN.local/administrator@10.0.0.1 -debug 


How to retrieve domain backup keys ?


If no domain backup keys are provided, the script will retrieve it through RPC

Metadata

Release files for hekatomb 1.5.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hekatomb 1.5.2.3
File Size Uploaded
hekatomb-1.5.2.3.tar.gz 26.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hekatomb 1.5.2.3
File Interpreter ABI Platform
hekatomb-1.5.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 52.8 kB

Release files / hekatomb-1.5.2.3.tar.gz

Download URL hekatomb-1.5.2.3.tar.gz
Size 26.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3975c84e47c060814a27b8ab998fa0c125d1e2a154040309303b6018350eb49a
BLAKE2b-256 checksum
How to use checksums
4085bcb75429667ac36362bc4291746b0b3b1415e1e01183670392b657d17501
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release files / hekatomb-1.5.2.3-py3-none-any.whl

Download URL hekatomb-1.5.2.3-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c688bb205eed3017c8eb85f01bd5f36eee30a02e9ace8c9c6d51cfa2e47541ef
BLAKE2b-256 checksum
How to use checksums
1aefaaf083b780cf8fd30a63e17b772a43e89e7f1a826bd942a5e9b5645d546a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release history Release notifications | RSS feed

1.5.14

1 release file

This release

1.5.2.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page