fix nuclei loading ignored templates (#4849)

* fix tag include logic

* fix unit test

* remove quoting in extractor output

* remove quote in debug code command
dev
Tarun Koyalwar 2024-03-09 21:20:54 +05:30 committed by GitHub
parent bbac102cf8
commit b1b4f0fe76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 4 deletions

View File

@ -408,7 +408,8 @@ func New(config *Config) (*TagFilter, error) {
if _, ok := filter.allowedTags[val]; !ok {
filter.allowedTags[val] = struct{}{}
}
delete(filter.block, val)
// Note: only tags specified in IncludeTags should be removed from the block list
// not normal tags like config.Tags
}
}
for _, tag := range config.IncludeTags {

View File

@ -85,7 +85,7 @@ func TestTagBasedFilter(t *testing.T) {
})
t.Run("match-includes", func(t *testing.T) {
filter, err := New(&Config{
Tags: []string{"fuzz"},
IncludeTags: []string{"fuzz"},
ExcludeTags: []string{"fuzz"},
})
require.Nil(t, err)

View File

@ -60,7 +60,7 @@ func (w *StandardWriter) formatScreen(output *ResultEvent) []byte {
for i, item := range output.ExtractedResults {
// trim trailing space
item = strings.TrimSpace(item)
item = strconv.QuoteToASCII(item)
item = strings.ReplaceAll(item, "\n", "\\n") // only replace newlines
builder.WriteString(w.aurora.BrightCyan(item).String())
if i != len(output.ExtractedResults)-1 {

View File

@ -317,7 +317,7 @@ func interpretEnvVars(source string, vars map[string]interface{}) string {
// bash mode
if strings.Contains(source, "$") {
for k, v := range vars {
source = strings.ReplaceAll(source, "$"+k, fmt.Sprintf("'%s'", v))
source = strings.ReplaceAll(source, "$"+k, fmt.Sprintf("%s", v))
}
}
// python mode