diff --git a/cmd/amass/enum.go b/cmd/amass/enum.go index b7d2d8ccc..fd73c1228 100644 --- a/cmd/amass/enum.go +++ b/cmd/amass/enum.go @@ -122,7 +122,7 @@ func defineEnumOptionFlags(enumFlags *flag.FlagSet, args *enumArgs) { enumFlags.BoolVar(&args.Options.Alterations, "alts", false, "Enable generation of altered names") enumFlags.BoolVar(&args.Options.NoColor, "nocolor", false, "Disable colorized output") enumFlags.BoolVar(&args.Options.NoRecursive, "norecursive", false, "Turn off recursive brute forcing") - enumFlags.BoolVar(&args.Options.Passive, "passive", false, "Disable DNS resolution of names and dependent features") + enumFlags.BoolVar(&args.Options.Passive, "passive", false, "Deprecated since passive is the default setting") enumFlags.BoolVar(&args.Options.Silent, "silent", false, "Disable all output during execution") enumFlags.BoolVar(&args.Options.Verbose, "v", false, "Output status / debug / troubleshooting info") } @@ -176,12 +176,6 @@ func runEnumCommand(clArgs []string) { os.Exit(1) } - if cfg.Passive { - fmt.Fprintf(color.Error, "%s\n", green("Passive mode does not generate output during the enumeration")) - fmt.Fprintf(color.Error, "\t%s\n", green("Obtain your list of FQDNs using the following command:")) - fmt.Fprintf(color.Error, "\t%s\n", green("amass db -names -d "+strings.Join(cfg.Domains(), ","))) - } - // Setup the new enumeration e := enum.NewEnumeration(cfg, sys, sys.GraphDatabases()[0]) if e == nil { @@ -362,7 +356,7 @@ func printOutput(e *enum.Enumeration, args *enumArgs, output chan string, wg *sy total++ } - if !e.Config.Passive && total == 0 { + if total == 0 { r.Println("No assets were discovered") } } @@ -623,12 +617,6 @@ func (e enumArgs) OverrideConfig(conf *config.Config) error { conf.Active = true conf.Passive = false } - if e.Options.Passive { - conf.Passive = true - conf.Active = false - conf.BruteForcing = false - conf.Alterations = false - } if e.Blacklist.Len() > 0 { conf.Scope.Blacklist = e.Blacklist.Slice() } diff --git a/cmd/amass/io.go b/cmd/amass/io.go index bf827a881..2364eeaaf 100644 --- a/cmd/amass/io.go +++ b/cmd/amass/io.go @@ -93,9 +93,6 @@ func extractAssetName(a *types.Asset) string { // ExtractOutput is a convenience method for obtaining new discoveries made by the enumeration process. func ExtractOutput(ctx context.Context, g *netmap.Graph, e *enum.Enumeration, filter *stringset.Set, asinfo bool) []*requests.Output { - if e.Config.Passive { - return EventNames(ctx, g, e.Config.Domains(), e.Config.CollectionStartTime, filter) - } return EventOutput(ctx, g, e.Config.Domains(), e.Config.CollectionStartTime, filter, asinfo, e.Sys.Cache()) } diff --git a/enum/enum.go b/enum/enum.go index 05f004dc3..268267aff 100644 --- a/enum/enum.go +++ b/enum/enum.go @@ -65,24 +65,20 @@ func (e *Enumeration) Start(ctx context.Context) error { defer cancel() go e.manageDataSrcRequests() - if !e.Config.Passive { - e.dnsTask = newDNSTask(e, false) - e.valTask = newDNSTask(e, true) - e.store = newDataManager(e) - e.subTask = newSubdomainTask(e) - defer e.subTask.Stop() - defer e.dnsTask.stop() - defer e.valTask.stop() - } + e.dnsTask = newDNSTask(e, false) + e.valTask = newDNSTask(e, true) + e.store = newDataManager(e) + e.subTask = newSubdomainTask(e) + defer e.subTask.Stop() + defer e.dnsTask.stop() + defer e.valTask.stop() var stages []pipeline.Stage - if !e.Config.Passive { - stages = append(stages, pipeline.FIFO("root", e.valTask.rootTaskFunc())) - stages = append(stages, pipeline.FIFO("dns", e.dnsTask)) - stages = append(stages, pipeline.FIFO("validate", e.valTask)) - stages = append(stages, pipeline.FIFO("store", e.store)) - stages = append(stages, pipeline.FIFO("", e.subTask)) - } + stages = append(stages, pipeline.FIFO("root", e.valTask.rootTaskFunc())) + stages = append(stages, pipeline.FIFO("dns", e.dnsTask)) + stages = append(stages, pipeline.FIFO("validate", e.valTask)) + stages = append(stages, pipeline.FIFO("store", e.store)) + stages = append(stages, pipeline.FIFO("", e.subTask)) p := pipeline.NewPipeline(stages...) // The pipeline input source will receive all the names @@ -99,14 +95,9 @@ func (e *Enumeration) Start(ctx context.Context) error { go e.submitKnownNames() go e.submitProvidedNames() - var err error - if e.Config.Passive { - err = p.Execute(e.ctx, e.nameSrc, e.makeOutputSink()) - } else { - err = p.ExecuteBuffered(e.ctx, e.nameSrc, e.makeOutputSink(), 50) - // Ensure all data has been stored - <-e.store.Stop() - } + err := p.ExecuteBuffered(e.ctx, e.nameSrc, e.makeOutputSink(), 50) + // Ensure all data has been stored + <-e.store.Stop() return err } @@ -219,16 +210,6 @@ func (e *Enumeration) fireRequest(srv service.Service, req interface{}, finished func (e *Enumeration) makeOutputSink() pipeline.SinkFunc { return pipeline.SinkFunc(func(ctx context.Context, data pipeline.Data) error { - if !e.Config.Passive { - return nil - } - - req, ok := data.(*requests.DNSRequest) - if ok && req != nil && req.Name != "" && e.Config.IsDomainInScope(req.Name) { - if _, err := e.graph.UpsertFQDN(e.ctx, req.Name); err != nil { - e.Config.Log.Print(err.Error()) - } - } return nil }) } diff --git a/enum/input.go b/enum/input.go index 4e2b060a0..c3c9f363a 100644 --- a/enum/input.go +++ b/enum/input.go @@ -135,7 +135,7 @@ func (r *enumSource) Next(ctx context.Context) bool { case <-t.C: count := r.pipeline.DataItemCount() if !r.enum.requestsPending() && count <= 0 { - if r.enum.Config.Passive || r.enum.store.queue.Len() == 0 { + if r.enum.store.queue.Len() == 0 { r.markDone() return false } diff --git a/systems/local.go b/systems/local.go index c84efd323..abe652811 100644 --- a/systems/local.go +++ b/systems/local.go @@ -48,11 +48,7 @@ func NewLocalSystem(cfg *config.Config) (*LocalSystem, error) { return nil, errors.New("the system was unable to build the pool of trusted resolvers") } - pool, num := trusted, num - if !cfg.Passive { - pool, num = untrustedResolvers(cfg) - } - + pool, num := untrustedResolvers(cfg) if pool == nil || num == 0 { return nil, errors.New("the system was unable to build the pool of untrusted resolvers") }