-
-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from SasanLabs/UI_Handling
Adding XSS image tag vulnerability
- Loading branch information
Showing
7 changed files
with
66 additions
and
16 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/main/java/org/sasanlabs/internal/utility/annotations/ResponseType.java
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,19 @@ | ||
package org.sasanlabs.internal.utility.annotations; | ||
|
||
/** | ||
* Usage of this is to distinguish what is the response type from the VulnerableRestEndpoint. | ||
* Actually we want backend to provide entire information to frontend so that frontend | ||
* is not tightly coupled with backend. This is done with an intent that the backend can | ||
* be consumer by any application without the use of frontend like say a CTF hosting | ||
* platform need not to use the UserInterface provided by vulnerableApp. | ||
* | ||
* So this information will be returned with the response of /allEndPoints and /allEndPointsJson | ||
* so that consumer can write the code as per the provided information by these endpoints. | ||
* | ||
* @author KSASAN [email protected] | ||
*/ | ||
public enum ResponseType { | ||
ENTIRE_HTML_PAGE, | ||
JSON, | ||
HTML_TAGS_ONLY | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
9 changes: 9 additions & 0 deletions
9
src/main/resources/static/templates/XXSInImgTagAttribute/LEVEL_1/XSS.html
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,9 @@ | ||
<div id="XSS"> | ||
<div> | ||
<div> | ||
<input type="text" id="imageInputSrc"/> | ||
<button id="loadImage">Load</button> | ||
<div id="image"></div> | ||
</div> | ||
</div> | ||
</div> |
14 changes: 14 additions & 0 deletions
14
src/main/resources/static/templates/XXSInImgTagAttribute/LEVEL_1/XSS.js
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,14 @@ | ||
function addingEventListenerToLoadImageButton() { | ||
document.getElementById("loadImage").addEventListener('click', | ||
function () { | ||
let url = getUrlForVulnerabilityLevel(); | ||
doGetAjaxCall(appendResponseCallback, url + "?value=images/" + document.getElementById("imageInputSrc").value, false); | ||
}); | ||
}; | ||
addingEventListenerToLoadImageButton(); | ||
|
||
function appendResponseCallback(data) { | ||
let div = document.createElement("div"); | ||
document.getElementById("image").appendChild(div); | ||
div.innerHTML = data; | ||
} |