Repository navigation
ENG-8821 fix(network-ops): honor empty-string null session in netexec - #178
Merged
Merged
Conversation
…G-8821) The netexec docstrings told agents that an empty username/password triggers a null session, but the argv builder used truthiness guards, so username=""/ password="" were falsy and -u/-p were dropped — the agent got a different invocation than documented. A real NetExec null session is the explicit -u '' -p '' form. Distinguish None/[] (omit the flag) from "" (emit the flag with its empty value) via a shared _emit_auth_flag helper. This also satisfies NetExec's unauthenticated AS-REP roast, which gates on password == "" to engage. Tighten the username/password docstrings to state what "" emits, and bump network-ops to 2.2.0 for the public-surface behavior change.
…-session # Conflicts: # capabilities/network-ops/capability.yaml # capabilities/network-ops/tests/test_tool_fixes.py
mkultraWasHere
self-requested a review
October 16, 2026 01:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
netexec's tool docstrings told agents that an empty username/password triggers a null session, but the argv builder used truthiness guards (
if username:), sousername=""/password=""were falsy and-u/-pwere dropped entirely. The agent followed the documented contract and got a different invocation than promised — a real NetExec null session is the explicit-u '' -p ''form (reported live repro on a Samba AD DC: the omitted-flag form connects asNull Auth:Truebut then fails--shareswithSTATUS_USER_SESSION_DELETED, while-u '' -p ''succeeds).Change
None/[](omit the flag) from""(emit the flag with its empty value) in the basenetexec()argv builder, via a shared_emit_auth_flaghelper. All specialized/generic wrappers delegate to this builder, so the fix applies uniformly.username/passworddocstrings (base + wrappers) to state exactly what""emits and that a null session needs both empty.network-opsto2.2.0(behavior change to an existing argument's public surface).NetExec requires
password == ""for both the anonymous null session and the unauthenticated AS-REP roast (it logs a hint to run with-p ''), so emitting the empty flag is what the tool expects;Nonestays "omit".Tests
tests/test_tool_fixes.py— newTestNetexecNullSession:-u '' -p ''null session,Noneomits, populated-creds regression, username + empty password (AS-REP style), multi-value list expansion, empty-list omission, and thenetexec_smb_enum_shareswrapper pass-through. 72 pass;pre-commitandjust validateclean.