Added verifying support
This commit is contained in:
parent
e32dc646b1
commit
b08e5c43c3
@ -8,9 +8,9 @@ Blink is a DNS bruteforcer made in Go
|
|||||||
## Features
|
## Features
|
||||||
<!--
|
<!--
|
||||||
+ ENT (Empty non-terminal)
|
+ ENT (Empty non-terminal)
|
||||||
+ Verifying query
|
|
||||||
-->
|
-->
|
||||||
+ UDP query
|
+ UDP query
|
||||||
|
+ Verifying query
|
||||||
+ IPv4/IPv6 support
|
+ IPv4/IPv6 support
|
||||||
+ Wildcard detection
|
+ Wildcard detection
|
||||||
|
|
||||||
|
@ -210,6 +210,7 @@ func init() {
|
|||||||
rootCmd.Flags().BoolVarP(&opts.IPv6, "ipv6", "i", false, "Query for IPv6")
|
rootCmd.Flags().BoolVarP(&opts.IPv6, "ipv6", "i", false, "Query for IPv6")
|
||||||
rootCmd.Flags().BoolVarP(&wildcard, "wildcard", "d", false, "Query for wildcard")
|
rootCmd.Flags().BoolVarP(&wildcard, "wildcard", "d", false, "Query for wildcard")
|
||||||
rootCmd.Flags().IntVarP(&opts.Timeout, "timeout", "t", 5, "Query timeout")
|
rootCmd.Flags().IntVarP(&opts.Timeout, "timeout", "t", 5, "Query timeout")
|
||||||
|
rootCmd.Flags().BoolVarP(&opts.Verify, "verify", "y", false, "Verify query")
|
||||||
rootCmd.Flags().IntVarP(&opts.Threads, "threads", "c", 1, "Concurrent threads")
|
rootCmd.Flags().IntVarP(&opts.Threads, "threads", "c", 1, "Concurrent threads")
|
||||||
rootCmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "Verbose logging")
|
rootCmd.Flags().BoolVarP(&verbose, "verbose", "v", false, "Verbose logging")
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
type Query struct {
|
type Query struct {
|
||||||
Client *dns.Client // DNS client
|
Client *dns.Client // DNS client
|
||||||
IPv6 bool // IPv6 mode
|
IPv6 bool // IPv6 mode
|
||||||
|
Verify bool // Verify mode
|
||||||
Resolvers []string // Target resolvers
|
Resolvers []string // Target resolvers
|
||||||
Domain string // Target domain
|
Domain string // Target domain
|
||||||
Subdomain string // Target subdomain
|
Subdomain string // Target subdomain
|
||||||
|
@ -45,6 +45,15 @@ func (q *Query) Lookup() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verify check
|
||||||
|
if q.Verify {
|
||||||
|
if Verify(q.Subdomain) {
|
||||||
|
result.Error = errors.New(fmt.Sprintf("Could not verify %s", q.Subdomain))
|
||||||
|
q.Results <- result
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Store IPs
|
// Store IPs
|
||||||
var ips []string
|
var ips []string
|
||||||
|
|
15
v1/pkg/dns/verify.go
Normal file
15
v1/pkg/dns/verify.go
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package dns
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Verify subdomain
|
||||||
|
func Verify(subdomain string) bool {
|
||||||
|
_, err := http.Get(subdomain)
|
||||||
|
if err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
@ -12,12 +12,12 @@ type Options struct {
|
|||||||
UDP bool // Query using UDP
|
UDP bool // Query using UDP
|
||||||
IPv6 bool // Query for IPv6
|
IPv6 bool // Query for IPv6
|
||||||
Timeout int // Query timeout
|
Timeout int // Query timeout
|
||||||
|
Verify bool // Verify query
|
||||||
Threads int // Concurrent threads
|
Threads int // Concurrent threads
|
||||||
OnResult OnResultFunc // Result handler
|
OnResult OnResultFunc // Result handler
|
||||||
|
|
||||||
// Todo
|
// Todo
|
||||||
// ENT bool // Query for ENT
|
// ENT bool // Query for ENT
|
||||||
// Verify bool // Verify query
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Result handler function
|
// Result handler function
|
||||||
|
@ -64,6 +64,7 @@ func (r *Runner) Submit() {
|
|||||||
query := &dns.Query{
|
query := &dns.Query{
|
||||||
Client: r.client,
|
Client: r.client,
|
||||||
IPv6: r.options.IPv6,
|
IPv6: r.options.IPv6,
|
||||||
|
Verify: r.options.Verify,
|
||||||
Resolvers: r.options.Resolvers,
|
Resolvers: r.options.Resolvers,
|
||||||
Domain: domain,
|
Domain: domain,
|
||||||
Subdomain: word + "." + domain,
|
Subdomain: word + "." + domain,
|
||||||
|
Loading…
Reference in New Issue
Block a user