mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Fixed global assignments with nse_check_globals
All fixes made by hand. A couple real bugs/errors fixed, due to copy-paste of code from other scripts without changing variable names.
This commit is contained in:
@@ -55,6 +55,7 @@ author = "George Chatzisofroniou"
|
||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
|
||||
local http = require "http"
|
||||
local io = require "io"
|
||||
local string = require "string"
|
||||
local httpspider = require "httpspider"
|
||||
local shortport = require "shortport"
|
||||
@@ -106,7 +107,7 @@ local function UploadRequest(host, port, submission, partofrequest, name, filena
|
||||
success = 0;
|
||||
|
||||
make = function(self)
|
||||
options = { header={} }
|
||||
local options = { header={} }
|
||||
options['header']['Content-Type'] = "multipart/form-data; boundary=AaB03x"
|
||||
options['content'] = self.partofrequest .. '--AaB03x\nContent-Disposition: form-data; name="' .. self.name .. '"; filename="' .. self.filename .. '"\nContent-Type: ' .. self.mime .. '\n\n' .. self.payload .. '\n--AaB03x--'
|
||||
|
||||
@@ -119,7 +120,7 @@ local function UploadRequest(host, port, submission, partofrequest, name, filena
|
||||
|
||||
checkPayload = function(self, uploadspaths)
|
||||
for _, uploadpath in ipairs(uploadspaths) do
|
||||
response = http.get(host, port, uploadpath .. '/' .. filename, { no_cache = true } )
|
||||
local response = http.get(host, port, uploadpath .. '/' .. filename, { no_cache = true } )
|
||||
|
||||
if response.status ~= 404 then
|
||||
if (response.body:match(self.check)) then
|
||||
@@ -260,6 +261,7 @@ action = function(host, port)
|
||||
local action_absolute = string.find(form["action"], "https*://")
|
||||
|
||||
-- Determine the path where the form needs to be submitted.
|
||||
local submission
|
||||
if action_absolute then
|
||||
submission = form["action"]
|
||||
else
|
||||
@@ -270,7 +272,7 @@ action = function(host, port)
|
||||
|
||||
foundform = 1
|
||||
|
||||
partofrequest, filefield = prepareRequest(form["fields"], fieldvalues)
|
||||
local partofrequest, filefield = prepareRequest(form["fields"], fieldvalues)
|
||||
|
||||
if filefield ~= 0 then
|
||||
|
||||
|
||||
Reference in New Issue
Block a user