mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 05:01:29 +00:00
nse_check_global cleanup
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
local io = require "io"
|
local io = require "io"
|
||||||
local nmap = require "nmap"
|
local nmap = require "nmap"
|
||||||
local stdnse = require "stdnse"
|
local stdnse = require "stdnse"
|
||||||
|
local string = require "string"
|
||||||
local table = require "table"
|
local table = require "table"
|
||||||
_ENV = stdnse.module("datafiles", stdnse.seeall)
|
_ENV = stdnse.module("datafiles", stdnse.seeall)
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ local http = require("http")
|
|||||||
local shortport = require("shortport")
|
local shortport = require("shortport")
|
||||||
local stdnse = require("stdnse")
|
local stdnse = require("stdnse")
|
||||||
local strbuf = require("strbuf")
|
local strbuf = require("strbuf")
|
||||||
|
local string = require("string")
|
||||||
local table = require("table")
|
local table = require("table")
|
||||||
description = [[ Checks for a Git repository found in a website's document root (GET /.git/<something> HTTP/1.1)
|
description = [[ Checks for a Git repository found in a website's document root (GET /.git/<something> HTTP/1.1)
|
||||||
Gets as much information about the repository as possible, including language/framework, Github
|
Gets as much information about the repository as possible, including language/framework, Github
|
||||||
@@ -157,7 +158,7 @@ function action(host, port)
|
|||||||
local short = string.sub(original_string, 1, 60) -- trim the string first, in case it is huge
|
local short = string.sub(original_string, 1, 60) -- trim the string first, in case it is huge
|
||||||
-- We try to cut off the newline if we can
|
-- We try to cut off the newline if we can
|
||||||
local no_newline = string.match(short, "(.-)\r?\n") -- we don't want such an open-ended regex on a potentially huge string
|
local no_newline = string.match(short, "(.-)\r?\n") -- we don't want such an open-ended regex on a potentially huge string
|
||||||
s = no_newline or short
|
local s = no_newline or short
|
||||||
if #original_string > #s then
|
if #original_string > #s then
|
||||||
-- If we cut off something, we want to put an ellipsis on the end
|
-- If we cut off something, we want to put an ellipsis on the end
|
||||||
s = description .. ": " .. s .. "..."
|
s = description .. ": " .. s .. "..."
|
||||||
|
|||||||
Reference in New Issue
Block a user