mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Remove trailing whitespace in lua files
Whitespace is not significant, so this should not be a problem. https://secwiki.org/w/Nmap/Code_Standards
This commit is contained in:
@@ -16,7 +16,7 @@ the target to retrieve a web page from www.google.com.
|
||||
---
|
||||
-- @args proxy.url Url that will be requested to the proxy
|
||||
-- @args proxy.pattern Pattern that will be searched inside the request results
|
||||
--
|
||||
--
|
||||
-- @usage
|
||||
-- nmap --script http-open-proxy.nse \
|
||||
-- --script-args proxy.url=<url>,proxy.pattern=<pattern>
|
||||
@@ -44,7 +44,7 @@ author = "Arturo 'Buanzo' Busleiman"
|
||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
categories = {"default", "discovery", "external", "safe"}
|
||||
|
||||
--- Performs the custom test, with user's arguments
|
||||
--- Performs the custom test, with user's arguments
|
||||
-- @param host The host table
|
||||
-- @param port The port table
|
||||
-- @param test_url The url te send the request
|
||||
@@ -58,7 +58,7 @@ function custom_test(host, port, test_url, pattern)
|
||||
-- otherwise it is pattern check result.
|
||||
|
||||
-- strip hostname
|
||||
if not string.match(test_url, "^http://.*") then
|
||||
if not string.match(test_url, "^http://.*") then
|
||||
test_url = "http://" .. test_url
|
||||
stdnse.print_debug("URL missing scheme. URL concatenated to http://")
|
||||
end
|
||||
@@ -107,7 +107,7 @@ function default_test(host, port)
|
||||
local get_cstatus, head_cstatus
|
||||
|
||||
-- Start test n1 -> google.com
|
||||
-- making requests
|
||||
-- making requests
|
||||
local test_url = "http://www.google.com"
|
||||
local hostname = "www.google.com"
|
||||
local pattern = "^server: gws"
|
||||
@@ -131,7 +131,7 @@ function default_test(host, port)
|
||||
-- if proxy is open, return it!
|
||||
if fstatus then return fstatus, "Methods supported: " .. response end
|
||||
|
||||
-- if we receive a invalid response, but with a valid
|
||||
-- if we receive a invalid response, but with a valid
|
||||
-- response code, we should make a next attempt.
|
||||
-- if we do not receive any valid status code,
|
||||
-- there is no reason to keep testing... the proxy is probably not open
|
||||
@@ -147,7 +147,7 @@ function default_test(host, port)
|
||||
|
||||
if get_status then fstatus = true; response = response .. " GET" end
|
||||
if head_status then fstatus = true; response = response .. " HEAD" end
|
||||
if conn_status then
|
||||
if conn_status then
|
||||
if not cstatus then response = response .. " CONNECTION" end
|
||||
cstatus = true
|
||||
end
|
||||
@@ -169,7 +169,7 @@ function default_test(host, port)
|
||||
if not cstatus then response = response .. " CONNECTION" end
|
||||
cstatus = true
|
||||
end
|
||||
|
||||
|
||||
if fstatus then return fstatus, "Methods supported:" .. response end
|
||||
if not get_cstatus then
|
||||
stdnse.print_debug("Test 3 - Computer History\nReceived valid status codes, but pattern does not match")
|
||||
@@ -195,14 +195,14 @@ action = function(host, port)
|
||||
local def_test = true
|
||||
local test_url, pattern
|
||||
|
||||
test_url, pattern = proxy.return_args()
|
||||
|
||||
test_url, pattern = proxy.return_args()
|
||||
|
||||
if(test_url) then def_test = false end
|
||||
if(pattern) then pattern = ".*" .. pattern .. ".*" end
|
||||
|
||||
if def_test
|
||||
then fstatus, supported_methods = default_test(host, port)
|
||||
else fstatus, supported_methods = custom_test(host, port, test_url, pattern);
|
||||
if def_test
|
||||
then fstatus, supported_methods = default_test(host, port)
|
||||
else fstatus, supported_methods = custom_test(host, port, test_url, pattern);
|
||||
end
|
||||
|
||||
-- If any of the tests were OK, then the proxy is potentially open
|
||||
|
||||
Reference in New Issue
Block a user