Add Web Cache Deception script for Targeted#498
Conversation
|
Great job! No new security vulnerabilities introduced in this pull requestUse @Checkmarx to interact with Checkmarx PR Assistant. |
|
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.
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.
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.
When are you finding that it isn't set "properly"??

These files add to this changes: