Skip to content

Commit

Permalink
Fix all ips probing for urls
Browse files Browse the repository at this point in the history
  • Loading branch information
zerodivisi0n committed Oct 23, 2021
1 parent cf231c0 commit 2559dce
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,12 +723,16 @@ func (r *Runner) targets(hp *httpx.HTTPX, target string) chan string {
results <- ip
}
} else if r.options.ProbeAllIPS {
ips, _, err := getDNSData(hp, target)
URL, err := urlutil.Parse(target)
if err != nil {
results <- target
}
ips, _, err := getDNSData(hp, URL.Host)
if err != nil || len(ips) == 0 {
results <- target
}
for _, ip := range ips {
results <- strings.Join([]string{ip, target}, ",")
results <- strings.Join([]string{ip, URL.Host, target}, ",")
}
} else {
results <- target
Expand All @@ -746,11 +750,11 @@ func (r *Runner) analyze(hp *httpx.HTTPX, protocol, domain, method, origInput st
retry:
var customHost, customIP string
if scanopts.ProbeAllIPS {
parts := strings.SplitN(domain, ",", 2) // support `ProbeAllIPS` with `VHostInput`
if len(parts) == 2 {
parts := strings.SplitN(domain, ",", 3)
if len(parts) == 3 {
customIP = parts[0]
domain = parts[1]
customHost = parts[1]
domain = parts[2]
}
}
if scanopts.VHostInput {
Expand Down

0 comments on commit 2559dce

Please sign in to comment.