Skip to content

feat: harden UDS probe for Contact Search Authentication (9443 + auth flag) - #30

Merged
bandrel merged 3 commits into
devfrom
harden/uds-9443-auth
Jul 29, 2026
Merged

feat: harden UDS probe for Contact Search Authentication (9443 + auth flag)#30
bandrel merged 3 commits into
devfrom
harden/uds-9443-auth

Conversation

@bandrel

@bandrel bandrel commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Targets dev (new integration branch). Stacked on the two fixes from #29 (cherry-picked here so dev carries a complete set).

Background

A --brute-mac -H 10.45.200.3 run reported a UDS failure that looked like a possible CUCM 14 incompatibility. It isn't: per Cisco DevNet the anonymous UDS endpoints (version, servers, clusterUser) are unchanged through 14/15, and /users auth is the per-cluster Contact Search Authentication toggle (usersResourceAuthEnabled, default false), which has existed since 11.5. A live run against the target confirmed it is CUCM 14.0.1 and answers UDS unauthenticated on 8443. So no version gating — but two real, version-independent gaps were worth hardening.

Changes

  1. <usersResourceAuthEnabled> parsing. get_version() now reads this flag. When a cluster requires auth for /users, unauthenticated --userenum/--directory/--spray come back empty even though the probe succeedsmain() now prints a clear warning so that doesn't read as "no users."

  2. 8443↔9443 fallback (probe_uds()). Enabling Contact Search Authentication moves UDS to 9443. probe_uds() tries the requested port, then the other standard UDS port, unless the user pinned --uds-port. The resolved port is threaded through every UDS feature call.

Also included (from #29)

  • Version probe scoped to UDS features (no more 10s timeout / misleading error on --brute-mac).
  • Clearer --brute-mac -H empty-database message.

Testing

  • New tests/test_uds_hardening.py (8 tests): auth-flag parsing, 9443 fallback, --uds-port pin respected, no redundant second probe, main() auth warning, resolved-port threading.
  • Full suite: 235 passed, 2 skipped.
  • Live: confirmed CUCM 14.0.1 reachable unauthenticated on 8443 from the engagement host.

Note on #29

#29 currently targets main. If you want everything to flow through dev, close #29 in favour of this branch (it contains those commits); otherwise merge #29 to main and this to dev and they'll reconcile.

🤖 Generated with Claude Code

bandrel and others added 3 commits July 29, 2026 13:40
…error

The startup version probe hit the UDS port (8443) for every -H host, even
for --brute-mac and plain config/phone scans that never touch UDS. Against
a host where UDS is firewalled or not listening, those runs paid a full
read timeout and printed a misleading "Could not retrieve CUCM version"
error unrelated to what the user asked for. Gate the probe to the features
that actually use UDS (--servers, --directory, --userenum, --spray).

Separately, --brute-mac with -H and no seeded prefixes printed "You must
specify at least one phone with -p (or a CUCM server with -H)", implying -H
was missing when it was in fact supplied. --brute-mac never queries the
server; it replays MAC prefixes already harvested by --userenum/--spray or
a phone scan. The message now names the host and points at the seeding steps.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… flag)

Contact Search Authentication (CLI `utils contactsearchauthentication
enable`) moves UDS off 8443 to 9443 and makes the /users resource require
Basic auth. Both are cluster config, not tied to the CUCM major version
(identical behaviour 11.5 through 15), so this is handled at runtime rather
than version-gated.

- get_version now parses <usersResourceAuthEnabled> and records the port it
  answered on.
- New probe_uds() tries the requested port, then falls back to the other
  standard UDS port (8443<->9443) unless the user pinned --uds-port. The
  resolved port is threaded through every UDS feature call.
- main() warns when the cluster requires auth for /users, so an empty
  --userenum/--directory/--spray reads as "auth required" instead of "no
  users", and notes when UDS was found on the alternate port.

Confirmed against a live CUCM 14.0.1 target that the version endpoint is
reachable unauthenticated on 8443; the fallback/auth paths are unit-tested.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bandrel
bandrel merged commit 2af7ac8 into dev Jul 29, 2026
2 checks passed
@bandrel
bandrel deleted the harden/uds-9443-auth branch July 29, 2026 17:52
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