Files
sif/internal/nuclei/format/format.go
T
vmfunc 03a9488b65 internal/scan: migrate nuclei integration to v3 SDK
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>
2026-02-13 01:22:25 +01:00

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
}
}