Added Exclusive Sources to subfinder

master
Ice3man543 2018-06-16 19:09:28 +05:30
parent 4f475aeb5d
commit 88a350981f
3 changed files with 90 additions and 31 deletions

View File

@ -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() {
if s.Ask {
fmt.Printf("\nRunning Source: %sAsk%s", helper.Info, helper.Reset)
@ -442,7 +493,6 @@ func Enumerate(state *helper.State) []string {
fmt.Printf("\n")
if state.Sources == "all" {
// Search all data sources
sourceConfig.enableAll()
} else {
// Check data sources and create a source configuration structure
@ -450,6 +500,11 @@ func Enumerate(state *helper.State) []string {
sourceConfig.enable(dataSources)
}
if state.ExcludeSource != "" {
dataSources := strings.Split(state.ExcludeSource, ",")
sourceConfig.disable(dataSources)
}
if !state.Silent {
sourceConfig.printSummary()
}

View File

@ -39,6 +39,7 @@ type State struct {
ComResolver string // Comma-separated list of resolvers to use
ListResolver string // File to load resolvers from
AquatoneJSON bool // Use aquatone style json format
ExcludeSource string // Sources to exclude
OutputHandle *os.File // Handle to the output file used for output buffering
CurrentSettings Setting // Current application settings
@ -65,6 +66,7 @@ type Setting struct {
AskPages string // Ask search pages to check
BaiduPages string // Ask search pages to check
BingPages string // Ask search pages to check
DogpilePages string
}
func InitializeSettings() (setting *Setting) {
@ -75,6 +77,7 @@ func InitializeSettings() (setting *Setting) {
settings.AskPages = "15"
settings.BaiduPages = "5"
settings.BingPages = "50"
settings.DogpilePages = "16"
return &settings
}
@ -85,5 +88,5 @@ func InitState() (state State, err error) {
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
}

View File

@ -60,6 +60,7 @@ func ParseCmdLine() (state *helper.State, err error) {
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.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.Parse()