1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

nse_check_global cleanup

This commit is contained in:
patrik
2012-07-29 09:26:23 +00:00
parent 1441aea655
commit bca0025032
2 changed files with 3 additions and 1 deletions

View File

@@ -13,6 +13,7 @@
local io = require "io"
local nmap = require "nmap"
local stdnse = require "stdnse"
local string = require "string"
local table = require "table"
_ENV = stdnse.module("datafiles", stdnse.seeall)

View File

@@ -21,6 +21,7 @@ local http = require("http")
local shortport = require("shortport")
local stdnse = require("stdnse")
local strbuf = require("strbuf")
local string = require("string")
local table = require("table")
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
@@ -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
-- 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
s = no_newline or short
local s = no_newline or short
if #original_string > #s then
-- If we cut off something, we want to put an ellipsis on the end
s = description .. ": " .. s .. "..."