Updated passive.go

master
ice3man 2018-04-26 17:39:43 +05:30
parent cd43240dde
commit 3b96ca56cd
1 changed files with 14 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import (
"github.com/Ice3man543/subfinder/libsubfinder/helper" "github.com/Ice3man543/subfinder/libsubfinder/helper"
// Load different Passive data sources // Load different Passive data sources
"github.com/Ice3man543/subfinder/libsubfinder/sources/censys"
"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"
@ -37,6 +38,7 @@ import (
// Sources configuration structure specifying what should we use // Sources configuration structure specifying what should we use
// to do passive subdomain discovery. // to do passive subdomain discovery.
type Source struct { type Source struct {
Censys bool
Certdb bool Certdb bool
Crtsh bool Crtsh bool
Certspotter bool Certspotter bool
@ -57,13 +59,14 @@ type Source struct {
} }
func PassiveDiscovery(state *helper.State) (finalPassiveSubdomains []string) { func PassiveDiscovery(state *helper.State) (finalPassiveSubdomains []string) {
sourceConfig := Source{false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, 0} sourceConfig := Source{false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, 0}
fmt.Printf("\n") fmt.Printf("\n")
if state.Sources == "all" { if state.Sources == "all" {
// Search all data sources // Search all data sources
if state.Silent != true { if state.Silent != true {
fmt.Printf("\n[-] Searching For Subdomains in Censys")
fmt.Printf("\n[-] Searching For Subdomains in Crt.sh") fmt.Printf("\n[-] Searching For Subdomains in Crt.sh")
fmt.Printf("\n[-] Searching For Subdomains in CertDB") fmt.Printf("\n[-] Searching For Subdomains in CertDB")
fmt.Printf("\n[-] Searching For Subdomains in Certspotter") fmt.Printf("\n[-] Searching For Subdomains in Certspotter")
@ -81,7 +84,7 @@ func PassiveDiscovery(state *helper.State) (finalPassiveSubdomains []string) {
fmt.Printf("\n[-] Searching For Subdomains in Netcraft\n") fmt.Printf("\n[-] Searching For Subdomains in Netcraft\n")
} }
sourceConfig = Source{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, 15}
} else { } else {
// Check data sources and create a source configuration structure // Check data sources and create a source configuration structure
@ -177,6 +180,12 @@ func PassiveDiscovery(state *helper.State) (finalPassiveSubdomains []string) {
} }
sourceConfig.Riddler = true sourceConfig.Riddler = true
sourceConfig.NoOfSources = sourceConfig.NoOfSources + 1 sourceConfig.NoOfSources = sourceConfig.NoOfSources + 1
} else if source == "censys" {
if state.Silent != true {
fmt.Printf("\n[-] Searching For Subdomains in Censys")
}
sourceConfig.Censys = true
sourceConfig.NoOfSources = sourceConfig.NoOfSources + 1
} }
} }
} }
@ -231,6 +240,9 @@ func PassiveDiscovery(state *helper.State) (finalPassiveSubdomains []string) {
if sourceConfig.Riddler == true { if sourceConfig.Riddler == true {
go riddler.Query(state, ch) go riddler.Query(state, ch)
} }
if sourceConfig.Censys == true {
go censys.Query(state, ch)
}
// Recieve data from all goroutines running // Recieve data from all goroutines running
for i := 0; i < sourceConfig.NoOfSources; i++ { for i := 0; i < sourceConfig.NoOfSources; i++ {