Merge pull request #67 from Ice3man543/mzack9999-bruteforce-realtime-output-fix

Fixes realtime output in Bruteforce module
master
Nizamul Rana 2018-06-09 10:25:00 +05:30 committed by GitHub
commit 008281b441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -18,7 +18,8 @@ func consume(args ...interface{}) interface{} {
target := args[0].(string)
state := args[1].(*helper.State)
domain := args[2].(string)
ips, err := helper.ResolveHost(fmt.Sprintf("%s.%s", target, domain))
host := fmt.Sprintf("%s.%s", target, domain)
ips, err := helper.ResolveHost(host)
if err != nil {
return ""
}
@ -33,7 +34,11 @@ func consume(args ...interface{}) interface{} {
// We have a wildcard ip
return ""
}
return ips[0]
}
if !state.Silent {
if state.Verbose {
fmt.Printf("\n[%sBRUTE%s] %s : %s", helper.Info, helper.Reset, host, ips[0])
}
}
return ips[0]
}
@ -62,11 +67,6 @@ func Brute(state *helper.State, list []string, domain string) (subdomains []help
fqdn := job.Args[0].(string)
ip := job.Result.(string)
subdomain := helper.Domain{IP: ip, Fqdn: fmt.Sprintf("%s.%s", fqdn, domain)}
if state.Silent != true {
if state.Verbose == true {
fmt.Printf("\n[%sBRUTE%s] %s : %s", helper.Info, helper.Reset, subdomain.Fqdn, subdomain.IP)
}
}
ValidSubdomains = append(ValidSubdomains, subdomain)
}
}