mirror of https://github.com/daffainfo/nuclei.git
Fixed filter allow condition with tag and etags
parent
12deece54b
commit
d57d1ecae2
|
@ -26,6 +26,14 @@ var ErrExcluded = errors.New("the template was excluded")
|
|||
//
|
||||
// It returns true if the tag is specified, or false.
|
||||
func (t *tagFilter) match(tag, author, severity string) (bool, error) {
|
||||
matchedAny := false
|
||||
if len(t.allowedTags) > 0 {
|
||||
_, ok := t.allowedTags[tag]
|
||||
if !ok {
|
||||
return false, nil
|
||||
}
|
||||
matchedAny = true
|
||||
}
|
||||
_, ok := t.block[tag]
|
||||
if ok {
|
||||
if _, allowOk := t.matchAllows[tag]; allowOk {
|
||||
|
@ -33,14 +41,6 @@ func (t *tagFilter) match(tag, author, severity string) (bool, error) {
|
|||
}
|
||||
return false, ErrExcluded
|
||||
}
|
||||
matchedAny := false
|
||||
if len(t.allowedTags) > 0 {
|
||||
_, ok = t.allowedTags[tag]
|
||||
if !ok {
|
||||
return false, nil
|
||||
}
|
||||
matchedAny = true
|
||||
}
|
||||
if len(t.authors) > 0 {
|
||||
_, ok = t.authors[author]
|
||||
if !ok {
|
||||
|
@ -77,6 +77,7 @@ func (config *Config) createTagFilter() *tagFilter {
|
|||
if _, ok := filter.allowedTags[val]; !ok {
|
||||
filter.allowedTags[val] = struct{}{}
|
||||
}
|
||||
delete(filter.block, val)
|
||||
}
|
||||
}
|
||||
for _, tag := range config.Severities {
|
||||
|
|
Loading…
Reference in New Issue