Skip to content

fix: let --brute-mac run with -H instead of -p - #27

Merged
bandrel merged 1 commit into
mainfrom
brute-mac-host-prefixes
Jul 29, 2026
Merged

fix: let --brute-mac run with -H instead of -p#27
bandrel merged 1 commit into
mainfrom
brute-mac-host-prefixes

Conversation

@bandrel

@bandrel bandrel commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

thief -b -H <cucm> previously exited with "You must specify at least one phone with -p" unless the database already held a mac_prefixes row for that exact host. Now -H is a usable stand-in for -p.

Changes

  • New get_uds_device_macs_from_db() extracts MACs from SEP… device names in uds_devices for a given CUCM host — the devices --userenum and --spray harvest.
  • The no-phones brute-force branch builds its prefix list for -H from that host's mac_prefixes rows plus those UDS devices. If the host has nothing recorded, prefixes learned from phones on other servers are retargeted at it (with a printed notice).
  • Error text now mentions -H.
  • README updated.

Behavior change

-b -H <host> against a host with no history used to exit 1; it now brute-forces using whatever prefixes the database holds.

Testing

uv run pytest -q → 224 passed, 2 skipped. New tests/test_brute_host_prefixes.py covers host scoping, non-SEP names, missing-table tolerance, and the CLI path.

🤖 Generated with Claude Code

With -H and no -p, source MAC prefixes for that server from its
mac_prefixes rows plus any SEP devices harvested from it via
--userenum/--spray. If the server has no prefixes recorded, retarget
prefixes discovered elsewhere at it rather than exiting.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bandrel
bandrel merged commit 0be8f44 into main Jul 29, 2026
2 checks passed
@bandrel
bandrel deleted the brute-mac-host-prefixes branch July 29, 2026 17:19
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.

1 participant