Skip to content

Commit

Permalink
修复指纹匹配中, rule配置的version规则不生效的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
M09Ic committed Dec 16, 2022
1 parent 8666208 commit 5c2b39c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions v2/pkg/fingers/fingers.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ func (finger *Finger) Compile(portHandler func([]string) []string) error {
}

func (finger *Finger) ToResult(hasFrame, hasVuln bool, res string, index int) (frame *parsers.Framework, vuln *parsers.Vuln) {
if index+1 > len(finger.Rules) {
if index >= len(finger.Rules) {
return nil, nil
}

if hasFrame {
if res != "" {
frame = &parsers.Framework{Name: finger.Name, Version: res}
} else if finger.Rules[index].Version != "" {
frame = &parsers.Framework{Name: finger.Name, Version: res}
frame = &parsers.Framework{Name: finger.Name, Version: finger.Rules[index].Version}
} else {
frame = &parsers.Framework{Name: finger.Name}
}
Expand Down

0 comments on commit 5c2b39c

Please sign in to comment.