feat(exploit): add exploit link in NVD as a source (#1096)

Added Refs information with NVD's Expoit tag as an information source
for Exploit.
This commit is contained in:
Kota Kanbe
2020-12-16 07:10:18 +09:00
committed by GitHub
parent d576b6c6c1
commit cfbf779f9b
5 changed files with 37 additions and 59 deletions

View File

@@ -245,8 +245,6 @@ func DetectWordPressCves(r *models.ScanResult) error {
// FillCveInfo fill scanResult with cve info.
func FillCveInfo(dbclient DBClient, r *models.ScanResult) error {
// Fill CVE information
util.Log.Infof("Fill CVE detailed with gost")
if err := gost.NewClient(r.Family).FillCVEsWithRedHat(dbclient.GostDB, r); err != nil {
return xerrors.Errorf("Failed to fill with gost: %w", err)
@@ -291,7 +289,7 @@ func fillCvesWithNvdJvn(driver cvedb.DB, r *models.ScanResult) error {
return err
}
for _, d := range ds {
nvd := models.ConvertNvdJSONToModel(d.CveID, d.NvdJSON)
nvd, exploits := models.ConvertNvdJSONToModel(d.CveID, d.NvdJSON)
jvn := models.ConvertJvnToModel(d.CveID, d.Jvn)
alerts := fillCertAlerts(&d)
@@ -306,6 +304,7 @@ func fillCvesWithNvdJvn(driver cvedb.DB, r *models.ScanResult) error {
}
}
vinfo.AlertDict = alerts
vinfo.Exploits = append(vinfo.Exploits, exploits...)
r.ScannedCves[cveID] = vinfo
break
}

View File

@@ -626,7 +626,9 @@ func summaryLines(r models.ScanResult) string {
}
exploits := ""
if 0 < len(vinfo.Exploits) || 0 < len(vinfo.Metasploits) {
if 0 < len(vinfo.Metasploits) {
exploits = "EXP"
} else if 0 < len(vinfo.Exploits) {
exploits = "POC"
}