-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from cerberauth/display-scans-performed
Add summary report output with scans number per status
- Loading branch information
Showing
12 changed files
with
407 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package printtable | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/cerberauth/vulnapi/report" | ||
"github.com/cerberauth/vulnapi/scan/discover/fingerprint" | ||
"github.com/olekukonko/tablewriter" | ||
) | ||
|
||
func FingerprintScanReport(reporter *report.Reporter) { | ||
report := reporter.GetReportByID(fingerprint.DiscoverFingerPrintScanID) | ||
if report == nil || !report.HasData() { | ||
return | ||
} | ||
|
||
data, ok := report.Data.(fingerprint.FingerPrintData) | ||
if !ok { | ||
return | ||
} | ||
|
||
rows := [][]string{} | ||
for _, fp := range data.AuthServices { | ||
rows = append(rows, []string{"Authentication Service", fp.Name}) | ||
} | ||
|
||
for _, fp := range data.CDNs { | ||
rows = append(rows, []string{"CDN", fp.Name}) | ||
} | ||
|
||
for _, fp := range data.Caching { | ||
rows = append(rows, []string{"Caching", fp.Name}) | ||
} | ||
|
||
for _, fp := range data.CertificateAuthority { | ||
rows = append(rows, []string{"Certificate Authority", fp.Name}) | ||
} | ||
|
||
for _, fp := range data.Databases { | ||
rows = append(rows, []string{"Database", fp.Name}) | ||
} | ||
|
||
for _, fp := range data.Frameworks { | ||
rows = append(rows, []string{"Framework", fp.Name}) | ||
} | ||
|
||
for _, fp := range data.Hosting { | ||
rows = append(rows, []string{"Hosting", fp.Name}) | ||
} | ||
|
||
for _, fp := range data.Languages { | ||
rows = append(rows, []string{"Language", fp.Name}) | ||
} | ||
|
||
for _, fp := range data.OS { | ||
rows = append(rows, []string{"Operating System", fp.Name}) | ||
} | ||
|
||
for _, fp := range data.SecurityServices { | ||
rows = append(rows, []string{"Security Service", fp.Name}) | ||
} | ||
|
||
for _, fp := range data.ServerExtensions { | ||
rows = append(rows, []string{"Server Extension", fp.Name}) | ||
} | ||
|
||
for _, fp := range data.Servers { | ||
rows = append(rows, []string{"Server", fp.Name}) | ||
} | ||
|
||
if len(rows) == 0 { | ||
return | ||
} | ||
|
||
fmt.Println() | ||
headers := []string{"Technologie/Service", "Value"} | ||
table := CreateTable(headers) | ||
|
||
tableColors := make([]tablewriter.Colors, len(headers)) | ||
tableColors[0] = tablewriter.Colors{tablewriter.Bold} | ||
tableColors[1] = tablewriter.Colors{tablewriter.Bold} | ||
|
||
for _, row := range rows { | ||
table.Rich(row, tableColors) | ||
} | ||
|
||
table.Render() | ||
fmt.Println() | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package printtable | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/olekukonko/tablewriter" | ||
) | ||
|
||
func CreateTable(headers []string) *tablewriter.Table { | ||
table := tablewriter.NewWriter(os.Stdout) | ||
table.SetHeader(headers) | ||
table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false}) | ||
table.SetCenterSeparator("|") | ||
table.SetAutoMergeCellsByColumnIndex([]int{0}) | ||
|
||
return table | ||
} | ||
|
||
func DisplayUnexpectedErrorMessage() { | ||
fmt.Println() | ||
fmt.Println("If you think that report is not accurate or if you have any suggestions for improvements, please open an issue at: https://github.com/cerberauth/vulnapi/issues/new.") | ||
} |
Oops, something went wrong.