cve <terme de recherche ou CVE-Id>
Permet de chercher une vulnérabilité parmi la liste des CVE (Common Vulnerabilities and Exposures). Si le terme de recherche commence par 'CVE-', on recherche le bulletin CVE associé, sinon on recherche le(s) mot(s) clé(s).
-- startwith function
function string.startwith(String, Start)
return string.sub(string.lower(String), 1, string.len(Start)) == string.lower(Start)
end
BASE_URL = 'http://cve.mitre.org/cgi-bin/cve'
DEFAULT_URL = 'http://cve.mitre.org/cve/cve.html'
-- If no args, return DEFAULT_URL
if table.getn(args) == 0 then
escaline.return_url(DEFAULT_URL)
end
-- If start with 'CVE-', it's a CVE-ID
if string.startwith(table.concat(args), 'CVE-') then
escaline.return_url(BASE_URL..'name.cgi?name='..table.concat(args, ' '))
-- Else it's a keyword
else
escaline.return_url(BASE_URL..'key.cgi?keyword='..table.concat(args, ' '))
end
Tassatux