Describe the bug
When using the MSSQL enable_cmdshell module to enable xp_cmdshell, the text xp_cmdshell successfully enabled will output even if the user lacks RECONFIGURE permissions.
To Reproduce
Command: nxc mssql target.ip -u 'username' -p 'password' -M enable_cmdshell -o ACTION=enable
Resulted in:
MSSQL target.ip 1433 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:REMOVED)
MSSQL target.ip 1433 DC01 [+] REMOVED\username:password
ENABLE_C... target.ip 1433 DC01 [+] xp_cmdshell successfully enabled.
...
Despite
SQL (REMOVED\username guest@master)> EXEC sp_configure 'xp_cmdshell', '1'; RECONFIGURE;
ERROR(DC01): Line 105: User does not have permission to perform this action.
ERROR(DC01): Line 1: You do not have permission to run the RECONFIGURE statement.
Expected behavior
xp_cmdshell successfully enabled. does not display if the user does not have RECONFIGURE permissions.
NetExec info
- OS: Ubuntu 25.10
- Version of nxc: 1.4.0 - SmoothOperator - 136b45c - 1006
- Installed from: github