Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to enumerate null sessions using nxc.exe #276

Closed
J005 opened this issue Apr 26, 2024 · 4 comments
Closed

Unable to enumerate null sessions using nxc.exe #276

J005 opened this issue Apr 26, 2024 · 4 comments
Labels
windows Things related specifically to running on Windows

Comments

@J005
Copy link

J005 commented Apr 26, 2024

Attempting to enumerate null sessions (https://www.netexec.wiki/smb-protocol/enumeration/enumerate-null-sessions) results in the following error message:

nxc.exe smb: error: argument -u: expected at least one argument

Reproduction
Command: netexec smb -u '' -p '' <host>
Resulted in:

usage: nxc.exe smb [-h] [-id CRED_ID [CRED_ID ...]] [-u USERNAME [USERNAME ...]] [-p PASSWORD [PASSWORD ...]] [--ignore-pw-decoding] [-k] [--no-bruteforce]
                   [--continue-on-success] [--use-kcache] [--log LOG] [--aesKey AESKEY [AESKEY ...]] [--kdcHost KDCHOST]
                   [--gfail-limit LIMIT | --ufail-limit LIMIT | --fail-limit LIMIT] [-M MODULE] [-o MODULE_OPTION [MODULE_OPTION ...]] [-L] [--options] [--server {https,http}]
                   [--server-host HOST] [--server-port PORT] [--connectback-host CHOST] [-H HASH [HASH ...]] [--delegate DELEGATE] [--self] [-d DOMAIN | --local-auth]
                   [--port {139,445}] [--share SHARE] [--smb-server-port SMB_SERVER_PORT] [--gen-relay-list OUTPUT_FILE] [--smb-timeout SMB_TIMEOUT] [--laps [LAPS]] [--sam]
                   [--lsa] [--ntds [{drsuapi,vss}]] [--dpapi [{nosystem,cookies} ...]] [--mkfile MKFILE] [--pvk PVK] [--enabled] [--user USERNTDS] [--shares]
                   [--no-write-check] [--filter-shares FILTER_SHARES [FILTER_SHARES ...]] [--sessions] [--disks] [--loggedon-users-filter LOGGEDON_USERS_FILTER]
                   [--loggedon-users] [--users [USER]] [--groups [GROUP]] [--computers [COMPUTER]] [--local-groups [GROUP]] [--pass-pol] [--rid-brute [MAX_RID]] [--wmi QUERY]
                   [--wmi-namespace NAMESPACE] [--spider SHARE] [--spider-folder FOLDER] [--content] [--exclude-dirs DIR_LIST] [--pattern PATTERN [PATTERN ...] | --regex REGEX
                   [REGEX ...]] [--depth DEPTH] [--only-files] [--put-file FILE FILE] [--get-file FILE FILE] [--append-host] [--exec-method {wmiexec,mmcexec,smbexec,atexec}]
                   [--dcom-timeout DCOM_TIMEOUT] [--get-output-tries GET_OUTPUT_TRIES] [--codec CODEC] [--force-ps32] [--no-output] [-x COMMAND | -X PS_COMMAND] [--obfs]
                   [--amsi-bypass FILE] [--clear-obfscripts]
                   target [target ...]
nxc.exe smb: error: argument -u: expected at least one argument

NetExec info
nxc.exe on Windows 2022 Server (https://github.com/Pennyw0rth/NetExec/releases/download/v1.1.0/nxc.exe)

@Marshall-Hallenbeck
Copy link
Collaborator

Target should go after the protocol, but I actually ran into this today on Windows too, using both poetry and pipx installations. I believe it's some weird parsing issue with quotes.

@NeffIsBack
Copy link
Contributor

NeffIsBack commented Apr 26, 2024

Can you two try -u=''? @Marshall-Hallenbeck you are also on windows? I think there is a bug on windows argparse in python

@Marshall-Hallenbeck
Copy link
Collaborator

Yeah it was only on Windows I was having this issue.

@NeffIsBack NeffIsBack added the windows Things related specifically to running on Windows label May 27, 2024
@NeffIsBack
Copy link
Contributor

It is an issue with the windows command line:
image

Closing as -u= solves the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
windows Things related specifically to running on Windows
Projects
None yet
Development

No branches or pull requests

3 participants