-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fuzzer improvements on redirects and js changes
- Loading branch information
1 parent
8cf2a1a
commit a0da165
Showing
4 changed files
with
78 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,4 +118,7 @@ | |
/%EXT%.backup | ||
/%EXT%.bak | ||
/%EXT%.cgi | ||
/%EXT%.conf | ||
/%EXT%.conf | ||
/.gem | ||
/test | ||
/dvwa/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,47 @@ | ||
function fetchUrls() { | ||
const xhr = new XMLHttpRequest(); | ||
xhr.open("GET", "/consumer", true); | ||
xhr.onload = function () { | ||
if (this.status === 200) { | ||
// Parse JSON response | ||
const data = JSON.parse(this.responseText); | ||
const xhr = new XMLHttpRequest(); | ||
xhr.open("GET", "/consumer", true); | ||
xhr.onload = function () { | ||
if (this.status === 200) { | ||
// Parse JSON response | ||
const data = JSON.parse(this.responseText); | ||
|
||
// Get container element | ||
const container = document.getElementById("container"); | ||
var bar = document.querySelector(".progress-bar"); | ||
var speedElement = document.getElementById("data"); | ||
// Clear loading message and append data | ||
container.innerHTML = ""; | ||
data.Urls.forEach(url => { | ||
// Get container element | ||
const container = document.getElementById("container"); | ||
var bar = document.querySelector(".progress-bar"); | ||
var speedElement = document.getElementById("data"); | ||
// Clear loading message and append data | ||
container.innerHTML = ""; | ||
data.Urls.forEach(url => { | ||
// Update the speedElement for each URL | ||
bar.style.width = url.progress + "%"; | ||
speedElement.innerText = url.data; | ||
bar.innerText = url.progress.toFixed(0) + "%"; // format the percentage to one decimal place | ||
if (url.status === 200) { // only display 200 status codes in green | ||
container.innerHTML += `<p>${url.id} <a href="${url.path}" target="_blank">${url.path}</a> - <span style="color: green;"> http code: ${url.status} progress: ${url.progress} ${url.data}</span></p>`; | ||
} | ||
}); | ||
} else { | ||
console.error("Error fetching data"); | ||
} | ||
} | ||
xhr.send(); | ||
} | ||
bar.innerText = url.progress.toFixed(0) + "%"; | ||
if (url.status === 200 || url.status === 301 || url.status === 302) { | ||
let urlDisplay; | ||
if (url.status === 301) { | ||
// For 301 status code, use redirectpath | ||
urlDisplay = `<p>${url.id} <a href="${url.path}" target="_blank">${url.path}</a> - <span style="color: orange;">REDIRECTS TO:</span> <a href="${url.redirectpath}" target="_blank">${url.redirectpath}</a> - <span style="color: green;"> http code: ${url.status} progress: ${url.progress} ${url.data}</span></p>`; | ||
} else if (url.status === 302) { | ||
// For 302 status code, concatenate path and redirectpath | ||
let targetPath = url.redirectpath ? url.path + url.redirectpath : url.path; | ||
urlDisplay = `<p>${url.id} <a href="${url.path}" target="_blank">${url.path}</a> - <span style="color: orange;">REDIRECTS TO:</span> <a href="${targetPath}" target="_blank">${targetPath}</a> - <span style="color: green;"> http code: ${url.status} progress: ${url.progress} ${url.data}</span></p>`; | ||
} else { | ||
// For other status codes (200), use the original path | ||
urlDisplay = `<p>${url.id} <a href="${url.path}" target="_blank">${url.path}</a> - <span style="color: green;"> http code: ${url.status} progress: ${url.progress.toFixed(0)}% ${url.data}</span></p>`; | ||
} | ||
|
||
container.innerHTML += urlDisplay; | ||
} | ||
}); | ||
// Update the overall progress bar and data element | ||
} else { | ||
console.error("Error fetching data"); | ||
} | ||
}; | ||
xhr.send(); | ||
} | ||
|
||
// Call fetchUrls() when page is loaded | ||
// Call fetchUrls() when the page is loaded | ||
window.onload = fetchUrls; | ||
setInterval(fetchUrls, 1000); |