-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 #315 from vzamanillo/serverity-on-match
Added severity to match output message
- Loading branch information
Showing
10 changed files
with
102 additions
and
58 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
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,42 @@ | ||
package colorizer | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/logrusorgru/aurora" | ||
) | ||
|
||
const ( | ||
fgOrange uint8 = 208 | ||
undefined string = "undefined" | ||
) | ||
|
||
// NucleiColorizer contains the severity color mapping | ||
type NucleiColorizer struct { | ||
Colorizer aurora.Aurora | ||
SeverityMap map[string]string | ||
} | ||
|
||
// NewNucleiColorizer initializes the new nuclei colorizer | ||
func NewNucleiColorizer(colorizer aurora.Aurora) *NucleiColorizer { | ||
return &NucleiColorizer{ | ||
Colorizer: colorizer, | ||
SeverityMap: map[string]string{ | ||
"info": colorizer.Blue("info").String(), | ||
"low": colorizer.Green("low").String(), | ||
"medium": colorizer.Yellow("medium").String(), | ||
"high": colorizer.Index(fgOrange, "high").String(), | ||
"critical": colorizer.Red("critical").String(), | ||
}, | ||
} | ||
} | ||
|
||
// GetColorizedSeverity returns the colorized severity string | ||
func (r *NucleiColorizer) GetColorizedSeverity(severity string) string { | ||
sev := r.SeverityMap[strings.ToLower(severity)] | ||
if sev == "" { | ||
return undefined | ||
} | ||
|
||
return sev | ||
} |
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
Oops, something went wrong.