# 264/tcp - Pentesting Check Point Firewall

Tip

AWSハッキングを学び、実践する:HackTricks Training AWS Red Team Expert (ARTE)
GCPハッキングを学び、実践する:HackTricks Training GCP Red Team Expert (GRTE) Azureハッキングを学び、実践する:HackTricks Training Azure Red Team Expert (AzRTE)

HackTricksをサポートする

CheckPoint Firewall-1 ファイアウォールと対話して、ファイアウォール名や管理ステーション名などの有用な情報を取得できます。これはポート 264/TCP にクエリを送信することで行えます。

ファイアウォールおよび管理ステーション名の取得

認証前リクエストを使用して、CheckPoint Firewall-1 を標的とするモジュールを実行できます。この操作に必要なコマンドは以下に示します:

use auxiliary/gather/checkpoint_hostname
set RHOST 10.10.10.10

モジュールを実行すると、firewall の SecuRemote Topology service に接続を試みます。成功すると、CheckPoint Firewall の存在を確認し、firewall と SmartCenter management host の名前を取得します。出力の例は次のようになります:

[*] Attempting to contact Checkpoint FW1 SecuRemote Topology service...
[+] Appears to be a CheckPoint Firewall...
[+] Firewall Host: FIREFIGHTER-SEC
[+] SmartCenter Host: FIREFIGHTER-MGMT.example.com
[*] Auxiliary module execution completed

ホスト名とICA名検出の代替手法

別の手法として、特定のクエリをファイアウォールに送信し、その応答を解析してファイアウォールのホスト名とICA名を抽出する直接的なコマンドがあります。コマンドとその構成は次のとおりです:

printf '\x51\x00\x00\x00\x00\x00\x00\x21\x00\x00\x00\x0bsecuremote\x00' | nc -q 1 10.10.10.10 264 | grep -a CN | cut -c 2-

このコマンドの出力は、以下に示すように、ファイアウォールの証明書名 (CN) および組織 (O) に関する詳細情報を提供します:

CN=Panama,O=MGMTT.srv.rxfrmi

HTTP Security Server Format String Bug (CAN-2004-0039)

影響を受けるビルド: NG FCS, NG FP1, NG FP2, NG FP3 HF2, and NG with Application Intelligence R54/R55. 要件: The HTTP Security Server または AI HTTP proxy が有効化され、対象ポートを透過的に検査している必要があります。HTTP inspection が無効化されている場合、脆弱なコードパスには到達しません。

エラーハンドラをトリガーする

proxy は不正な HTTP メッセージを拒否し、sprintf(errbuf, attacker_string); を使って独自のエラーページを生成します。これにより attacker-controlled bytes がフォーマット文字列として扱われます。firewall 経由で無効なリクエストを送信し、payload を反映した proxy-generated error を探してください:

printf 'BOGUS%%08x%%08x%%08x%%n HTTP/1.0\r\nHost: internal.local\r\n\r\n' | nc -nv [FIREWALL_IP] 80

If HTTP inspection is active, the firewall (not the backend server) answers immediately, proving the middlebox parsed and replayed the request line.

悪用

Format string primitive

  • パーサをエラー処理ルーチンに強制的に入らせる(無効な method、URI、または headers)。
  • 攻撃者制御の dwords を先頭に置き、%x%s、および %n ディレクティブがそれらをスタック引数として扱うようにする。
  • %x/%s を使って pointers を leak し、その後 %n/%hn でフォーマット済みバイト数を選択したアドレスに書き込み、return pointers、vtables、または heap metadata を上書きして injected shellcode や ROP で実行をハイジャックする。

Heap overflow primitive

The same unsafe sprintf() writes into a fixed-size heap buffer. Mix a long request body with oversized directives (e.g., %99999x) so the formatted output overruns the allocation and corrupts adjacent heap structures, letting you forge freelist pointers or function tables that are later dereferenced.

影響

proxy の侵害により firewall process 内でコード実行が得られる(Windows appliances 上では SYSTEM、UNIX では root)、これにより rule manipulation、traffic interception、および management network へのさらなる pivoting が可能になる。

参考資料

Tip

AWSハッキングを学び、実践する:HackTricks Training AWS Red Team Expert (ARTE)
GCPハッキングを学び、実践する:HackTricks Training GCP Red Team Expert (GRTE) Azureハッキングを学び、実践する:HackTricks Training Azure Red Team Expert (AzRTE)

HackTricksをサポートする