mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 22:15:27 +00:00
feat: add SystemResolvers / InternalResolversList options to NetworkConfig (#4719)
This commit is contained in:
parent
ee68de6ea8
commit
340c953138
@ -5,6 +5,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/projectdiscovery/gologger"
|
"github.com/projectdiscovery/gologger"
|
||||||
|
"github.com/projectdiscovery/ratelimit"
|
||||||
|
|
||||||
"github.com/projectdiscovery/nuclei/v3/pkg/model/types/severity"
|
"github.com/projectdiscovery/nuclei/v3/pkg/model/types/severity"
|
||||||
"github.com/projectdiscovery/nuclei/v3/pkg/output"
|
"github.com/projectdiscovery/nuclei/v3/pkg/output"
|
||||||
"github.com/projectdiscovery/nuclei/v3/pkg/progress"
|
"github.com/projectdiscovery/nuclei/v3/pkg/progress"
|
||||||
@ -13,7 +15,6 @@ import (
|
|||||||
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/utils/vardump"
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/utils/vardump"
|
||||||
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/headless/engine"
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/headless/engine"
|
||||||
"github.com/projectdiscovery/nuclei/v3/pkg/templates/types"
|
"github.com/projectdiscovery/nuclei/v3/pkg/templates/types"
|
||||||
"github.com/projectdiscovery/ratelimit"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// TemplateSources contains template sources
|
// TemplateSources contains template sources
|
||||||
@ -220,14 +221,16 @@ func WithVerbosity(opts VerbosityOptions) NucleiSDKOptions {
|
|||||||
// NetworkConfig contains network config options
|
// NetworkConfig contains network config options
|
||||||
// ex: retries , httpx probe , timeout etc
|
// ex: retries , httpx probe , timeout etc
|
||||||
type NetworkConfig struct {
|
type NetworkConfig struct {
|
||||||
Timeout int // Timeout in seconds
|
|
||||||
Retries int // Number of retries
|
|
||||||
LeaveDefaultPorts bool // Leave default ports for http/https
|
|
||||||
MaxHostError int // Maximum number of host errors to allow before skipping that host
|
|
||||||
TrackError []string // Adds given errors to max host error watchlist
|
|
||||||
DisableMaxHostErr bool // Disable max host error optimization (Hosts are not skipped even if they are not responding)
|
DisableMaxHostErr bool // Disable max host error optimization (Hosts are not skipped even if they are not responding)
|
||||||
Interface string // Interface to use for network scan
|
Interface string // Interface to use for network scan
|
||||||
|
InternalResolversList []string // Use a list of resolver
|
||||||
|
LeaveDefaultPorts bool // Leave default ports for http/https
|
||||||
|
MaxHostError int // Maximum number of host errors to allow before skipping that host
|
||||||
|
Retries int // Number of retries
|
||||||
SourceIP string // SourceIP sets custom source IP address for network requests
|
SourceIP string // SourceIP sets custom source IP address for network requests
|
||||||
|
SystemResolvers bool // Use system resolvers
|
||||||
|
Timeout int // Timeout in seconds
|
||||||
|
TrackError []string // Adds given errors to max host error watchlist
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithNetworkConfig allows setting network config options
|
// WithNetworkConfig allows setting network config options
|
||||||
@ -242,6 +245,8 @@ func WithNetworkConfig(opts NetworkConfig) NucleiSDKOptions {
|
|||||||
e.hostErrCache = hosterrorscache.New(opts.MaxHostError, hosterrorscache.DefaultMaxHostsCount, opts.TrackError)
|
e.hostErrCache = hosterrorscache.New(opts.MaxHostError, hosterrorscache.DefaultMaxHostsCount, opts.TrackError)
|
||||||
e.opts.Interface = opts.Interface
|
e.opts.Interface = opts.Interface
|
||||||
e.opts.SourceIP = opts.SourceIP
|
e.opts.SourceIP = opts.SourceIP
|
||||||
|
e.opts.SystemResolvers = opts.SystemResolvers
|
||||||
|
e.opts.InternalResolversList = opts.InternalResolversList
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user