Manuel de la commande « cve »

Synopsis

cve <terme de recherche ou CVE-Id>

Description

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).

Statistiques

Nombre d'exécutions pour les 10 derniers jours

Code lua

-- 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

Contributeur

Tassatux