mirror of
https://github.com/lunchcat/sif.git
synced 2026-07-10 14:12:10 -07:00
648fa8d2c8
rolls the (c) 2022-2025 banner to 2022-2026 across all go files, the startup banner in sif.go, and the header-check workflow's expected format. comment-only, nothing else changes.
49 lines
1.9 KiB
Go
49 lines
1.9 KiB
Go
/*
|
|
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
|
|
: :
|
|
: █▀ █ █▀▀ · Blazing-fast pentesting suite :
|
|
: ▄█ █ █▀ · BSD 3-Clause License :
|
|
: :
|
|
: (c) 2022-2026 vmfunc, xyzeva, :
|
|
: lunchcat alumni & contributors :
|
|
: :
|
|
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
|
|
*/
|
|
|
|
package format
|
|
|
|
import (
|
|
"github.com/dropalldatabases/sif/internal/styles"
|
|
nucleiout "github.com/projectdiscovery/nuclei/v3/pkg/output"
|
|
)
|
|
|
|
func FormatLine(event *nucleiout.ResultEvent) string {
|
|
line := event.TemplateID
|
|
|
|
if event.MatcherName != "" {
|
|
line += ":" + styles.Highlight.Render(event.MatcherName)
|
|
} else if event.ExtractorName != "" {
|
|
line += ":" + styles.Highlight.Render(event.ExtractorName)
|
|
}
|
|
|
|
line += " [" + event.Type + "]"
|
|
line += " [" + formatSeverity(event.Info.SeverityHolder.Severity.String()) + "]"
|
|
|
|
return line
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|