File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11class NXCModule :
2- """Enables or disables xp_cmdshell in MSSQL Server."""
2+ """
3+ Enables or disables xp_cmdshell in MSSQL Server.
4+ Module by crosscutsaw
5+ """
36
47 name = "enable_cmdshell"
58 description = "Enable or disable xp_cmdshell in MSSQL Server"
@@ -15,16 +18,18 @@ def __init__(self):
1518
1619 def options (self , context , module_options ):
1720 """
18- Available options:
19- - ACTION: enable or disable xp_cmdshell
20- Example usage:
21+ ACTION enable or disable xp_cmdshell
22+
23+ Examples
24+ --------
2125 netexec mssql $TARGET -u $username -p $password -M enable_cmdshell -o ACTION=enable
2226 netexec mssql $TARGET -u $username -p $password -M enable_cmdshell -o ACTION=disable
2327 """
2428 if "ACTION" in module_options :
2529 self .action = module_options ["ACTION" ].lower ()
2630 else :
27- context .log .error ("Missing required option: ACTION (enable/disable)" )
31+ context .log .fail ("Missing required option: ACTION (enable/disable)" )
32+ exit (1 )
2833
2934 def on_login (self , context , connection ):
3035 self .context = context
You can’t perform that action at this time.
0 commit comments