这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions pkg/runner/enumerate.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ func (r *Runner) EnumerateSingleDomainWithCtx(ctx context.Context, domain string
}

hostEntry := resolve.HostEntry{Domain: domain, Host: subdomain, Source: result.Source}
if r.options.ResultCallback != nil && !r.options.RemoveWildcard {
r.options.ResultCallback(&hostEntry)
}

uniqueMap[subdomain] = hostEntry
// If the user asked to remove wildcard then send on the resolve
Expand Down Expand Up @@ -125,6 +128,9 @@ func (r *Runner) EnumerateSingleDomainWithCtx(ctx context.Context, domain string
// Add the found subdomain to a map.
if _, ok := foundResults[result.Host]; !ok {
foundResults[result.Host] = result
if r.options.ResultCallback != nil {
r.options.ResultCallback(&resolve.HostEntry{Domain: domain, Host: result.Host, Source: result.Source})
}
}
}
}
Expand Down Expand Up @@ -162,17 +168,6 @@ func (r *Runner) EnumerateSingleDomainWithCtx(ctx context.Context, domain string
numberOfSubDomains = len(uniqueMap)
}

if r.options.ResultCallback != nil {
if r.options.RemoveWildcard {
for host, result := range foundResults {
r.options.ResultCallback(&resolve.HostEntry{Domain: host, Host: result.Host, Source: result.Source})
}
} else {
for _, v := range uniqueMap {
r.options.ResultCallback(&v)
}
}
}
gologger.Info().Msgf("Found %d subdomains for %s in %s\n", numberOfSubDomains, domain, duration)

if r.options.Statistics {
Expand Down
Loading