iptables -t raw -F
iptables -t raw -I PREROUTING -j DROP -p tcp -m string --string "Mozil" --algo kmp --to 65535 -m tcp --dport 1000 # You can change the port here
iptables -t raw -I PREROUTING -j DROP -p tcp -m string --string "Saf" --algo kmp --to 65535 -m tcp --dport 1000
iptables -t raw -I PREROUTING -j DROP -p tcp -m string --string "Edge" --algo kmp --to 65535 -m tcp --dport 1000
iptables -t raw -I PREROUTING -j DROP -p tcp -m string --string "Oper" --algo kmp --to 65535 -m tcp --dport 1000
iptables -t raw -I PREROUTING -j DROP -p tcp -m string --string "Chrom" --algo kmp --to 65535 -m tcp --dport 1000
iptables -t raw -I PREROUTING -j DROP -p tcp -m string --string "Gecko" --algo kmp --to 65535 -m tcp --dport 1000
iptables -t raw -I PREROUTING -j DROP -p tcp -m string --string "Andr" --algo kmp --to 65535 -m tcp --dport 1000
iptables -t raw -I PREROUTING -j DROP -p tcp -m string --string "exch" --algo kmp --to 65535 -m tcp --dport 1000
iptables -t raw -I PREROUTING -j DROP -p tcp -m string --string "Fire" --algo kmp --to 65535 -m tcp --dport 1000
iptables -t raw -I PREROUTING -j DROP -p tcp -m string --string "Wind" --algo kmp --to 65535 -m tcp --dport 1000如果我尝试访问http://127.0.0.1:1000/,它拒绝连接,但是如果我尝试https://127.0.0.1:1000,我可以访问,为什么?顺便问一下!
它是一个在第7层上使用DDoS攻击的应用服务器。我没有应用程序的src,所以没有阻止iptables的解决方案吗?如果我用相同的规则阻止端口443怎么办?
发布于 2021-09-02 04:05:32
因为HTTP是纯文本,HTTPS是加密的。
撇开这一点不说,我建议不要使用这种方法阻止特定的用户代理-它应该在web服务器本身内完成。
https://serverfault.com/questions/1076373
复制相似问题