近來公司的郵件伺服器(sendmail)每星期都會受到一些陌生主機騷擾,雖然不至於發生什麼損害但是聽到磁碟在嘎啦嘎啦作響總是心中不舒服,先利用vi 這個文字編輯軟體來查了一下郵件伺服器電腦的日誌檔 /var/log/maillog ,可以看到下面一些內容。
Oct 7 09:45:37 ken sendmail[8006]: l97GQ0p0008006: static-71-102-92-212.plspca.dsl-w.verizon.net [71.102.92.212] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Oct 7 09:45:39 ken sendmail[8000]: l97GPwux008000: static-71-102-92-212.plspca.dsl-w.verizon.net [71.102.92.212] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Oct 7 09:45:39 ken sendmail[7998]: l97GPwJo007998: static-71-102-92-212.plspca.dsl-w.verizon.net [71.102.92.212] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
由上列資料可知騷擾公司的郵件伺服器(sendmail)是由 [71.102.92.212] 這個 ip 的電腦傳來的,所以我們可以利用防火牆來封住這一個 ip ,讓公司的郵件伺服器(sendmail)不再理會這個 ip 所傳來的訊息。你可以用 root 帳號進入 linux文字環境時,輸入下列指令即可啟動利用防火牆來封住 [71.102.92.212] 這個 ip。
iptables -A INPUT -i eth0 -p tcp -s 71.102.92.212 -j DROP
此時防火牆已經生效而開始不再理會這個 ip 所傳來的訊息,你可以利用下列指令去檢查上列指令是否有效。
iptables -L
輸入上列指令後,linux 會將目前所有已設定的防火牆規則全部一行一行的列出來,這時您只要找到下面這一行就表示我們之前輸入的指令已經生效了。
DROP tcp -- static-71-102-92-212.plspca.dsl-w.verizon.net anywhere
No Pingbacks for this post yet...
一個與您分享Linux經驗的地方.
本站目前共有 740 篇文章。
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| << < | > >> | |||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | ||