●SnortへのDoSアタックを回避するには

 Snortには、すでにこれらのDoS攻撃に対する防御策が施されている。「/etc/snort」にある設定ファイル「snort.conf」を確認してみるとわかるが、「preprocessor」部分の「stream4」にStick、Snotに関する記述がある。

 オプションでstream4を利用するよう指定してSnortを起動すれば、TCPに関するトラフィックは3wayハンドシェイクが確率されたストリームや、双方向性のストリームが確認されたもの以外はアラートを出力しないように設定可能だ。つまり、StickやSnotによるTCPトラフィックに関する偽の攻撃ログは出力しないようにすることができる。

-----------------------------------
# vi /etc/snort/snort.conf

〜〜略〜〜

# stream4: stateful inspection/stream reassembly for Snort
#----------------------------------------------------------------------
# Use in concert with the -z [all|est] command line switch to defeat
# stick/snot against TCP rules. Also performs full TCP stream
# reassembly, stateful inspection of TCP streams, etc. Can statefully
# detect various portscan types, fingerprinting, ECN, etc.

〜〜略〜〜

preprocessor stream4: detect_scans, disable_evasion_alerts

 Snortの執筆段階での最新バージョンは1.8.7となっており、Snort1.8.7でのstream4の指定は「-z」オプションで行う。1.8.6までは-zオプションにestの因数を与える必要があったが、1.8.7では-zオプションを指定するのみでよい。

 では例として下記のようにSnortを起動して、同様のアタックテストを行ってみよう。(snort.confのpreprocessor stream4:はデフォルト設定のまま使用している)

○Snortの起動

# /usr/local/bin/snort -Ddz -A fast -c /etc/snort/snort.conf -u snort -g snort ※-zオプションを指定

○アタックテスト

# ./snot -r ./snortrules.txt -s 210.97.12.0/24 -d 192.168.1.11 -l 5

snot V0.92 (alpha) by sniph (sniph00@yahoo.com)

----------------------------------------
Rulefile      : ./snortrules.txt
Source Address   : 210.97.12.0/24
Dest Address    : 192.168.1.11
Number of Packets : Unlimited
Delay (max seconds): 5
Payloads      : Random
----------------------------------------

[Parse Rules - Completed parsing 1066 rules - Sending now]

TCP - "WEB-CGI scriptalias access" - 210.97.12.24:29802 -> 192.168.1.11:80
Sleeping for 3 seconds
UDP - "BACKDOOR DeepThroat 3.1 System Info Client Request" - 210.97.12.91:60000
-> 192.168.1.11:2140
Sleeping for 2 seconds
TCP - "RPC portmap listing" - 210.97.12.8:18395 -> 192.168.1.11:111
Sleeping for 1 seconds
TCP - "WEB-MISC netscape enterprise server directory view" - 210.97.12.20:4801 -
> 192.168.1.11:80
Sleeping for 3 seconds
TCP - "INFO Napster Client Data" - 210.97.12.172:45912 -> 192.168.1.11:6666
Sleeping for 4 seconds
ICMP - "ICMP Redirect (for TOS and Host)" - 210.97.12.192 -> 192.168.1.11
Sleeping for 0 seconds
ICMP - "ICMP Unassigned! (Type 1)" - 210.97.12.9 -> 192.168.1.11
Sleeping for 0 seconds
UDP - "BACKDOOR DeepThroat 3.1 Keylogger Active on Network" - 210.97.12.186:2140
-> 192.168.1.11:60000
Sleeping for 4 seconds
TCP - "Virus - Possible NAVIDAD Worm" - 210.97.12.21:110 -> 192.168.1.11:55022
Sleeping for 0 seconds
TCP - "WEB-MISC netscape enterprise server directory view" - 210.97.12.15:24842
-> 192.168.1.11:80

〜以下略〜

○alertログ

07/31-01:00:40.177352 [**] [1:499:3] ICMP Large ICMP Packet [**] [Classificatio
n: Potentially Bad Traffic] [Priority: 2] {ICMP} 192.168.1.11 -> 210.97.12.180
07/31-01:00:43.185772 [**] [1:499:3] ICMP Large ICMP Packet [**] [Classificatio
n: Potentially Bad Traffic] [Priority: 2] {ICMP} 210.97.12.249 -> 192.168.1.11
07/31-01:00:43.185868 [**] [1:499:3] ICMP Large ICMP Packet [**] [Classificatio
n: Potentially Bad Traffic] [Priority: 2] {ICMP} 192.168.1.11 -> 210.97.12.249
07/31-01:00:47.204795 [**] [1:485:2] ICMP Destination Unreachable (Communicatio
n Administratively Prohibited) [**] [Classification: Misc activity] [Priority: 3
] {ICMP} 210.97.12.173 -> 192.168.1.11
07/31-01:00:58.251455 [**] [1:499:3] ICMP Large ICMP Packet [**] [Classificatio
n: Potentially Bad Traffic] [Priority: 2] {ICMP} 210.97.12.203 -> 192.168.1.11
07/31-01:01:06.279090 [**] [1:237:1] DDOS Trin00:MastertoDaemon(defaultpassdete
cted!) [**] [Classification: Attempted Denial of Service] [Priority: 2] {UDP} 21
0.97.12.133:16236 -> 192.168.1.11:27444
07/31-01:01:08.288453 [**] [1:636:1] SCAN cybercop udp bomb [**] [Classificatio
n: Potentially Bad Traffic] [Priority: 2] {UDP} 210.97.12.148:24665 -> 192.168.1
.11:7
07/31-01:01:14.306370 [**] [1:474:1] ICMP superscan echo [**] [Classification:
Attempted Information Leak] [Priority: 2] {ICMP} 210.97.12.164 -> 192.168.1.11
07/31-01:01:55.474201 [**] [1:650:5] SHELLCODE x86 setuid 0 [**] [Classificatio
n: A system call was detected] [Priority: 2] {UDP} 210.97.12.232:42050 -> 192.16
8.1.11:17458
07/31-01:01:55.474278 [**] [1:650:5] SHELLCODE x86 setuid 0 [**] [Classificatio
n: A system call was detected] [Priority: 2] {ICMP} 192.168.1.11 -> 210.97.12.23
2

〜以下略〜

 ログを見るとわかるが、TCPトラフィックのアラートは出力されていない(spp_stream4: STEALTH ACTIVITYのトラフィックは出力される)。つまり、stream4を利用することで、TCPベースでのアタックは回避は可能であることがわかる。ただし、ログを見ての通りUDP及びICMPトラフィックに関しての偽の攻撃についてはアラートを出力してしまうため、偽の攻撃ログを完全に排除できているわけではない。

 現状ではUDPおよびICMPトラフィックに関しては、実際のアタック内容を把握し、ログを見ながら判断していくしかないだろう。もちろんノイズを減らすためのルールセットの選択や強化も重要になる。いずれにしても実害がなければ、こういったDoSアタックを侵入、攻撃の予兆として捕らえることができるはずだ。

[TTS、ITmedia]

PREV 4/4