1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 22:21:29 +00:00

Re-indent some scripts. Whitespace-only commit

https://secwiki.org/w/Nmap/Code_Standards
This commit is contained in:
dmiller
2014-01-31 17:36:09 +00:00
parent bcf991c128
commit 298be5bfaa
50 changed files with 3296 additions and 3296 deletions

View File

@@ -57,49 +57,49 @@ categories = {"discovery", "safe"}
portrule = shortport.port_or_service(8098, "http")
local filter = {
["sys_system_architecture"] = { name = "Architecture" },
["mem_total"] = { name = "Total Memory" },
["crypto_version"] = { name = "Crypto version" },
["skerl_version"] = { name = "Skerl version" },
["os_mon_version"] = { name = "OS mon. version" },
["nodename"] = { name = "Node name" },
["basho_stats_version"] = { name = "Basho version" },
["lager_version"] = { name = "Lager version" },
["cluster_info_version"] = { name = "Cluster info version" },
["luke_version"] = { name = "Luke version" },
["sasl_version"] = { name = "SASL version" },
["sys_driver_version"] = { name = "System driver version" },
["bitcask_version"] = { name = "Bitcask version" },
["riak_search_version"] = { name = "Riak search version" },
["kernel_version"] = { name = "Riak kernel version" },
["stdlib_version"] = { name = "Riak stdlib version" },
["basho_metrics_version"] = { name = "Basho metrics version" },
["webmachine_version"] = { name = "WebMachine version" },
["public_key_version"] = { name = "Public key version" },
["riak_core_version"] = { name = "Riak vore version" },
["riak_pipe_version"] = { name = "Riak pipe version" },
["runtime_tools_version"] = { name = "Runtime tools version" },
["ssl_version"] = { name = "SSL version" },
["mochiweb_version"] = { name = "MochiWeb version"},
["erlang_js_version"] = { name = "Erlang JavaScript version" },
["riak_kv_version"] = { name = "Riak kv version" },
["luwak_version"] = { name = "Luwak version"},
["merge_index_version"] = { name = "Merge index version" },
["inets_version"] = { name = "Inets version" },
["storage_backend"] = { name = "Storage backend" },
["riak_sysmon_version"] = { name = "Riak sysmon version" },
["sys_system_architecture"] = { name = "Architecture" },
["mem_total"] = { name = "Total Memory" },
["crypto_version"] = { name = "Crypto version" },
["skerl_version"] = { name = "Skerl version" },
["os_mon_version"] = { name = "OS mon. version" },
["nodename"] = { name = "Node name" },
["basho_stats_version"] = { name = "Basho version" },
["lager_version"] = { name = "Lager version" },
["cluster_info_version"] = { name = "Cluster info version" },
["luke_version"] = { name = "Luke version" },
["sasl_version"] = { name = "SASL version" },
["sys_driver_version"] = { name = "System driver version" },
["bitcask_version"] = { name = "Bitcask version" },
["riak_search_version"] = { name = "Riak search version" },
["kernel_version"] = { name = "Riak kernel version" },
["stdlib_version"] = { name = "Riak stdlib version" },
["basho_metrics_version"] = { name = "Basho metrics version" },
["webmachine_version"] = { name = "WebMachine version" },
["public_key_version"] = { name = "Public key version" },
["riak_core_version"] = { name = "Riak vore version" },
["riak_pipe_version"] = { name = "Riak pipe version" },
["runtime_tools_version"] = { name = "Runtime tools version" },
["ssl_version"] = { name = "SSL version" },
["mochiweb_version"] = { name = "MochiWeb version"},
["erlang_js_version"] = { name = "Erlang JavaScript version" },
["riak_kv_version"] = { name = "Riak kv version" },
["luwak_version"] = { name = "Luwak version"},
["merge_index_version"] = { name = "Merge index version" },
["inets_version"] = { name = "Inets version" },
["storage_backend"] = { name = "Storage backend" },
["riak_sysmon_version"] = { name = "Riak sysmon version" },
}
local order = {
"nodename", "sys_system_architecture", "storage_backend", "mem_total",
"crypto_version", "skerl_version", "os_mon_version", "basho_stats_version",
"lager_version", "cluster_info_version", "luke_version", "sasl_version",
"sys_driver_version", "bitcask_version", "riak_search_version",
"kernel_version", "stdlib_version", "basho_metrics_version",
"webmachine_version", "public_key_version", "riak_core_version",
"riak_pipe_version", "runtime_tools_version", "ssl_version",
"mochiweb_version", "erlang_js_version", "riak_kv_version",
"luwak_version", "merge_index_version", "inets_version", "riak_sysmon_version"
"nodename", "sys_system_architecture", "storage_backend", "mem_total",
"crypto_version", "skerl_version", "os_mon_version", "basho_stats_version",
"lager_version", "cluster_info_version", "luke_version", "sasl_version",
"sys_driver_version", "bitcask_version", "riak_search_version",
"kernel_version", "stdlib_version", "basho_metrics_version",
"webmachine_version", "public_key_version", "riak_core_version",
"riak_pipe_version", "runtime_tools_version", "ssl_version",
"mochiweb_version", "erlang_js_version", "riak_kv_version",
"luwak_version", "merge_index_version", "inets_version", "riak_sysmon_version"
}
@@ -107,39 +107,39 @@ local function fail(err) return ("\n ERROR: %s"):format(err) end
action = function(host, port)
local response = http.get(host, port, "/stats")
local response = http.get(host, port, "/stats")
if ( not(response) or response.status ~= 200 ) then
return
end
if ( not(response) or response.status ~= 200 ) then
return
end
-- Identify servers that answer 200 to invalid HTTP requests and exit as these would invalidate the tests
local _, http_status, _ = http.identify_404(host,port)
if ( http_status == 200 ) then
stdnse.print_debug(1, "%s: Exiting due to ambiguous response from web server on %s:%s. All URIs return status 200.", SCRIPT_NAME, host.ip, port.number)
return false
end
-- Identify servers that answer 200 to invalid HTTP requests and exit as these would invalidate the tests
local _, http_status, _ = http.identify_404(host,port)
if ( http_status == 200 ) then
stdnse.print_debug(1, "%s: Exiting due to ambiguous response from web server on %s:%s. All URIs return status 200.", SCRIPT_NAME, host.ip, port.number)
return false
end
-- Silently abort if the server responds as anything different than
-- MochiWeb
if ( response.header['server'] and
not(response.header['server']:match("MochiWeb")) ) then
return
end
-- Silently abort if the server responds as anything different than
-- MochiWeb
if ( response.header['server'] and
not(response.header['server']:match("MochiWeb")) ) then
return
end
local status, parsed = json.parse(response.body)
if ( not(status) ) then
return fail("Failed to parse response")
end
local status, parsed = json.parse(response.body)
if ( not(status) ) then
return fail("Failed to parse response")
end
local result = tab.new(2)
for _, item in ipairs(order) do
if ( parsed[item] ) then
local name = filter[item].name
local val = ( filter[item].func and filter[item].func(parsed[item]) or parsed[item] )
tab.addrow(result, name, val)
end
end
return stdnse.format_output(true, tab.dump(result))
local result = tab.new(2)
for _, item in ipairs(order) do
if ( parsed[item] ) then
local name = filter[item].name
local val = ( filter[item].func and filter[item].func(parsed[item]) or parsed[item] )
tab.addrow(result, name, val)
end
end
return stdnse.format_output(true, tab.dump(result))
end
end