1. ICMP-based port scan

ここを勉強する必要がある。

from next hop exception https://www.cisco.com/c/ja_jp/support/docs/ios-nx-os-software/nx-os-software/213841-understanding-icmp-redirect-messages.html

• ICMP-Based Port Scan

"An attacker does not necessarily have to rely on the explicit feedback 
from an ICMP probe," the researchers noted.
"Instead, even if the processing of ICMP probes is completely silent, 
as long as there is some shared resource whose state is influenced,
we may find ways (other probes) to observe the changed state of the shared resource."

The central idea of the attack is to use the limited number of total slots
in the global exception cache, a 2048-bucket hash table, 
to discern if an update has occurred following a batch of ICMP probes. 

The side channel is also different from SAD DNS in that 
it arises when processing incoming ICMP messages (as opposed to egress packets) and
it "leverages the space resource limit (i.e., the space for storing the next hop
exception cache is limited) 
while SAD DNS' side channel leverages the time resource limit 
(i.e., ICMP error generating rate is limited).

ICMP Processing Logic
  ICMP Fragment Needed & ICMP Redirect 

The only ICMP errs modifying the shared resources • i.e., update routing table
• Frag needed
• Packet exceeds MTU
• PMTU for a host is updated in routing table

• Redirect (more details in the paper)
• Better routes available
• Next hop to a host is updated in routing table

内部状態の変更がside channelとして、検知される。(変更の内容によって、オープンportが分かる。)

Comparison with SADDNS

2. nmap UDP scan

https://nmap.org/man/ja/man-port-scanning-techniques.html

ICMPポート到達不能エラー(タイプ3、コード 1、2、9、10、13)が返された場合、ポートはclosed(閉じている)状態にある。

その他のICMPポート到達不能エラー(タイプ3、コード3)が返された場合、ポートはfiltered(フィルタあり)と見なされる。

まれにサービスがUDPパケットで応答することがあるが、その場合はポートがopenであることがわかる。

数回の再試行の後も応答がない場合、ポートはopen|filteredに分類される。

これは、ポートが開いているか、もしくはパケットフィルタが通信を阻んでいることを意味する。 バージョンスキャン(-sV)を用いて、実際に開いているポートとフィルタ処理されたポートを識別することもできる。

UDPスキャンに関する大きな課題は、処理の高速化である。

プローブや応答が行方不明になった場合に備えて再試行を行うことになる。

閉じたポートは、さらに大きな問題になる場合が多い。 閉じたポートからは通常、ICMPポート到達不能エラーが返されるが、 閉じたTCPポートがSYNやConnectスキャンに応答してRSTパケットを送る場合とは異なり、 多くのホストでは、ICMPポート到達不能メッセージがデフォルトでレート制限されている。

Linux や Solarisは、この点に関して特に厳しい。例えば、Linux 2.4.20カーネルは、宛先到達不能メッセージを毎秒1個(net/ipv4/icmp.cで指定)に制限している。

Nmapはレート制限を検出し、それに応じて処理速度を下げて、ターゲットマシンで落とされるような無用なパケットでネットワークを溢れさせないようにする。 残念ながら、Linux方式で毎秒1パケットに制限されると、65,536個のポートをスキャンするのに18時間あまりかかる。

UDPスキャンの速度を上げるためのアイデアには、次のようなものがある。 同時並行でスキャンするホストの数を増やす、よく使われるポートだけを先に重点的にスキャンする、ファイアウォールの背後からスキャンする、--host-timeoutオプションを使って低速なホストをスキップする。

ICMP リダイレクトはいつ送信されるか https://www.cisco.com/c/ja_jp/support/docs/ip/routing-information-protocol-rip/13714-43.html

【入門】ICMPリダイレクトの受信設定をなぜオフにしておく必要があるのか? https://www.mtioutput.com/entry/rhel-icmp-redirects


CategoryDns CategoryWatch CategoryTemplate

MoinQ: DNS/毒盛/2021/UCR/ICMP (last edited 2021-11-25 03:04:47 by ToshinoriMaeno)