Skip to content

Commit

Permalink
Check into all dsl variables
Browse files Browse the repository at this point in the history
- Before, it was checking only not empty variables
  - We are adding body only if -irr flag is passed, make it work when
    -mdc and -fdc flag is passed
  • Loading branch information
ShubhamRasal committed Mar 30, 2023
1 parent a45e669 commit 7e732e6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/projectdiscovery/httpx/common/hashes/jarm"
"github.com/projectdiscovery/mapcidr/asn"
errorutil "github.com/projectdiscovery/utils/errors"
mapsutil "github.com/projectdiscovery/utils/maps"

"github.com/bluele/gcache"
"github.com/logrusorgru/aurora"
Expand Down Expand Up @@ -663,11 +662,11 @@ func (r *Runner) RunEnumeration() {
gologger.Warning().Msgf("Could not decode response: %s\n", err)
continue
}

flatMap := make(map[string]any)
mapsutil.Walk(rawMap, func(k string, v any) {
flatMap[k] = v
})
dslVars, _ := dslVariables()
flatMap := make(map[string]interface{})
for _, v := range dslVars {
flatMap[v] = rawMap[v]
}

if r.options.OutputMatchCondition != "" {
res, err := dsl.EvalExpr(r.options.OutputMatchCondition, flatMap)
Expand Down Expand Up @@ -1305,7 +1304,7 @@ retry:
var request string
var rawResponseHeader string
var responseHeader map[string]interface{}
if scanopts.ResponseInStdout {
if scanopts.ResponseInStdout || r.options.OutputMatchCondition != "" || r.options.OutputFilterCondition != "" {
serverResponseRaw = string(resp.Data)
request = string(requestDump)
responseHeader = normalizeHeaders(resp.Headers)
Expand Down

0 comments on commit 7e732e6

Please sign in to comment.