-
-
Notifications
You must be signed in to change notification settings - Fork 253
Add Web Cache Deception script for Targeted #498
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: main
Are you sure you want to change the base?
Conversation
|
Great job! No new security vulnerabilities introduced in this pull requestUse @Checkmarx to reach out to us for assistance. Just send a PR comment with Examples: |
|
To address the DCO requirement you'll need to sign-off the commit(s): |
072e849 to
f9ac05a
Compare
|
Hi again i add the sign-off the commit. |
kingthorin
left a comment
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.
I haven't been able to test it. I don't see anything obviously wrong. Have you tested that the host header is set as you expect?
|
You should also add an entry in the changelog as part of the unreleased/added section |
|
The filename should also follow the guidelines: https://github.com/zaproxy/community-scripts/blob/main/CONTRIBUTING.md#naming-scripts |
Signed-off-by: eiliya keshtkar <[email protected]>
Signed-off-by: eiliya keshtkar <[email protected]>
Signed-off-by: eiliya keshtkar <[email protected]>
Signed-off-by: eiliya keshtkar <[email protected]>
Signed-off-by: eiliya keshtkar <[email protected]>
Signed-off-by: eiliya keshtkar <[email protected]>
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.
Any time it sends I'd suggest a try/catch. In the catch it should probably just bail with a message that an error occurred and quote the exception.getMessage(). Instead of just barfing over and over and over:
Ex:
------------------------------------------------------------
Target: https://scanme.nmap.org/
------------------------------------------------------------
[+] Starting Web Cache Deception tests...
[i] Base: https://scanme.nmap.org/
[!] Error sending to: https://scanme.nmap.org/;cachetest => java.net.NoRouteToHostException: No route to host
[!] Error sending to: https://scanme.nmap.org/%00cachetest => java.net.NoRouteToHostException: No route to host
[!] Error sending to: https://scanme.nmap.org/%0Acachetest => java.net.NoRouteToHostException: No route to host
[!] Error sending to: https://scanme.nmap.org/%09cachetest => java.net.NoRouteToHostException: No route to host
[!] Error sending to: https://scanme.nmap.org/.cachetest => java.net.NoRouteToHostException: No route to host
[!] Error sending to: https://scanme.nmap.org//cachetest => java.net.NoRouteToHostException: No route to host
[!] Error sending to: https://scanme.nmap.org/~cachetest => java.net.NoRouteToHostException: No route to hostActually I guess it's when your sending method returns null, it may as well bail from whatever loop it's in.
| // Set Host header properly | ||
| var host = uri.getHost(); | ||
| var port = uri.getPort(); | ||
| msg.getRequestHeader().setHeader("Host", port > 0 && port !== 80 && port !== 443 ? host + ":" + port : host); |
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.
When are you finding that it isn't set "properly"??

These files add to this changes: