diff --git a/cmd/subfinder/main.go b/cmd/subfinder/main.go index cf48178..a86ba52 100644 --- a/cmd/subfinder/main.go +++ b/cmd/subfinder/main.go @@ -3,11 +3,18 @@ package main import ( "context" + "github.com/projectdiscovery/fdmax" "github.com/projectdiscovery/gologger" "github.com/projectdiscovery/subfinder/pkg/runner" ) func main() { + // Increase the OS file descriptors + err := fdmax.Set(fdmax.UnixMax) + if err != nil { + gologger.Fatalf("Could not set the max file descriptors for the current process: %s\n", err) + } + // Parse the command line flags and read config files options := runner.ParseOptions() diff --git a/pkg/runner/options.go b/pkg/runner/options.go index b87cf5d..8b1e803 100644 --- a/pkg/runner/options.go +++ b/pkg/runner/options.go @@ -23,7 +23,6 @@ type Options struct { RemoveWildcard bool // RemoveWildcard specifies whether to remove potential wildcard or dead subdomains from the results. Stdin bool // Stdin specifies whether stdin input was given to the process Version bool // Version specifies if we should just show version and exit - FdMax bool // FdMax automatically increases the maximum number of file descriptors Recursive bool // Recursive specifies whether to use only recursive subdomain enumeration sources All bool // All specifies whether to use all (slow) sources. Threads int // Thread controls the number of threads to use for active enumerations @@ -76,7 +75,6 @@ func ParseOptions() *Options { flag.BoolVar(&options.RemoveWildcard, "nW", false, "Remove Wildcard & Dead Subdomains from output") flag.StringVar(&options.ConfigFile, "config", path.Join(config, "config.yaml"), "Configuration file for API Keys, etc") flag.BoolVar(&options.Version, "version", false, "Show version of subfinder") - flag.BoolVar(&options.FdMax, "fdmax", false, "Automatically increases the maximum number of file descriptors") flag.Parse() // Check if stdin pipe was given diff --git a/pkg/runner/runner.go b/pkg/runner/runner.go index f81d47c..c1ac941 100644 --- a/pkg/runner/runner.go +++ b/pkg/runner/runner.go @@ -7,7 +7,6 @@ import ( "os" "path" - "github.com/projectdiscovery/fdmax" "github.com/projectdiscovery/subfinder/pkg/passive" "github.com/projectdiscovery/subfinder/pkg/resolve" ) @@ -40,13 +39,6 @@ func NewRunner(options *Options) (*Runner, error) { // RunEnumeration runs the subdomain enumeration flow on the targets specified func (r *Runner) RunEnumeration(ctx context.Context) error { - // Increase the OS file descriptors - if r.options.FdMax { - err := fdmax.Set(fdmax.UnixMax) - if err != nil { - return err - } - } // Check if only a single domain is sent as input. Process the domain now. if r.options.Domain != "" {