Index: nselib/httpspider.lua =================================================================== --- nselib/httpspider.lua (revision 28198) +++ nselib/httpspider.lua (working copy) @@ -92,6 +92,8 @@ domain_match = ("^%s://.*%s/"):format(o.base_url:getProto(), o.base_url:getDomain() ) end end + host_match = Options.escape(host_match) + domain_match = Options.escape(domain_match) -- set up the appropriate matching functions if ( o.withinhost ) then o.withinhost = function(url) return string.match(tostring(url), host_match) end @@ -107,6 +109,12 @@ addWhitelist = function(self, func) table.insert(self.whitelist, func) end, addBlacklist = function(self, func) table.insert(self.blacklist, func) end, + escape = function(str) + if ( str ) then + return str:gsub("%-", "%%-"):gsub("%.", "%%.") + end + end, + } -- Placeholder for form extraction code