mirror of https://github.com/daffainfo/nuclei.git
fix nuclei loading ignored templates (#4849)
* fix tag include logic * fix unit test * remove quoting in extractor output * remove quote in debug code commanddev
parent
bbac102cf8
commit
b1b4f0fe76
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue