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.
- Loading branch information
Showing
22 changed files
with
80 additions
and
101 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ipting/src/main/resources/lessonPlans/en/CrossSiteScriptingMitigation_plan.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
4 changes: 2 additions & 2 deletions
4
...-scripting/src/main/resources/lessonPlans/en/CrossSiteScriptingStored_plan.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,8 +1,8 @@ | ||
== Concept | ||
|
||
After taking a look at Reflected XSS in the previous lesson. We are now gonna take a closer look at another form of Cross-Site Scripting Attack: Stored XSS. | ||
After looking at Reflected XSS in the previous lesson, we are now going to take a closer look at another form of Cross-Site Scripting Attack: Stored XSS. | ||
|
||
== Goals | ||
* The user will learn what Stored XSS is | ||
* The user will demonstrate knowledge on: | ||
** Stored XSS injection | ||
** Stored XSS injection |
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
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
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
4 changes: 2 additions & 2 deletions
4
...te-scripting/src/main/resources/lessonPlans/en/CrossSiteScripting_content5.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
6 changes: 3 additions & 3 deletions
6
...e-scripting/src/main/resources/lessonPlans/en/CrossSiteScripting_content5a.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,8 +1,8 @@ | ||
== Try It! Reflected XSS | ||
|
||
The goal of the assignment is to identify which field is susceptible to XSS. | ||
The assignment's goal is to identify which field is susceptible to XSS. | ||
|
||
It is always a good practice to validate all input on the server-side. XSS can occur when unvalidated user input gets used in an HTTP response. | ||
It is always a good practice to validate all input on the server side. XSS can occur when unvalidated user input gets used in an HTTP response. | ||
In a reflected XSS attack, an attacker can craft a URL with the attack script and post it to another website, email it, or otherwise get a victim to click on it. | ||
|
||
An easy way to find out if a field is vulnerable to an XSS attack is to use the `alert()` or `console.log()` methods. Use one of them to find out which field is vulnerable. | ||
An easy way to find out if a field is vulnerable to an XSS attack is to use the `alert()` or `console.log()` methods. Use one of them to find out which field is vulnerable. |
4 changes: 2 additions & 2 deletions
4
...e-scripting/src/main/resources/lessonPlans/en/CrossSiteScripting_content5b.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,10 +1,10 @@ | ||
== Self XSS or reflected XSS? | ||
|
||
You should have been able to execute script with the last example. At this point, it would be considered 'self XSS' though. | ||
You should have been able to execute the script with the last example. At this point, it is considered 'self XSS,' though. | ||
|
||
Why is that? | ||
|
||
That is because there is no link that would trigger that XSS. | ||
That is because no link triggers that XSS. | ||
You can try it yourself to see what happens ... go to: | ||
|
||
link:/WebGoat/CrossSiteScripting/attack5a?QTY1=1&QTY2=1&QTY3=1&QTY4=1&field1=<script>alert('my%20javascript%20here')</script>4128+3214+0002+1999&field2=111["/WebGoat/CrossSiteScripting/attack5a?QTY1=1&QTY2=1&QTY3=1&QTY4=1&field1=<script>alert('my%20javascript%20here')</script>4128+3214+0002+1999&field2=111",window=_blank] |
12 changes: 6 additions & 6 deletions
12
...te-scripting/src/main/resources/lessonPlans/en/CrossSiteScripting_content6.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,14 +1,14 @@ | ||
== Reflected and DOM-Based XSS | ||
|
||
DOM-based XSS is another form of reflected XSS. Both are triggered by sending a link with inputs that are reflected to the browser. | ||
The difference between DOM and 'traditional' reflected XSS is that, with DOM, the payload will never go to the server. It will only ever be processed by the client. | ||
DOM-based XSS is another form of reflected XSS. Both are triggered by sending a link with inputs reflected in the browser. | ||
The difference between DOM and 'traditional' reflected XSS is that, with DOM, the payload will never go to the server. The client will only ever process it. | ||
|
||
|
||
* Attacker sends a malicious URL to victim | ||
* Attacker sends a malicious URL to the victim | ||
* Victim clicks on the link | ||
* That link may load a malicious web page or a web page they use (are logged into?) that has a vulnerable route/handler | ||
* If it's a malicious web page, it may use it's own JavaScript to attack another page/url with a vulnerable route/handler | ||
* The vulnerable page renders the payload and executes attack in the user's context on that page/site | ||
* If it's a malicious web page, it may use its own JavaScript to attack another page/URL with a vulnerable route/handler | ||
* The vulnerable page renders the payload and executes an attack in the user's context on that page/site | ||
* Attacker's malicious script may run commands with the privileges of local account | ||
*Victim does not realize attack occurred* ... Malicious attackers don't use <script>alert('xss')</ script> | ||
*Victim does not realize attack occurred* ... Malicious attackers don't use <script>alert('xss')</ script> |
8 changes: 4 additions & 4 deletions
8
...e-scripting/src/main/resources/lessonPlans/en/CrossSiteScripting_content6a.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,15 +1,15 @@ | ||
== Identify potential for DOM-Based XSS | ||
|
||
DOM-Based XSS can usually be found by looking for the route configurations in the client-side code. | ||
Look for a route that takes inputs that are being "reflected" to the page. | ||
Look for a route that takes inputs that are "reflected" to the page. | ||
|
||
For this example, you will want to look for some 'test' code in the route handlers (WebGoat uses backbone as its primary JavaScript library). | ||
Sometimes, test code gets left in production (and often times test code is very simple and lacks security or any quality controls!). | ||
Sometimes, test code gets left in production (and often test code is simple and lacks security or quality controls!). | ||
|
||
Your objective is to find the route and exploit it. First though ... what is the base route? As an example, look at the URL for this lesson ... | ||
Your objective is to find the route and exploit it. First though, what is the base route? As an example, look at the URL for this lesson ... | ||
it should look something like /WebGoat/start.mvc#lesson/CrossSiteScripting.lesson/9. The 'base route' in this case is: | ||
*start.mvc#lesson/* | ||
The *CrossSiteScripting.lesson/9* after that are parameters that are processed by the JavaScript route handler. | ||
|
||
So, what is the route for the test code that stayed in the app during production? | ||
To answer this question, you have to check the JavaScript source. | ||
To answer this question, you have to check the JavaScript source. |
10 changes: 5 additions & 5 deletions
10
...e-scripting/src/main/resources/lessonPlans/en/CrossSiteScripting_content6b.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,11 +1,11 @@ | ||
== Try It! DOM-Based XSS | ||
|
||
Some attacks are "blind". Fortunately, you have the server running here so you will be able to tell if you are successful. | ||
Use the route you just found and see if you can use the fact that it reflects a parameter from the route without encoding to execute an internal function in WebGoat. | ||
The function you want to execute is ... | ||
Some attacks are "blind." Fortunately, you have the server running here, so you can tell if you are successful. | ||
Use the route you just found and see if you can use it to reflect a parameter from the route without encoding to execute an internal function in WebGoat. | ||
The function you want to execute is: | ||
|
||
*webgoat.customjs.phoneHome()* | ||
|
||
Sure, you could just use console/debug to trigger it, but you need to trigger it via a URL in a new tab. | ||
Sure, you could use console/debug to trigger it, but you need to trigger it via a URL in a new tab. | ||
|
||
Once you do trigger it, a subsequent response will come to your browser's console with a random number. Put that random number in below. | ||
Once you trigger it, a subsequent response will come to your browser's console with a random number. Put that random number below. |
4 changes: 2 additions & 2 deletions
4
...te-scripting/src/main/resources/lessonPlans/en/CrossSiteScripting_content7.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
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
4 changes: 2 additions & 2 deletions
4
...e-scripting/src/main/resources/lessonPlans/en/CrossSiteScripting_content7c.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,3 +1,3 @@ | ||
Watching in your browser's developer tools or your proxy, the output should include a value starting with 'phoneHome Response is ...." | ||
Put that value in below to complete this exercise. Note that, each subsequent call to the _phoneHome_ method will change that value. | ||
You may need to ensure you have the most recent one. | ||
Put that value below to complete this exercise. Note that each subsequent call to the _phoneHome_ method will change that value. | ||
You may need to ensure you have the most recent one. |
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
22 changes: 11 additions & 11 deletions
22
...e-scripting/src/main/resources/lessonPlans/en/CrossSiteScripting_content8a.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
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
Oops, something went wrong.