1 Star 0 Fork 0

MATWRK / subfinder

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
initialize.go 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
Ice3man543 提交于 2019-12-05 16:11 . Changed URLs to point to new repo
package runner
import (
"strings"
"github.com/projectdiscovery/subfinder/pkg/passive"
"github.com/projectdiscovery/subfinder/pkg/resolve"
)
// initializePassiveEngine creates the passive engine and loads sources etc
func (r *Runner) initializePassiveEngine() {
var sources, exclusions []string
// If there are any sources from CLI, only use them
// Otherwise, use the yaml file sources
if r.options.Sources != "" {
sources = append(sources, strings.Split(r.options.Sources, ",")...)
} else {
sources = append(sources, r.options.YAMLConfig.Sources...)
}
if r.options.ExcludeSources != "" {
exclusions = append(exclusions, strings.Split(r.options.ExcludeSources, ",")...)
} else {
exclusions = append(exclusions, r.options.YAMLConfig.ExcludeSources...)
}
r.passiveAgent = passive.New(sources, exclusions)
}
// initializeActiveEngine creates the resolver used to resolve the found subdomains
func (r *Runner) initializeActiveEngine() error {
r.resolverClient = resolve.New()
// If the file has been provided, read resolvers from the file
if r.options.ResolverList != "" {
err := r.resolverClient.AppendResolversFromFile(r.options.ResolverList)
if err != nil {
return err
}
}
var resolvers []string
if r.options.Resolvers != "" {
resolvers = append(resolvers, strings.Split(r.options.Resolvers, ",")...)
} else {
resolvers = append(resolvers, r.options.YAMLConfig.Resolvers...)
}
r.resolverClient.AppendResolversFromSlice(resolvers)
return nil
}
1
https://gitee.com/mrturn_1/subfinder.git
git@gitee.com:mrturn_1/subfinder.git
mrturn_1
subfinder
subfinder
v2.3.2

搜索帮助