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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user