Implement OnValidateTarget callback for target validation hooking#533
Implement OnValidateTarget callback for target validation hooking#533Mzack9999 merged 5 commits intoprojectdiscovery:mainfrom
Conversation
Neo - PR Security ReviewNo security issues found Highlights
Hardening Notes
Comment |
|
While investigating this PR, we found that The existing We've implemented this with a |
Absolutely the preferable solution. I tried switching the
Are you intending to release this as a tagged version, and if so, do you have a rough estimate on when it might be tagged? |
Adds a callback function at
OnValidateTarget, letting users register afunc(hostname, IP, port string) errorto be run before dialing. Errors returned behave as invalid targets (still triggering that callback).Main purpose is being able to limit the port in the dialer. I guess that ties into #226. I would have preferred using the already implemented networkpolicy for that, but since only the IP is validated that way (and changing it to ValidateAddressWithPort would be a breaking change I imagine based on test cases) I figured a validation callback was a reasonable path forwards.