Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Fix #72: Cumulate parameters more than CVE template request path
Browse files Browse the repository at this point in the history
  • Loading branch information
dwisiswant0 committed Nov 26, 2020
1 parent 1279e5e commit 5774b0e
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions pkg/teler/teler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import (

// Analyze logs from threat resources
func Analyze(options *common.Options, logs *gonx.Entry) (bool, map[string]string) {
var match bool
var match, status bool

log := make(map[string]string)
rsc := resource.Get()

Expand Down Expand Up @@ -82,8 +83,6 @@ func Analyze(options *common.Options, logs *gonx.Entry) (bool, map[string]string
}
}
case "CVE":
// var status bool

req, err := url.ParseRequestURI(log["request_uri"])
if err != nil {
break
Expand All @@ -104,17 +103,17 @@ func Analyze(options *common.Options, logs *gonx.Entry) (bool, map[string]string
continue
}

// for _, m := range r.GetArray("matchers") {
// for _, s := range m.GetArray("status") {
// if log["status"] == s.String() {
// status = true
// }
// }
// }
for _, m := range r.GetArray("matchers") {
for _, s := range m.GetArray("status") {
if log["status"] == s.String() {
status = true
}
}
}

// if !status {
// continue
// }
if !status {
break
}

for _, p := range r.GetArray("path") {
diff, err := url.ParseRequestURI(
Expand Down Expand Up @@ -142,7 +141,7 @@ func Analyze(options *common.Options, logs *gonx.Entry) (bool, map[string]string
}
}

if len(diff.Query())-fq <= 3 {
if fq >= len(diff.Query()) {
match = true
}

Expand Down

0 comments on commit 5774b0e

Please sign in to comment.