在我的我的Ubuntu 14.04服務器的/var/log/mail.log暴力破解的(wildcard-)子域,我覺得行像這些數額巨大:iptables的 - 塊,因爲不同IP的
Sep 16 13:23:03 server postfix/smtpd[25621]: warning: 212-83-162-157.rev.poneytelecom.eu[212.83.162.157]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
....
Sep 16 12:57:29 server postfix/smtpd[24828]: warning: 212-83-175-192.rev.poneytelecom.eu[212.83.175.192]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
所以我認爲,有人會試圖在postfix上登錄發送垃圾郵件。正如你所看到的,每一次犯罪行爲都使用不同的IP和子域名。因此通過配置iptables來阻止特定的IP是沒有意義的。 所以我想要做的就是阻止iptables的域名「poneytelecom.eu」的所有子域名。
所以我嘗試不同的東西:
iptables -I INPUT -m string --algo bm --string "*poneytelecom.eu" -j DROP
iptables -I INPUT -m string --string "Host: *poneytelecom.eu" --algo bm -j DROP
iptables –A INPUT –m string --algo bm --string "*poneytelecom.eu" -j DROP
命令 「的iptables -L -n --line」 這樣說:
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 DROP all -- 0.0.0.0/0 0.0.0.0/0 STRING match "Host: *poneytelecom.eu" ALGO name bm TO 65535
2 DROP all -- 0.0.0.0/0 0.0.0.0/0 STRING match "*poneytelecom.eu" ALGO name bm TO 65535
3 DROP all -- 0.0.0.0/0 0.0.0.0/0 STRING match "*poneytelecom.eu" ALGO name bm TO 65535
但與它不工作;我仍然可以通過這個域名看到/var/log/mail.log唱到-嘗試:
Sep 16 13:32:25 server postfix/smtpd[25922]: warning: 62-210-188-107.rev.poneytelecom.eu[62.210.188.107]: SASL LOGIN authentication failed: UGFzc3dvcmQ6
是否有人知道,就是我錯了分別如何通過iptables來阻止子域在做什麼?
我想避免進一步的軟件來實現這一點。我寫了一個bash腳本,這個腳本在IP地址上已經很好用了。這個腳本我想擴展到稍後再聽(子)域。因此我需要知道爲什麼iptables的子域配置不能像我那樣工作。 – Andre