Display exploit codes information for each detected CVE-IDs (#729)

* add exploit

* bug fix while loading config in TUI, display in format-full-text

* fix readme
This commit is contained in:
sadayuki-matsuno
2018-11-03 16:36:59 +09:00
committed by Kota Kanbe
parent 678e72a8b6
commit 9865eab2c0
16 changed files with 568 additions and 24 deletions

View File

@@ -309,12 +309,13 @@ func (r ScanResult) FormatTextReportHeadedr() string {
buf.WriteString("=")
}
return fmt.Sprintf("%s\n%s\n%s, %s, %s\n",
return fmt.Sprintf("%s\n%s\n%s, %s, %s, %s\n",
r.ServerInfo(),
buf.String(),
r.ScannedCves.FormatCveSummary(),
r.ScannedCves.FormatFixedStatus(r.Packages),
r.FormatUpdatablePacksSummary(),
r.FormatExploitCveSummary(),
)
}
@@ -338,6 +339,17 @@ func (r ScanResult) FormatUpdatablePacksSummary() string {
nUpdatable)
}
// FormatExploitCveSummary returns a summary of exploit cve
func (r ScanResult) FormatExploitCveSummary() string {
nExploitCve := 0
for _, vuln := range r.ScannedCves {
if 0 < len(vuln.Exploits) {
nExploitCve++
}
}
return fmt.Sprintf("%d cves with exploit", nExploitCve)
}
func (r ScanResult) isDisplayUpdatableNum() bool {
var mode config.ScanMode
s, _ := config.Conf.Servers[r.ServerName]