1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-23 16:09:02 +00:00

Added a few scripts i comitted to CHANGELOG. Updated http-put to add

xmloutput and relax resposne status checks. Closes #150.
This commit is contained in:
gyani
2015-06-23 21:15:19 +00:00
parent 638a123ba6
commit e738915a12
2 changed files with 21 additions and 9 deletions

View File

@@ -1,5 +1,15 @@
# Nmap Changelog ($Id$); -*-text-*-
o [NSE] Added additional checks for succesful put request in http-put. [Oleg Mitrofanov]
o [NSE] Added an update for http-methods that checks all possible methods not in Allow
or Public header of OPTIONS response. [Gyanendra Mishra]
o [NSE] Added SLAXML, an XML Parser in lua Originally written by Gavin Kistner
or Phrogz. [Gyanendra Mishra]
o [NSE] Added hnap-info, detects and outputs info for hnap devices. [Gyanendra Mishra]
o [NSE] Allow ssl-enum-ciphers to run on non-typical ports when it is selected
by name. It will now send a service detection probe if the port is not a
typical SSL port and version scan (-sV) was not used. [Daniel Miller]

View File

@@ -20,8 +20,8 @@ Uploads a local file to a remote web server using the HTTP PUT method. You must
-- @args http-put.file - The full path to the local file that should be uploaded to the server
-- @args http-put.url - The remote directory and filename to store the file to e.g. (/uploads/file.txt)
--
--
-- @xmloutput
-- <elem key="result">/HNAP1 was successfully created</elem>
--
-- Version 0.1
-- Created 10/15/2011 - v0.1 - created by Patrik Karlsson <patrik@cqure.net>
@@ -33,10 +33,10 @@ license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"discovery", "intrusive"}
portrule = shortport.port_or_service( {80, 443}, {"http", "https"}, "tcp", "open")
portrule = shortport.http
action = function( host, port )
local output = stdnse.output_table()
local fname, url = stdnse.get_script_args('http-put.file', 'http-put.url')
if ( not(fname) or not(url) ) then
return
@@ -44,16 +44,18 @@ action = function( host, port )
local f = io.open(fname, "r")
if ( not(f) ) then
return stdnse.format_output(true, ("ERROR: Failed to open file: %s"):format(fname))
output.error = ("ERROR: Failed to open file: %s"):format(fname)
return output, output.error
end
local content = f:read("*all")
f:close()
local response = http.put(host, port, url, nil, content)
if ( response.status == 200 or response.status == 204 ) then
return stdnse.format_output(true, ("%s was successfully created"):format(url))
if ( 200 <= response.status and response.status < 210 ) then
output.result = ("%s was successfully created"):format(url)
return output, output.result
end
return stdnse.format_output(true, ("ERROR: %s could not be created"):format(url))
output.error = ("ERROR: %s could not be created"):format(url)
return output, output.error
end