mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Fixes a bug that prevented the script to find its resource file. Fixes #1608
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
#Nmap Changelog ($Id$); -*-text-*-
|
#Nmap Changelog ($Id$); -*-text-*-
|
||||||
|
|
||||||
|
o [NSE][GH#1608] Script http-fileupload-exploiter failed to locate its resource
|
||||||
|
file unless executed from a specific working directory. [nnposter]
|
||||||
|
|
||||||
o [NSE][GH#1571] The HTTP library now provides transparent support for gzip-
|
o [NSE][GH#1571] The HTTP library now provides transparent support for gzip-
|
||||||
encoded response body. (See https://github.com/nmap/nmap/pull/1571 for an
|
encoded response body. (See https://github.com/nmap/nmap/pull/1571 for an
|
||||||
overview.) [nnposter]
|
overview.) [nnposter]
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
|
|||||||
|
|
||||||
local http = require "http"
|
local http = require "http"
|
||||||
local io = require "io"
|
local io = require "io"
|
||||||
|
local nmap = require "nmap"
|
||||||
local string = require "string"
|
local string = require "string"
|
||||||
local httpspider = require "httpspider"
|
local httpspider = require "httpspider"
|
||||||
local shortport = require "shortport"
|
local shortport = require "shortport"
|
||||||
@@ -211,6 +212,16 @@ action = function(host, port)
|
|||||||
local foundfield = 0
|
local foundfield = 0
|
||||||
local fail = 0
|
local fail = 0
|
||||||
|
|
||||||
|
local pixel = nil
|
||||||
|
local pixelfn = nmap.fetchfile("nselib/data/pixel.gif")
|
||||||
|
if pixelfn then
|
||||||
|
local fh = io.open(pixelfn, "rb")
|
||||||
|
pixel = fh:read("a")
|
||||||
|
fh:close()
|
||||||
|
end
|
||||||
|
if not pixel then
|
||||||
|
stdnse.debug1("Warning: Test file nselib/data/pixel.gif not found")
|
||||||
|
end
|
||||||
|
|
||||||
local crawler = httpspider.Crawler:new( host, port, '/', { scriptname = SCRIPT_NAME } )
|
local crawler = httpspider.Crawler:new( host, port, '/', { scriptname = SCRIPT_NAME } )
|
||||||
|
|
||||||
@@ -300,16 +311,15 @@ action = function(host, port)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Method (3).
|
-- Method (3).
|
||||||
local inp = assert(io.open("nselib/data/pixel.gif", "rb"))
|
if pixel then
|
||||||
local image = inp:read("a")
|
buildRequests(host, port, submission, filefield["name"], "image/gif", partofrequest, uploadspaths, pixel)
|
||||||
|
|
||||||
buildRequests(host, port, submission, filefield["name"], "image/gif", partofrequest, uploadspaths, image)
|
result = makeAndCheckRequests(uploadspaths)
|
||||||
|
if result then
|
||||||
result = makeAndCheckRequests(uploadspaths)
|
table.insert(returntable, result)
|
||||||
if result then
|
else
|
||||||
table.insert(returntable, result)
|
fail = 1
|
||||||
else
|
end
|
||||||
fail = 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user