Skip to content

Commit

Permalink
Improvements to the Payload Tester
Browse files Browse the repository at this point in the history
  • Loading branch information
ssl committed Sep 22, 2024
1 parent c243476 commit e76c5b6
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions assets/payload-tester.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
<h1 class="title">ezXSS Payload Tester</h1>
<p>This URL fires the ezXSS payload</p>
<div id="browser"></div>
<script>
try {
document.getElementById('browser').innerHTML = '<p><b>Browser: </b>'+navigator.appName+' '+navigator.appVersion+'</p>';
} catch (t) {}
</script>

<a href="javascript:location.reload(true)">Reload page</a>

Expand Down Expand Up @@ -41,7 +36,16 @@ <h1 class="title">ezXSS Payload Tester</h1>
<div class="circle" style="background-color:gray"></div>
<p>github.com/ssl/ezXSS</p>
<div id="colors"></div>

<script>
function e(i){return String(i).replace(/</g, '&lt;').replace(/>/g, '&gt;');}

// Browser details
try {
document.getElementById('browser').innerHTML = '<p><b>Browser: </b>'+e(navigator.appName)+' '+e(navigator.appVersion)+'</p>';
} catch (t) {}

// Random color tester
try {
document.addEventListener("DOMContentLoaded", function () {
for (var i = 0; i < 10; i++) {
Expand All @@ -50,19 +54,15 @@ <h1 class="title">ezXSS Payload Tester</h1>
};
});
} catch (t) {}
</script>

<!-- Add test data to storage -->
<script>
// Storage and cookie tester
try {
sessionStorage.setItem("sessionStorageTester", Date.now());
localStorage.setItem("localStorageTester", Date.now());
document.cookie = "CookieTester=" + Date.now();
} catch (t) {}
</script>

<!-- Middle-man HTTP requests -->
<script>
// Middle-man HTTP requests
(function () {
try {
if (window.XMLHttpRequest) {
Expand All @@ -84,9 +84,9 @@ <h1 class="title">ezXSS Payload Tester</h1>
function logRequest(request) {
var tableBody = document.querySelector('#requests tbody');
var newRow = document.createElement('tr');
newRow.innerHTML = '<td>' + request.method + '</td>' +
'<td>' + request.url + '</td>' +
'<td>' + request.status + '</td>';
newRow.innerHTML = '<td>' + e(request.method) + '</td>' +
'<td>' + e(request.url) + '</td>' +
'<td>' + e(request.status) + '</td>';
tableBody.appendChild(newRow);
document.getElementById('table-wrap').style.display = 'block';
}
Expand All @@ -97,6 +97,7 @@ <h1 class="title">ezXSS Payload Tester</h1>

<!-- Load payload from main domain -->
<script src="/"></script>

<hr>
<script>
try {
Expand All @@ -118,7 +119,7 @@ <h1 class="title">ezXSS Payload Tester</h1>
</tr>
</thead>
<tbody>
<!-- Requests will be added here -->

</tbody>
</table>
</div>
Expand Down

0 comments on commit e76c5b6

Please sign in to comment.