mirror of
https://github.com/lunchcat/sif.git
synced 2026-01-13 13:27:30 -08:00
- replace proprietary license with bsd 3-clause - update all go file headers with new retro terminal style - add header-check github action to enforce license headers - completely rewrite readme to be modern, sleek, and lowercase - fix broken badges
51 lines
2.0 KiB
Go
51 lines
2.0 KiB
Go
/*
|
|
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
|
|
: :
|
|
: █▀ █ █▀▀ · Blazing-fast pentesting suite :
|
|
: ▄█ █ █▀ · BSD 3-Clause License :
|
|
: :
|
|
: (c) 2022-2025 vmfunc (Celeste Hickenlooper), xyzeva, :
|
|
: lunchcat alumni & contributors :
|
|
: :
|
|
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
|
|
*/
|
|
|
|
package format
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/dropalldatabases/sif/internal/styles"
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/output"
|
|
)
|
|
|
|
func FormatLine(event *output.ResultEvent) string {
|
|
output := event.TemplateID
|
|
|
|
if event.MatcherName != "" {
|
|
output += ":" + styles.Highlight.Render(event.MatcherName)
|
|
} else if event.ExtractorName != "" {
|
|
output += ":" + styles.Highlight.Render(event.ExtractorName)
|
|
}
|
|
|
|
output += " [" + event.Type + "]"
|
|
output += " [" + formatSeverity(fmt.Sprintf("%s", event.Info.SeverityHolder.Severity)) + "]"
|
|
|
|
return output
|
|
}
|
|
|
|
func formatSeverity(severity string) string {
|
|
switch severity {
|
|
case "low":
|
|
return styles.SeverityLow.Render(severity)
|
|
case "medium":
|
|
return styles.SeverityMedium.Render(severity)
|
|
case "high":
|
|
return styles.SeverityHigh.Render(severity)
|
|
case "critical":
|
|
return styles.SeverityCritical.Render(severity)
|
|
default:
|
|
return severity
|
|
}
|
|
}
|