Skip to content

Commit 1c77bc1

Browse files
authored
feat: replace NVD-column with packages-column at output of report (future-architect#1414)
* replace NVD-col with packages-col * fix typo * set table row line
1 parent ec31c54 commit 1c77bc1

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

reporter/util.go

+11-8
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ No CVE-IDs are found in updatable packages.
255255
// v2max := vinfo.MaxCvss2Score().Value.Score
256256
// v3max := vinfo.MaxCvss3Score().Value.Score
257257

258+
packnames := strings.Join(vinfo.AffectedPackages.Names(), ", ")
258259
// packname := vinfo.AffectedPackages.FormatTuiSummary()
259260
// packname += strings.Join(vinfo.CpeURIs, ", ")
260261

@@ -263,12 +264,12 @@ No CVE-IDs are found in updatable packages.
263264
exploits = "POC"
264265
}
265266

266-
link := ""
267-
if strings.HasPrefix(vinfo.CveID, "CVE-") {
268-
link = fmt.Sprintf("https://nvd.nist.gov/vuln/detail/%s", vinfo.CveID)
269-
} else if strings.HasPrefix(vinfo.CveID, "WPVDBID-") {
270-
link = fmt.Sprintf("https://wpscan.com/vulnerabilities/%s", strings.TrimPrefix(vinfo.CveID, "WPVDBID-"))
271-
}
267+
// link := ""
268+
// if strings.HasPrefix(vinfo.CveID, "CVE-") {
269+
// link = fmt.Sprintf("https://nvd.nist.gov/vuln/detail/%s", vinfo.CveID)
270+
// } else if strings.HasPrefix(vinfo.CveID, "WPVDBID-") {
271+
// link = fmt.Sprintf("https://wpscan.com/vulnerabilities/%s", strings.TrimPrefix(vinfo.CveID, "WPVDBID-"))
272+
// }
272273

273274
data = append(data, []string{
274275
vinfo.CveIDDiffFormat(),
@@ -279,7 +280,7 @@ No CVE-IDs are found in updatable packages.
279280
exploits,
280281
fmt.Sprintf("%9s", vinfo.AlertDict.FormatSource()),
281282
fmt.Sprintf("%7s", vinfo.PatchStatus(r.Packages)),
282-
link,
283+
packnames,
283284
})
284285
}
285286

@@ -294,9 +295,11 @@ No CVE-IDs are found in updatable packages.
294295
"PoC",
295296
"Alert",
296297
"Fixed",
297-
"NVD",
298+
// "NVD",
299+
"Packages",
298300
})
299301
table.SetBorder(true)
302+
table.SetRowLine(true)
300303
table.AppendBulk(data)
301304
table.Render()
302305
return fmt.Sprintf("%s\n%s", header, b.String())

scanner/scanner.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ func validateSSHConfig(c *config.ServerInfo) error {
456456
sshKeyScanArgs = append(sshKeyScanArgs, fmt.Sprintf("%s >> %s", hostname, knownHostsPaths[0]))
457457
sshConnCmd := fmt.Sprintf("ssh %s", strings.Join(sshConnArgs, " "))
458458
sshKeyScancmd := fmt.Sprintf("ssh-keyscan %s", strings.Join(sshKeyScanArgs, " "))
459-
return xerrors.Errorf("Failed to find the host in known_hosts. Plaese exec `$ %s` or `$ %s`", sshConnCmd, sshKeyScancmd)
459+
return xerrors.Errorf("Failed to find the host in known_hosts. Please exec `$ %s` or `$ %s`", sshConnCmd, sshKeyScancmd)
460460
}
461461

462462
func (s Scanner) detectContainerOSes(hosts []osTypeInterface) (actives, inactives []osTypeInterface) {

0 commit comments

Comments
 (0)