Kerberos Clock Skew Helper
Kerberos Clock Skew Helper
We’ve all been there! kerberos suddenly breaks because our time is off from the Domain Controller.
That annoying clock skew (KRB_AP_ERR_SKEW) error, and breaks our command.
Instead of constantly syncing the system clock or copy‑pasting offsets, I wrote a small helper script that handles the DC time for any command I run.
No more fussing with ntpdate or messing with system time, the script just works
Why I Needed This
In AD labs and real environments:
- My Kali VM is often tulala/sabog xD (out of sync)
- tools fail with clock skew errors
- fixing system time/copy pasting a one-liner command repeatedly is annoying
The usual workflow is tedious:
1 | ntpdate -q <dc_ip> |
Or the one liner thing I always copy from notes:
1 | faketime "$(ntpdate -q <dc_ip> | cut -d ' ' -f 1,2)" <command> |
Still too much copy‑paste :/ .
The Script
I wrote a tiny bash wrapper called clockskew:
- Queries the DC time automatically.
- Applies faketime with the correct offset.
- Runs any command you pass in.
Now, instead of the messy manual way, I just do:
1 | clockskew <dc_ip> bloodhound-python -u <user> -p <password> -d <domain> -ns <ip> -c all |
Just save the script at:
/usr/bin/clockskew
or/usr/local/bin/clockskew
1 |
|
TL;DR
- Kerberos hates clock skew.
- clockskew script saves your sanity.
- Run commands with DC time, leave your VM clock alone.
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Comments

