Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing internal resolver override #5035

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/protocols/common/protocolstate/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func Init(options *types.Options) error {
opts.ResolversFile = true
opts.EnableFallback = true
}
if options.ResolversFile != "" {
if len(options.InternalResolversList) > 0 {
opts.BaseResolvers = options.InternalResolversList
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/protocols/dns/dnsclientpool/clientpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func Init(options *types.Options) error {
clientPool = make(map[string]*retryabledns.Client)

resolvers := defaultResolvers
if options.ResolversFile != "" {
if len(options.InternalResolversList) > 0 {
resolvers = options.InternalResolversList
}
var err error
Expand Down Expand Up @@ -78,7 +78,7 @@ func Get(options *types.Options, configuration *Configuration) (*retryabledns.Cl
poolMutex.RUnlock()

resolvers := defaultResolvers
if options.ResolversFile != "" {
if len(options.InternalResolversList) > 0 {
resolvers = options.InternalResolversList
} else if len(configuration.Resolvers) > 0 {
resolvers = configuration.Resolvers
Expand Down
4 changes: 2 additions & 2 deletions pkg/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ type Options struct {
IncludeIds goflags.StringSlice
// ExcludeIds contains templates ids to not be executed
ExcludeIds goflags.StringSlice

InternalResolversList []string // normalized from resolvers flag as well as file provided.
// InternalResolversList is the list of internal resolvers to use
InternalResolversList []string
// ProjectPath allows nuclei to use a user defined project folder
ProjectPath string
// InteractshURL is the URL for the interactsh server.
Expand Down
Loading