Answer the question
In order to leave comments, you need to log in
Firewall iptables, state module - can be used as a type of protection?
Hello.
Based on an article on habrahabr.ru about the DNS Amplification attack, it says: "The attack is based on sending a DNS request to any DNS server with a substituted source ip address equal to the ip address of the victim."
I'm not strong in the network part, at what level is the IP address spoofed? I do not think that this is done at the network level, as a result of this, the following scheme seems to me
: DNS service.
2. Next, the DNS service parses the received data, "eats" a fake IP (or am I wrong at this stage?) And tries to send a response to a fake server.
Actually, based on this scheme, there are two rules in iptables:
-A INPUT -p udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -p udp --sport 53 -m state --state ESTABLISHED -j ACCEPT
Answer the question
In order to leave comments, you need to log in
First, you do not need to shine recursive DNS on the Internet.
For bind it looks like this:
//disable recursive requests from outside
allow-recursion { 127.0.0.1;
::1; };
# Requests per second
RQS="15"
# Requests per 7 seconds
RQH="35"
iptables -I INPUT -p udp --dport 53 -m state --state NEW -m recent --set --name DNSQF --rsource
iptables -I INPUT -p udp --dport 53 -m state --state NEW -m recent --update --seconds 1 --hitcount ${RQS} --name DNSQF --rsource -j DROP
iptables -I INPUT -p udp --dport 53 -m state --state NEW -m recent --set --name DNSHF --rsource
iptables -I INPUT -p udp --dport 53 -m state --state NEW -m recent --update --seconds 7 --hitcount ${RQH} --name DNSHF --rsource -j DROP
The change is just done on the network. Classical routing only checks the destination address, so it doesn't give a damn about the source address. This can be done, for example, using NAT tools on any piece of hardware, or you can independently generate a request with a script.
Specifically on your topic, what prevents you from hanging up rules with different states, trying to make queries and see counters?
PS already use conntrack instead of state)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question