
The IKE Scanner
IKEホスト(IPsec VPNサーバ)の発見とフィンガープリント取得
ike-scanは標準のGNU autoconfおよびautomakeツールを使用しているため、インストールは通常の手順となります。
git clone https://github.com/royhills/ike-scan.git を実行してプロジェクトのソースコードを取得しますcd ike-scan を実行してソースディレクトリに移動しますautoreconf --install を実行して有効な ./configure ファイルを生成します./configure または ./configure --with-openssl を実行してOpenSSLライブラリを使用しますmake を実行してプロジェクトをビルドしますmake check を実行してすべてが正しく動作することを確認しますmake install を実行してインストールします(この部分にはrootまたはsudoが必要です)事前共有鍵の解読を行う予定がある場合は、組み込みのハッシュ関数より通常高速なOpenSSLのハッシュ関数を使用するようike-scanを設定することをお勧めします。これを行うには、OpenSSLのインクルードファイルとライブラリがインストールされていることを確認し、./configure --with-openssl としてconfigureを実行してください。OpenSSLを使用するかどうかはike-scanの機能に影響しません。psk-crackによる事前共有鍵解読の速度のみが変わります。
一部のオペレーティングシステムではOpenSSLのヘッダとライブラリがデフォルトでインストールされますが、他のOSではオプションパッケージのインストールが必要です。例えばDebian Linuxではlibssl-devパッケージをインストールする必要があります。あるいは、http://www.openssl.org/ からOpenSSLのtarballをダウンロードしてインストールすることもできます。
ほとんどの最新のUnix系OSでビルドできるはずです。Cygwinを使用すればWindowsでも動作し、cygwin1.dllが存在すればスタンドアロンのWindows実行ファイルとしても使用できます。
Windows-32バイナリパッケージを使用する場合は、Windowsプラットフォームで実行する際の違いについて説明したREADME-WIN32ファイルもお読みください。
このプログラムは、Linux、FreeBSD、OpenBSD、NetBSD、Win32/Cygwin、Solaris、MacOS X、HP Tru64、HP-UX、SCO OpenServerでビルドおよび実行できることが確認されています。詳細については、以下の「対応プラットフォーム」セクションを参照してください。
ike-scanはIKEホストを発見し、再送バックオフパターンを使用してフィンガープリントを取得することもできます。
ike-scanは以下の機能を実行できます。
再送バックオフフィンガープリントの概念については、ike-scanキットに含まれているUDPバックオフフィンガープリント文書(UDP Backoff Fingerprinting Paper)で詳しく説明されています。
このプログラムは、指定されたホストにIKEフェーズ1(メインモードまたはアグレッシブモード)の要求を送信し、受信した応答を表示します。パケット損失に対処するため、バックオフを伴う再試行と再送を処理します。また、送信IKEパケットによる帯域幅の使用量を制限します。
IKEはInternet Key Exchangeプロトコルであり、IPsecで使用される鍵交換および認証の仕組みです。最新のVPNシステムのほとんどはIPsecを実装しており、IPsec VPNの大多数がIKEを鍵交換に使用しています。メインモードはIKE交換のフェーズ1で定義されたモードの1つです(もう1つの定義済みモードはアグレッシブモードです)。RFC 2409のセクション5ではメインモードの実装が必須とされているため、すべてのIKE実装がメインモードをサポートしていると期待できます。多くはアグレッシブモードもサポートしています。
現在の使用法情報を表示するには、ike-scanバイナリを次のように実行します。ike-scan -h
Additional documentation is provided on the NTA Monitor Wiki
To report bugs or suggest new features, please create a GitHub issue.
The hosts to scan can be specified on the command line or read from an input file using the --file=<fn> option. The program can cope with large numbers of hosts limited only by the amount of memory needed to store the list of host_entry structures. Each host_entry structure requires 45 bytes on a 32-bit system, so a class B network (65534 hosts) would require about 2.8 MB for the list. The hosts can be specified as either IP addresses or hostnames, however the program will store all hosts internally as IP addresses and will only display IP addresses in the output (ike-scan calls gethostbyname(3) to determine the IP address of each host, but this can be disabled with the --nodns option).
The program limits the rate at which it sends IKE packets to ensure that it does not overload the network connection. By default it uses an outbound data rate of 56000 bits per second. This can be changed with the --bandwidth option.
If you want to send packets at a specific rate, you can use the --interval option.
ike-scan generates unique IKE cookies for each host, and it uses these cookies to determine which host the response packets belong to. Note that it does not rely on the source IP address of the response packets because it is possible for a response packet to be sent from a different IP address than it was originally sent to. See the PROGRAM OUTPUT section for an example of this.
The cookies are generated by taking the first 64 bits of an MD5 hash of the current time in seconds and microseconds as returned by gettimeofday(), the unique host number, and the host IP address. This ensures that the cookies are unique with a reasonable degree of certainty.
If --verbose is in effect, any packets that are received with cookies that do not match will result in a message like:
Ignoring 84 bytes from 172.16.2.2 with unknown cookie 195c837e5a39f657
--verbose が有効でない場合、そのようなパケットは黙って無視されます。
このタイプのクッキーの不一致は、以下の原因で発生する可能性があります:
送信されるメインモードパケットには、ISAKMP ヘッダーと SA ペイロードが含まれます。SA ペイロードには単一の提案が含まれ、その提案には以下で詳述するように可変数のトランスフォームを含めることができます。
デフォルトでは、SA 提案には 8 つのトランスフォームが含まれます。これらの 8 つのトランスフォームは、以下のすべての組み合わせを表します:
デフォルトのトランスフォームセットを使用して ike-scan によって送信されるメインモードパケットの tcpdump 出力例を以下に示します。これは 8 つのトランスフォームと、それらが送信される順序を示しています: