mirror of
https://github.com/nmap/nmap.git
synced 2026-11-28 18:40:10 +00:00
NSE: Fix potential crashes in ms-sql scripts and refactor deprecated format_output
This commit is contained in:
parent
d8c9880cd5
commit
2a7358dfe1
6 changed files with 17 additions and 15 deletions
|
|
@ -145,9 +145,12 @@ do_action, portrule, hostrule = mssql.Helper.InitScript(process_instance)
|
|||
|
||||
action = function(...)
|
||||
local scriptOutput = do_action(...)
|
||||
if not scriptOutput then
|
||||
return nil
|
||||
end
|
||||
if ( not(stdnse.get_script_args( {'ms-sql-xp-cmdshell.cmd', 'mssql-xp-cmdshell.cmd'} ) ) ) then
|
||||
table.insert(scriptOutput, 1, "(Use --script-args=ms-sql-xp-cmdshell.cmd='<CMD>' to change command.)")
|
||||
end
|
||||
|
||||
return stdnse.format_output( true, scriptOutput )
|
||||
return scriptOutput
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue