forked from WebGoat/WebGoat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extended proxy lesson with Edit and Resend and explained how to exclu…
…de WebGoat internal calls from proxying
- Loading branch information
Showing
9 changed files
with
78 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+176 KB
webgoat-lessons/http-proxies/src/main/resources/images/zap_edit_and_resend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.7 KB
webgoat-lessons/http-proxies/src/main/resources/images/zap_edit_and_response.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+55.8 KB
webgoat-lessons/http-proxies/src/main/resources/images/zap_edit_and_send.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+170 KB
webgoat-lessons/http-proxies/src/main/resources/images/zap_exclude.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+60.5 KB
webgoat-lessons/http-proxies/src/main/resources/images/zap_exclude_url.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 14 additions & 15 deletions
29
...sons/http-proxies/src/main/resources/lessonPlans/en/HttpBasics_ProxyIntro4.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
=== Use the intercept | ||
=== Exclude WebGoat internal requests | ||
|
||
To intercept a request, you start by clicking the green button. This will set a break point for the next request. | ||
Before we start diving into intercepting requests with ZAP we need to exclude the internal requests from the WebGoat | ||
framework otherwise ZAP will also stop at all the requests which are only necessary for the internal working of WebGoat. | ||
|
||
image::images/proxy-intercept-button.png[Set break/intercept button,style="lesson-image"] | ||
Right click on one of the links in history tab and select: `Exclude from -> Proxy`, see image below: | ||
|
||
image::images/zap_exclude.png[Select URL from history,style="lesson-image"] | ||
|
||
*NOTE*: It is also possible set breakpoints that are triggered on conditions. That won't be covered in this lesson though. You are encouraged to explore. | ||
That's part of what hackers do ... explore! | ||
{nbsp} | ||
|
||
Once you are intercepting requests and a request is made, it should look something like this: | ||
A new window will open and add the following entries: | ||
|
||
image::images/proxy-intercept-details.png[ZAP history tab,style="lesson-image"] | ||
``` | ||
http://localhost:8080/WebGoat/service/.* | ||
http://localhost:8080/WebGoat/.*.lesson.lesson | ||
``` | ||
|
||
=== Intercept and modify a request | ||
Click Ok to close the window, ZAP will now no longer proxy internal WebGoat requests. | ||
|
||
Set up the intercept as noted above and then submit the form/request below by clicking the submit button. When you request is intercepted (hits the breakpoint), | ||
modify it as follows. | ||
|
||
* Change the Method to GET | ||
* Add a header 'x-request-intercepted:true' | ||
* Change the input value 'changeMe' to 'Requests are tampered easily' (without the single quotes) | ||
image::images/zap_exclude_url.png[Exclude internal APIs from WebGoat,style="lesson-image"] | ||
|
||
|
||
Then let the request continue through (by hitting the play button). | ||
|
||
NOTE: The two play buttons behave a little differently, but we'll let you tinker and figure that out for yourself. |
26 changes: 26 additions & 0 deletions
26
...sons/http-proxies/src/main/resources/lessonPlans/en/HttpBasics_ProxyIntro5.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
=== Use the intercept | ||
|
||
To intercept a request, you start by clicking the green button. This will set a break point for the next request. | ||
|
||
image::images/proxy-intercept-button.png[Set break/intercept button,style="lesson-image"] | ||
|
||
|
||
*NOTE*: It is also possible set breakpoints that are triggered on conditions. That won't be covered in this lesson though. You are encouraged to explore. | ||
That's part of what hackers do ... explore! | ||
|
||
Once you are intercepting requests and a request is made, it should look something like this: | ||
|
||
image::images/proxy-intercept-details.png[ZAP history tab,style="lesson-image"] | ||
|
||
=== Intercept and modify a request | ||
|
||
Set up the intercept as noted above and then submit the form/request below by clicking the submit button. When you request is intercepted (hits the breakpoint), | ||
modify it as follows. | ||
|
||
* Change the Method to GET | ||
* Add a header 'x-request-intercepted:true' | ||
* Change the input value 'changeMe' to 'Requests are tampered easily' (without the single quotes) | ||
|
||
Then let the request continue through (by hitting the play button). | ||
|
||
NOTE: The two play buttons behave a little differently, but we'll let you tinker and figure that out for yourself. |
29 changes: 29 additions & 0 deletions
29
...sons/http-proxies/src/main/resources/lessonPlans/en/HttpBasics_ProxyIntro6.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
=== Use the "Edit and resend" functionality in ZAP | ||
|
||
Another way to send a request again instead of clicking in WebGoat on a button and intercept the request there is also | ||
an option to resend the same request again from within ZAP. | ||
This may significantly help you to solve an assignment because you do not have to switch to ZAP enable the intercept button | ||
and go back to WebGoat and perform the request again from within the browser. | ||
|
||
Let's look at an example, we are going to use the e-mail example from the WebWolf introduction lesson. This lesson | ||
will generate a request for `/WebGoat/WebWolf/mail`, in the "History" window select the URL you want to resend right click | ||
on the URL and select `Open/Resend with Request Editor`. You can also find the request in the left pane of ZAP as indicated | ||
with the red arrow in the image below: | ||
|
||
image::images/zap_edit_and_resend.png[Open/Resend with Request Editor,style="lesson-image"] | ||
|
||
{nbsp} | ||
|
||
A new window will open and here you can modify the request for example change the e-mail address to someone else and send it again. | ||
In the response tab you can inspect the response of the request. In some assignments the response will show a solved message | ||
but sometimes you get a code/flag which you need to submit in WebGoat in order to complete the assignment. Always be on the | ||
lookout for the response. If you solved the assignment by make a request in this way WebGoat will automatically mark | ||
the lesson as solved. | ||
|
||
image::images/zap_edit_and_send.png[Open/Resend with Request Editor,style="lesson-image"] | ||
|
||
{nbsp} | ||
|
||
image::images/zap_edit_and_response.png[Open/Resend response,style="lesson-image"] | ||
|
||
|