-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
paramdigger: Add patches for header guesser errors #4561
paramdigger: Add patches for header guesser errors #4561
Conversation
Needs cleanup. Comments and System.out 😉 |
The changelog should be updated. |
addOns/paramdigger/src/test/java/org/zaproxy/addon/paramdigger/HeaderGuessUnitTest.java
Outdated
Show resolved
Hide resolved
I would actually keep it... Just so that I can comeback and review the
logic :)
Its in tests tho... Shouldn't really affect but :)...
…On Wed, Apr 26, 2023, 2:49 AM Rick M ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
addOns/paramdigger/src/test/java/org/zaproxy/addon/paramdigger/HeaderGuessUnitTest.java
<#4561 (comment)>
:
> @@ -236,7 +244,7 @@ protected Response serve(IHTTPSession session) {
response.addHeader(header, value);
response.addHeader(
"host",
- ((poisoning.get("host")) != null) // && value == "hit"
+ ((poisoning.get("host")) != null) // && value == "hit")
Remove the commented bit?
—
Reply to this email directly, view it on GitHub
<#4561 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN6F3GLXTNW4EJCQI3V5FZ3XDA5UTANCNFSM6AAAAAAXIXYJXQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
*would actually like
On Wed, Apr 26, 2023, 3:03 AM Arkaprabha Chakraborty <
***@***.***> wrote:
… I would actually keep it... Just so that I can comeback and review the
logic :)
Its in tests tho... Shouldn't really affect but :)...
On Wed, Apr 26, 2023, 2:49 AM Rick M ***@***.***> wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In
> addOns/paramdigger/src/test/java/org/zaproxy/addon/paramdigger/HeaderGuessUnitTest.java
> <#4561 (comment)>
> :
>
> > @@ -236,7 +244,7 @@ protected Response serve(IHTTPSession session) {
> response.addHeader(header, value);
> response.addHeader(
> "host",
> - ((poisoning.get("host")) != null) // && value == "hit"
> + ((poisoning.get("host")) != null) // && value == "hit")
>
> Remove the commented bit?
>
> —
> Reply to this email directly, view it on GitHub
> <#4561 (review)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AN6F3GLXTNW4EJCQI3V5FZ3XDA5UTANCNFSM6AAAAAAXIXYJXQ>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Add TODO comments or tasks in the issue instead. |
addOns/paramdigger/src/main/java/org/zaproxy/addon/paramdigger/CacheController.java
Outdated
Show resolved
Hide resolved
addOns/paramdigger/src/main/java/org/zaproxy/addon/paramdigger/HeaderGuesser.java
Outdated
Show resolved
Hide resolved
addOns/paramdigger/src/main/java/org/zaproxy/addon/paramdigger/HeaderGuesser.java
Outdated
Show resolved
Hide resolved
addOns/paramdigger/src/main/java/org/zaproxy/addon/paramdigger/HeaderGuesser.java
Outdated
Show resolved
Hide resolved
addOns/paramdigger/src/main/java/org/zaproxy/addon/paramdigger/HeaderGuesser.java
Outdated
Show resolved
Hide resolved
addOns/paramdigger/src/main/java/org/zaproxy/addon/paramdigger/HeaderGuesser.java
Outdated
Show resolved
Hide resolved
088054b
to
d17172b
Compare
addOns/paramdigger/src/test/java/org/zaproxy/addon/paramdigger/HeaderGuessUnitTest.java
Outdated
Show resolved
Hide resolved
uhh yeah about that :)
…On Mon, May 1, 2023, 7:49 PM Rick M ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
addOns/paramdigger/src/test/java/org/zaproxy/addon/paramdigger/HeaderGuessUnitTest.java
<#4561 (comment)>
:
> + // String retVal = session.getHeaders().get("host");
+ // if (retVal.contains(":31337")) {
+ poisoning.put("host", session.getHeaders().get("host"));
+ // }
😉
—
Reply to this email directly, view it on GitHub
<#4561 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN6F3GKNQQ5BGSBNJTWLJTLXD7BA5ANCNFSM6AAAAAAXIXYJXQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
d17172b
to
683f98a
Compare
Signed-off-by: ArkaprabhaChakraborty <chakrabortyarkaprabha998@gmail.com>
683f98a
to
a13ad2d
Compare
That should be it! :) |
ping @thc202 |
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.
LGTM
switch (method) { | ||
case GET: | ||
headers.setMethod(HttpRequestHeader.GET); | ||
break; | ||
case POST: | ||
headers.setMethod(HttpRequestHeader.POST); | ||
break; | ||
default: | ||
throw new IllegalArgumentException( | ||
"Method " + method + " not supported."); | ||
} |
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.
Does not need to be in this PR, letting the enum update the request header would reduce duplication and simplify the code.
|| !this.checkCacheHit(indicValue, cache)); | ||
if (indicValue == null || indicValue.isEmpty()) { | ||
return true; | ||
} else { |
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.
These else
statements could be removed.
@@ -74,6 +74,7 @@ public class HeaderGuesser implements Runnable { | |||
private static final String POISON_DEFINITION = "paramdigger.results.poison.definition"; | |||
private static final String POISON_DEFINITION_FIRST = | |||
"paramdigger.results.poison.definition.first"; | |||
private static List<Integer> ERROR_CODES = List.of(400, 413, 418, 429, 503); |
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.
final
too.
regarding these else statements..... I thought of adding an
error/debug/output panel which vividly describes what's wrong or what
happened :).... But it also gave me an idea that we can have an entire
logging panel for ZAP :).......
…On Mon, May 15, 2023, 12:10 PM thc202 ***@***.***> wrote:
***@***.**** approved this pull request.
------------------------------
In
addOns/paramdigger/src/main/java/org/zaproxy/addon/paramdigger/CacheController.java
<#4561 (comment)>
:
> + switch (method) {
+ case GET:
+ headers.setMethod(HttpRequestHeader.GET);
+ break;
+ case POST:
+ headers.setMethod(HttpRequestHeader.POST);
+ break;
+ default:
+ throw new IllegalArgumentException(
+ "Method " + method + " not supported.");
+ }
Does not need to be in this PR, letting the enum update the request header
would reduce duplication and simplify the code.
------------------------------
In
addOns/paramdigger/src/main/java/org/zaproxy/addon/paramdigger/CacheController.java
<#4561 (comment)>
:
> @@ -829,9 +859,22 @@ private boolean checkAlwaysMiss(String url, Method method, Cache cache) {
// faced.
}
String indicValue = msg.getResponseHeader().getHeader(cache.getIndicator());
- return (indicValue == null
- || indicValue.isEmpty()
- || !this.checkCacheHit(indicValue, cache));
+ if (indicValue == null || indicValue.isEmpty()) {
+ return true;
+ } else {
These else statements could be removed.
—
Reply to this email directly, view it on GitHub
<#4561 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN6F3GMOHSJ6BRBQ3KJGI6DXGHFUFANCNFSM6AAAAAAXIXYJXQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
That's what the Output panel is (IMHO) |
Related to: zaproxy/zaproxy#7694