这是indexloc提供的服务,不要输入任何密码
Skip to content

provider config not used/loaded in library mode #854

@nth347

Description

@nth347

Subfinder version: 2.5.8

Current Behavior:

When running the command subfinder -d target.com, I obtain 367 subdomains for target.com within a duration of 16 seconds and 164 milliseconds. However, when I utilize subfinder as a library, I receive only 120 subdomains for target.com, taking 19 seconds and 610 milliseconds.

Both approaches use the same provider-config.yaml file. Here is the code I executed:

func main() {
	runnerInstance, err := runner.NewRunner(&runner.Options{
		Threads:            10,                       // Thread controls the number of threads to use for active enumerations
		Timeout:            30,                       // Timeout is the seconds to wait for sources to respond
		MaxEnumerationTime: 10,                       // MaxEnumerationTime is the maximum amount of time in mins to wait for enumeration
		Resolvers:          resolve.DefaultResolvers, // Use the default list of resolvers by marshaling it to the config
		ResultCallback: func(s *resolve.HostEntry) { // Callback function to execute for available host
			log.Println(s.Host, s.Source)
		},
		ProviderConfig: "provider-config.yaml",
	})

	buf := bytes.Buffer{}
	err = runnerInstance.EnumerateSingleDomain("target.com", []io.Writer{&buf})
	if err != nil {
		log.Fatal(err)
	}

	data, err := io.ReadAll(&buf)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("%s", data)
}

Expected Behavior:

I expected both cases to have the same result. Do you know what is wrong here?

Metadata

Metadata

Assignees

Labels

Status: CompletedNothing further to be done with this issue. Awaiting to be closed.Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions