随分前からSPNのネットワークセキュリティコースでは話しているが、Solaris 10のarp -sで設定した静的エントリはpermanentを付けないとARPキャッシュポイゾニングで上書きされてしまう。
しかもARPキャッシュポイゾニングで上書きされたエントリはそのまま静的エントリになってしまうので悪用されるとやっかいだ。
対策としては、Solaris 10ではarp -sの最後にpermanentを付ければ良い。
arp -s 192.0.2.1 xx:xx:xx:xx:xx:xx permanent
man arpにあるpermanentについての説明は下記の通り。
The word permanent indicates that the system will not accept MAC address changes for hostname from the network.
permanent付きarp -sで静的エントリを設定したら、念のためarp -anでフラグを確認しよう。
# arp -an Net to Media Table: IPv4 Device IP Address Mask Flags Phys Addr ------ -------------------- --------------- -------- --------------- e1000g0 192.0.2.1 255.255.255.255 SA xx:xx:xx:xx:xx:xx #
FlagsがSAならpermanent付きarp -sで設定された静的エントリなので、ARPキャッシュポイゾニングでは上書きされない。
man arpにあるAフラグについての説明は下記の通り。
A Authority; this machine is authoritative for this IP address. ARP will not accept updates from other machines for this entry.
ちなみにSolaris 11.1では、arp -sで設定した静的エントリ(permanent無し)であってもARPキャッシュポイゾニングで上書きされなかった。
あと、もう使っている人はいないと思うけど、Solaris 9以前ではpermanentすら存在しないので静的エントリを設定してもARPキャッシュポイゾニングで上書きし放題だったりする。