Added verifying support

This commit is contained in:
perp 2024-07-09 19:27:00 +01:00
parent e32dc646b1
commit b08e5c43c3
7 changed files with 29 additions and 2 deletions

View File

@ -8,9 +8,9 @@ Blink is a DNS bruteforcer made in Go
## Features
<!--
+ ENT (Empty non-terminal)
+ Verifying query
-->
+ UDP query
+ Verifying query
+ IPv4/IPv6 support
+ Wildcard detection

View File

@ -210,6 +210,7 @@ func init() {
rootCmd.Flags().BoolVarP(&opts.IPv6, "ipv6", "i", false, "Query for IPv6")
rootCmd.Flags().BoolVarP(&wildcard, "wildcard", "d", false, "Query for wildcard")
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().BoolVarP(&verbose, "verbose", "v", false, "Verbose logging")

View File

@ -11,6 +11,7 @@ import (
type Query struct {
Client *dns.Client // DNS client
IPv6 bool // IPv6 mode
Verify bool // Verify mode
Resolvers []string // Target resolvers
Domain string // Target domain
Subdomain string // Target subdomain

View File

@ -45,6 +45,15 @@ func (q *Query) Lookup() {
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
var ips []string

15
v1/pkg/dns/verify.go Normal file
View 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
}

View File

@ -12,12 +12,12 @@ type Options struct {
UDP bool // Query using UDP
IPv6 bool // Query for IPv6
Timeout int // Query timeout
Verify bool // Verify query
Threads int // Concurrent threads
OnResult OnResultFunc // Result handler
// Todo
// ENT bool // Query for ENT
// Verify bool // Verify query
}
// Result handler function

View File

@ -64,6 +64,7 @@ func (r *Runner) Submit() {
query := &dns.Query{
Client: r.client,
IPv6: r.options.IPv6,
Verify: r.options.Verify,
Resolvers: r.options.Resolvers,
Domain: domain,
Subdomain: word + "." + domain,