Skip to content

Commit

Permalink
Add error handling in parameterAnalysis (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Nov 26, 2023
1 parent d3c7879 commit ea7379f
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions pkg/scanning/parameterAnlaysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,25 +177,27 @@ func ParameterAnalysis(target string, options model.Options, rl *rateLimiter) ma
doc.Find("form").Each(func(i int, s *goquery.Selection) {
action, _ := s.Attr("action")
if strings.HasPrefix(action, "/") || strings.HasPrefix(action, "?") { // assuming this is a relative URL
url, _ := url.Parse(action)
query := url.Query()
for aParam := range query {
p, dp = setP(p, dp, aParam, options)
count = count + 1
url, err := url.Parse(action)
if err == nil {
query := url.Query()
for aParam := range query {
p, dp = setP(p, dp, aParam, options)
count = count + 1
}
}

}
})
doc.Find("a").Each(func(i int, s *goquery.Selection) {
href, _ := s.Attr("href")
if strings.HasPrefix(href, "/") || strings.HasPrefix(href, "?") { // assuming this is a relative URL
url, _ := url.Parse(href)
query := url.Query()
for aParam := range query {
p, dp = setP(p, dp, aParam, options)
count = count + 1
url, err := url.Parse(href)
if err == nil {
query := url.Query()
for aParam := range query {
p, dp = setP(p, dp, aParam, options)
count = count + 1
}
}

}
})
printing.DalLog("INFO", "Found "+strconv.Itoa(count)+" testing point in DOM base parameter mining", options)
Expand Down

0 comments on commit ea7379f

Please sign in to comment.