-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Use proxy for dns and ssl templates #6255
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
base: dev
Are you sure you want to change the base?
Changes from all commits
2469d46
8eccc46
a7c54e8
7214fa1
40f3db5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import ( | |
"encoding/base64" | ||
"sync/atomic" | ||
|
||
"github.com/projectdiscovery/fastdialer/fastdialer" | ||
"github.com/projectdiscovery/ratelimit" | ||
mapsutil "github.com/projectdiscovery/utils/maps" | ||
stringsutil "github.com/projectdiscovery/utils/strings" | ||
|
@@ -132,6 +133,8 @@ type ExecutorOptions struct { | |
ExportReqURLPattern bool | ||
// GlobalMatchers is the storage for global matchers with http passive templates | ||
GlobalMatchers *globalmatchers.Storage | ||
// OverrideFastdialer is a fastdialer dialer instance | ||
OverrideFastdialer *fastdialer.Dialer | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this for lib usage only? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think |
||
} | ||
|
||
// todo: centralizing components is not feasible with current clogged architecture | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Pass the override dialer alongside the proxy for full template-level control
Other protocol implementations in this PR (network, ssl, websocket) forward
options.OverrideFastdialer
so that a template can completely replace the default fast-dialer.DNS now only forwards the SOCKS proxy string which leaves the dialer override path unused for DNS templates and breaks the symmetry promised in the PR description.
Please verify that
dnsclientpool.Configuration
already exposes aCustomDialer
(or similar) field; if not, extend it as was done fornetworkclientpool
.Failing to forward the dialer means DNS templates still funnel through the global fast-dialer even when the user explicitly asked for an override.
🏁 Script executed:
Length of output: 1021
Extend DNS client configuration to support dialer overrides
To restore symmetry with other protocol pools, add a
CustomDialer
field to the DNS client configuration and forward the override indns.go
:• In
pkg/protocols/dns/dnsclientpool/clientpool.go
, modify theConfiguration
struct:type Configuration struct { Retries int Proxy string + CustomDialer *fastdialer.Dialer }
(Remember to import the
fastdialer
package.)• In
pkg/protocols/dns/dns.go
, update the options passed into the pool:dnsClientOptions := &dnsclientpool.Configuration{ Retries: request.Retries, Proxy: options.Options.AliveSocksProxy, + CustomDialer: options.OverrideFastdialer, }
This ensures DNS templates can fully override the default fast-dialer just like network, SSL, and WebSocket.
📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, are you recommending that I include it even though it isn’t required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.