Added Exclusive Sources to subfinder
parent
4f475aeb5d
commit
88a350981f
|
@ -155,6 +155,57 @@ func (s *Source) enable(dataSources []string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Source) disable(dataSources []string) {
|
||||||
|
for _, source := range dataSources {
|
||||||
|
switch source {
|
||||||
|
case "ask":
|
||||||
|
s.Ask = false
|
||||||
|
case "baidu":
|
||||||
|
s.Baidu = false
|
||||||
|
case "bing":
|
||||||
|
s.Bing = false
|
||||||
|
case "censys":
|
||||||
|
s.Censys = false
|
||||||
|
case "certdb":
|
||||||
|
s.Certdb = false
|
||||||
|
case "certspotter":
|
||||||
|
s.Certspotter = false
|
||||||
|
case "crtsh":
|
||||||
|
s.Crtsh = false
|
||||||
|
case "dnsdb":
|
||||||
|
s.Dnsdb = false
|
||||||
|
case "dnsdumpster":
|
||||||
|
s.Dnsdumpster = false
|
||||||
|
case "findsubdomains":
|
||||||
|
s.Findsubdomains = false
|
||||||
|
case "hackertarget":
|
||||||
|
s.Hackertarget = false
|
||||||
|
case "netcraft":
|
||||||
|
s.Netcraft = false
|
||||||
|
case "passivetotal":
|
||||||
|
s.Passivetotal = false
|
||||||
|
case "ptrarchive":
|
||||||
|
s.Ptrarchive = false
|
||||||
|
case "riddler":
|
||||||
|
s.Riddler = false
|
||||||
|
case "securitytrails":
|
||||||
|
s.Securitytrails = false
|
||||||
|
case "threatcrowd":
|
||||||
|
s.Threatcrowd = false
|
||||||
|
case "threatminer":
|
||||||
|
s.Threatminer = false
|
||||||
|
case "virustotal":
|
||||||
|
s.Virustotal = false
|
||||||
|
case "waybackarchive":
|
||||||
|
s.Waybackarchive = false
|
||||||
|
case "certificatetransparency":
|
||||||
|
s.CertificateTransparency = false
|
||||||
|
case "ipv4info":
|
||||||
|
s.Ipv4Info = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Source) printSummary() {
|
func (s *Source) printSummary() {
|
||||||
if s.Ask {
|
if s.Ask {
|
||||||
fmt.Printf("\nRunning Source: %sAsk%s", helper.Info, helper.Reset)
|
fmt.Printf("\nRunning Source: %sAsk%s", helper.Info, helper.Reset)
|
||||||
|
@ -442,7 +493,6 @@ func Enumerate(state *helper.State) []string {
|
||||||
|
|
||||||
fmt.Printf("\n")
|
fmt.Printf("\n")
|
||||||
if state.Sources == "all" {
|
if state.Sources == "all" {
|
||||||
// Search all data sources
|
|
||||||
sourceConfig.enableAll()
|
sourceConfig.enableAll()
|
||||||
} else {
|
} else {
|
||||||
// Check data sources and create a source configuration structure
|
// Check data sources and create a source configuration structure
|
||||||
|
@ -450,6 +500,11 @@ func Enumerate(state *helper.State) []string {
|
||||||
sourceConfig.enable(dataSources)
|
sourceConfig.enable(dataSources)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if state.ExcludeSource != "" {
|
||||||
|
dataSources := strings.Split(state.ExcludeSource, ",")
|
||||||
|
sourceConfig.disable(dataSources)
|
||||||
|
}
|
||||||
|
|
||||||
if !state.Silent {
|
if !state.Silent {
|
||||||
sourceConfig.printSummary()
|
sourceConfig.printSummary()
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ type State struct {
|
||||||
ComResolver string // Comma-separated list of resolvers to use
|
ComResolver string // Comma-separated list of resolvers to use
|
||||||
ListResolver string // File to load resolvers from
|
ListResolver string // File to load resolvers from
|
||||||
AquatoneJSON bool // Use aquatone style json format
|
AquatoneJSON bool // Use aquatone style json format
|
||||||
|
ExcludeSource string // Sources to exclude
|
||||||
OutputHandle *os.File // Handle to the output file used for output buffering
|
OutputHandle *os.File // Handle to the output file used for output buffering
|
||||||
|
|
||||||
CurrentSettings Setting // Current application settings
|
CurrentSettings Setting // Current application settings
|
||||||
|
@ -65,6 +66,7 @@ type Setting struct {
|
||||||
AskPages string // Ask search pages to check
|
AskPages string // Ask search pages to check
|
||||||
BaiduPages string // Ask search pages to check
|
BaiduPages string // Ask search pages to check
|
||||||
BingPages string // Ask search pages to check
|
BingPages string // Ask search pages to check
|
||||||
|
DogpilePages string
|
||||||
}
|
}
|
||||||
|
|
||||||
func InitializeSettings() (setting *Setting) {
|
func InitializeSettings() (setting *Setting) {
|
||||||
|
@ -75,6 +77,7 @@ func InitializeSettings() (setting *Setting) {
|
||||||
settings.AskPages = "15"
|
settings.AskPages = "15"
|
||||||
settings.BaiduPages = "5"
|
settings.BaiduPages = "5"
|
||||||
settings.BingPages = "50"
|
settings.BingPages = "50"
|
||||||
|
settings.DogpilePages = "16"
|
||||||
return &settings
|
return &settings
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,5 +88,5 @@ func InitState() (state State, err error) {
|
||||||
|
|
||||||
setting := InitializeSettings()
|
setting := InitializeSettings()
|
||||||
|
|
||||||
return State{true, 10, 180, false, "", false, "", false, false, "", false, []string{}, true, "", false, []string{}, "", "", "", "", []string{}, "", "", false, nil, *setting, *config}, nil
|
return State{true, 10, 180, false, "", false, "", false, false, "", false, []string{}, true, "", false, []string{}, "", "", "", "", []string{}, "", "", false, "", nil, *setting, *config}, nil
|
||||||
}
|
}
|
||||||
|
|
1
main.go
1
main.go
|
@ -60,6 +60,7 @@ func ParseCmdLine() (state *helper.State, err error) {
|
||||||
flag.StringVar(&s.OutputDir, "oD", "", "Directory to output results to ")
|
flag.StringVar(&s.OutputDir, "oD", "", "Directory to output results to ")
|
||||||
flag.StringVar(&s.ComResolver, "r", "", "Comma-separated list of resolvers to use")
|
flag.StringVar(&s.ComResolver, "r", "", "Comma-separated list of resolvers to use")
|
||||||
flag.StringVar(&s.ListResolver, "rL", "", "Text file containing list of resolvers to use")
|
flag.StringVar(&s.ListResolver, "rL", "", "Text file containing list of resolvers to use")
|
||||||
|
flag.StringVar(&s.ExcludeSource, "exclude-sources", "", "List of sources to exclude from enumeration")
|
||||||
flag.BoolVar(&s.AquatoneJSON, "oT", false, "Use aquatone style json output format")
|
flag.BoolVar(&s.AquatoneJSON, "oT", false, "Use aquatone style json output format")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue