Skip to content

Commit

Permalink
Merge pull request scipag#13 from gisforgirard/patch-1
Browse files Browse the repository at this point in the history
fixed missing variable error
  • Loading branch information
marcruef authored Mar 28, 2019
2 parents 947526b + 68c3f2e commit 8df2fd0
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions vulscan.nse
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Download: http://www.computec.ch/mruef/?s=software&l=x

--@thanks
-- I would like to thank a number of people which supported me in
-- developing this script: Stefan Friedli, Simon Zumstein, Sean Rütschi,
-- developing this script: Stefan Friedli, Simon Zumstein, Sean Rütschi,
-- Pascal Schaufelberger, David Fifield, Nabil Ouchn, Doggy Dog, Matt
-- Brown, Matthew Phillips, and Sebastian Brabetzl.

Expand All @@ -215,6 +215,17 @@ portrule = function(host, port)
end
end

function split(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={}
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
table.insert(t, str)
end
return t
end

action = function(host, port)
local prod = port.version.product -- product name
local ver = port.version.version -- product version
Expand Down Expand Up @@ -322,7 +333,7 @@ function find_vulnerabilities(prod, ver, db)
prod = string.gsub(prod, " smtpd", "")
prod = string.gsub(prod, " ftpd", "")

local prod_words = stdnse.strsplit(" ", prod)
local prod_words = split(" ", prod)

stdnse.print_debug(1, "vulscan: Starting search of " .. prod ..
" in " .. db ..
Expand Down Expand Up @@ -464,7 +475,7 @@ end

-- Get the row of a CSV file
function extract_from_table(line, col, del)
local val = stdnse.strsplit(del, line)
local val = split(del, line)

if type(val[col]) == "string" then
return val[col]
Expand Down

0 comments on commit 8df2fd0

Please sign in to comment.