mirror of
https://github.com/lunchcat/sif.git
synced 2026-08-02 16:57:39 -07:00
replace ~100 lines of manual nuclei v2 plumbing (catalog, loader, core, protocolstate, protocolinit, hosterrorscache, interactsh, reporting, ratelimit, testutils) with the v3 lib SDK - NewNucleiEngineCtx + functional options. drops direct ratelimit dep, mholt/archiver and nwaples/rardecode (resolves dependabot CVE alerts for path traversal + DoS). Signed-off-by: vmfunc <celeste@linux.com>
49 lines
1.9 KiB
Go
49 lines
1.9 KiB
Go
/*
|
|
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
|
|
: :
|
|
: █▀ █ █▀▀ · Blazing-fast pentesting suite :
|
|
: ▄█ █ █▀ · BSD 3-Clause License :
|
|
: :
|
|
: (c) 2022-2025 vmfunc, xyzeva, :
|
|
: lunchcat alumni & contributors :
|
|
: :
|
|
·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·
|
|
*/
|
|
|
|
package format
|
|
|
|
import (
|
|
"github.com/dropalldatabases/sif/internal/styles"
|
|
"github.com/projectdiscovery/nuclei/v3/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(event.Info.SeverityHolder.Severity.String()) + "]"
|
|
|
|
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
|
|
}
|
|
}
|