Skip to content

ENG-8820 fix(network-ops): pass bloodyAD hashes via -p for pass-the-hash - #176

Merged
thomasqbrady merged 2 commits into
mainfrom
eng-8820-bloodyad-pass-the-hash
Oct 15, 2026
Merged

thomasqbrady merged 2 commits into
mainfrom
eng-8820-bloodyad-pass-the-hash

Conversation

@thomasqbrady

Copy link
Copy Markdown
Contributor

Summary

bloodyAD has no --hashes flag, so every hash-auth (pass-the-hash) call failed with unrecognized arguments: --hashes — the hash fell through to the positional subcommand and errored. The shared _build_connection_options helper now passes a hash through the password field (-p LMHASH:NTHASH, or -p :NTHASH for an NT-only hash), restoring pass-the-hash across all bloodyAD tool methods. Password and Kerberos auth are unchanged.

Changes

  • tools/bloodyad.py — route hashes through -p; drop the nonexistent --hashes flag. Handles both a full LMHASH:NTHASH value (passed through) and a bare NT hash (normalized to :NTHASH).
  • tests/test_tool_fixes.py — assert the built argv for the hash path (bare NT → :NTHASH, full pair passthrough, password-over-hash precedence, --hashes never emitted), plus a parametrized test over every public bloodyad_* method so a tool that forgets to forward its hash fails loudly rather than silently losing hash auth.

Testing

  • Unit suite: 56 passing.
  • Verified live against a throwaway local Samba AD DC: the old --hashes form reproduces the original bug (argparse rejects it); the new -p :NTHASH form authenticates with a valid NT hash (clears the LDAP bind) and is denied at the bind with a wrong hash (SEC_E_LOGON_DENIED).

Note

bloodyAD credentials (NT hash or password) are passed as -p <value>, so they land in the child process argv and in the SDK's command logs (execute() logs the full command on debug and on non-zero exit). This is inherent to bloodyAD's CLI — there is no argv-free credential path — but redacting -p values in execute()'s log lines is worth a separate follow-up before public release.

…8820)

bloodyAD has no --hashes flag; the shared connection-options builder now
supplies a hash through the password field (-p LMHASH:NTHASH, or -p :NTHASH
for an NT-only hash), restoring pass-the-hash across all bloodyAD tool
methods. Password and Kerberos auth are unchanged.

Adds unit tests for the built argv, including one per public bloodyad_*
method so a method that forgets to forward its hash fails loudly.
…s-the-hash

# Conflicts:
#	capabilities/network-ops/tests/test_tool_fixes.py
@thomasqbrady
thomasqbrady merged commit 8e9327a into main Oct 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants