Updated some things
commit
23dc782c54
|
@ -21,6 +21,7 @@ import (
|
||||||
"github.com/Ice3man543/subfinder/libsubfinder/sources/certdb"
|
"github.com/Ice3man543/subfinder/libsubfinder/sources/certdb"
|
||||||
"github.com/Ice3man543/subfinder/libsubfinder/sources/certspotter"
|
"github.com/Ice3man543/subfinder/libsubfinder/sources/certspotter"
|
||||||
"github.com/Ice3man543/subfinder/libsubfinder/sources/crtsh"
|
"github.com/Ice3man543/subfinder/libsubfinder/sources/crtsh"
|
||||||
|
"github.com/Ice3man543/subfinder/libsubfinder/sources/dnsdb"
|
||||||
"github.com/Ice3man543/subfinder/libsubfinder/sources/dnsdumpster"
|
"github.com/Ice3man543/subfinder/libsubfinder/sources/dnsdumpster"
|
||||||
"github.com/Ice3man543/subfinder/libsubfinder/sources/findsubdomains"
|
"github.com/Ice3man543/subfinder/libsubfinder/sources/findsubdomains"
|
||||||
"github.com/Ice3man543/subfinder/libsubfinder/sources/hackertarget"
|
"github.com/Ice3man543/subfinder/libsubfinder/sources/hackertarget"
|
||||||
|
@ -54,6 +55,7 @@ type Source struct {
|
||||||
Waybackarchive bool
|
Waybackarchive bool
|
||||||
Threatminer bool
|
Threatminer bool
|
||||||
Riddler bool
|
Riddler bool
|
||||||
|
Dnsdb bool
|
||||||
|
|
||||||
NoOfSources int
|
NoOfSources int
|
||||||
}
|
}
|
||||||
|
@ -81,10 +83,12 @@ func PassiveDiscovery(state *helper.State) (finalPassiveSubdomains []string) {
|
||||||
fmt.Printf("\n[-] Searching For Subdomains in WaybackArchive")
|
fmt.Printf("\n[-] Searching For Subdomains in WaybackArchive")
|
||||||
fmt.Printf("\n[-] Searching For Subdomains in ThreatMiner")
|
fmt.Printf("\n[-] Searching For Subdomains in ThreatMiner")
|
||||||
fmt.Printf("\n[-] Searching For Subdomains in Riddler")
|
fmt.Printf("\n[-] Searching For Subdomains in Riddler")
|
||||||
fmt.Printf("\n[-] Searching For Subdomains in Netcraft\n")
|
fmt.Printf("\n[-] Searching For Subdomains in Netcraft")
|
||||||
|
fmt.Printf("\n[-] Searching For Subdomains in Dnsdb\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceConfig = Source{true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, 15}
|
|
||||||
|
sourceConfig = Source{true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, 16}
|
||||||
} else {
|
} else {
|
||||||
// Check data sources and create a source configuration structure
|
// Check data sources and create a source configuration structure
|
||||||
|
|
||||||
|
@ -186,6 +190,12 @@ func PassiveDiscovery(state *helper.State) (finalPassiveSubdomains []string) {
|
||||||
}
|
}
|
||||||
sourceConfig.Censys = true
|
sourceConfig.Censys = true
|
||||||
sourceConfig.NoOfSources = sourceConfig.NoOfSources + 1
|
sourceConfig.NoOfSources = sourceConfig.NoOfSources + 1
|
||||||
|
} else if source == "dnsdb" {
|
||||||
|
if state.Silent != true {
|
||||||
|
fmt.Printf("\n[-] Searching For Subdomains in Dnsdb")
|
||||||
|
}
|
||||||
|
sourceConfig.Dnsdb = true
|
||||||
|
sourceConfig.NoOfSources = sourceConfig.NoOfSources +1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -242,6 +252,8 @@ func PassiveDiscovery(state *helper.State) (finalPassiveSubdomains []string) {
|
||||||
}
|
}
|
||||||
if sourceConfig.Censys == true {
|
if sourceConfig.Censys == true {
|
||||||
go censys.Query(state, ch)
|
go censys.Query(state, ch)
|
||||||
|
if sourceConfig.Dnsdb == true {
|
||||||
|
go dnsdb.Query(state, ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recieve data from all goroutines running
|
// Recieve data from all goroutines running
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
//
|
||||||
|
// Written By : @mehimansu (Himanshu Das)
|
||||||
|
//
|
||||||
|
// Distributed Under MIT License
|
||||||
|
// Copyrights (C) 2018 Ice3man
|
||||||
|
//
|
||||||
|
|
||||||
|
// Golang driver from dnsdb.org
|
||||||
|
package dnsdb
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io/ioutil"
|
||||||
|
"regexp"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/Ice3man543/subfinder/libsubfinder/helper"
|
||||||
|
)
|
||||||
|
|
||||||
|
// all subdomains found
|
||||||
|
var subdomains []string
|
||||||
|
|
||||||
|
// Query function returns all subdomains found using the service.
|
||||||
|
func Query(state *helper.State, ch chan helper.Result) {
|
||||||
|
var result helper.Result
|
||||||
|
result.Subdomains = subdomains
|
||||||
|
|
||||||
|
// Make a http request to DnsDB
|
||||||
|
resp, err := helper.GetHTTPResponse("http://www.dnsdb.org/f/"+state.Domain+".dnsdb.org/", state.Timeout)
|
||||||
|
if err != nil {
|
||||||
|
result.Error = err
|
||||||
|
ch <- result
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Get the response body
|
||||||
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
result.Error = err
|
||||||
|
ch <- result
|
||||||
|
return
|
||||||
|
}
|
||||||
|
src := string(body)
|
||||||
|
re := regexp.MustCompile("<a[^>]*?[^>]*>(.*?)</a>")
|
||||||
|
match := re.FindAllStringSubmatch(src, -1)
|
||||||
|
|
||||||
|
for _, subdomain := range match {
|
||||||
|
string_split := strings.Split(subdomain[0], "\">")[1]
|
||||||
|
finishedSub := strings.TrimRight(string_split, "</a>")
|
||||||
|
|
||||||
|
if state.Verbose == true {
|
||||||
|
if state.Color == true {
|
||||||
|
fmt.Printf("\n[%sDNSDB%s] %s", helper.Red, helper.Reset, finishedSub)
|
||||||
|
} else {
|
||||||
|
fmt.Printf("\n[DNSDB] %s", finishedSub)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subdomains = append(subdomains, finishedSub)
|
||||||
|
}
|
||||||
|
result.Subdomains = subdomains
|
||||||
|
result.Error = nil
|
||||||
|
ch <- result
|
||||||
|
}
|
Loading…
Reference in New Issue