Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
245-Labs/Week7_XSS/Challenges/webapp/xss_trainer/templates/levels/ClientSide.html
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
60 lines (43 sloc)
1.19 KB
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
{% extends "levelBase.html" %} | |
{% block content %} | |
{% markdown %} | |
This time we have to deal with some <mark><strong>client side filtering</strong></mark>. | |
Again, This should be nice and easy. | |
Trigger an alert on this page using reflected XSS | |
### Filter | |
The Filter used in this instance is: | |
```.python | |
#Filter | |
def filter(data): | |
return data | |
#And Application code | |
data = request.args.get("payload") | |
output = filter(data) | |
``` | |
(Which is roughly equivalent to the PHP) | |
```.php | |
<?php | |
$data = $_GET["payload"]; | |
echo ($data); | |
?> | |
``` | |
{% endmarkdown %} | |
{% endblock content %} | |
{% block defaultForm %} | |
<div class="card mt-3"> | |
<div class="card-header"> | |
<h3>Vulnerable Form</h3> | |
</div> | |
<div class="card-body"> | |
<div class="border" id="theForm"> | |
<form method="POST" action={{ url_for('levels', levelId=level) }}> | |
<div class="mt-2 mb-3"> | |
<label for="payload" class="form-label">Example User Input</label> | |
<input class="form-control" type="email" name="payload" id="payload" placeholder="<script>alert('testing')</script>"</input> | |
</div> | |
<button type="submit" id="submitBtn" class="btn btn-primary">Submit</button> | |
</form> | |
</div> | |
</div> | |
</div> | |
{% endblock defaultForm %} |