Sponsor-Board.de

Normale Version: iptables
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Guten Abend Sponsor Community.
Ich möchte gerne etwas mein game-server root gegen ddos angriffe schützen
(ja ich weiß man kann nicht alles schützen trotz ddos schutz lösung)

Zurück zum thema.
Das spiel ist UDK und lauft auf die UT3 engien. Ab und zu kommen immer ddose rein die den server zum laagen bringen. Da Ddos schutz nicht greif weil sie nicht hoch genug oder so ist.

Ich habe nun eine kleinere iptables gemacht.
Der server lauft auf den Port 7777 und ssh auf ****



Code:
#!/bin/bash
# About: Firewall Regeln fuer iptables
iptables -F
iptables -X

iptables -N DENY
iptables -A DENY -p tcp -m tcp -m limit --limit 30/sec --limit-burst 100 -m comment --comment "Anti-DoS" -j REJECT --reject-with tcp-reset
iptables -A DENY -m limit --limit 30/sec --limit-burst 100 -m comment --comment "Anti-DoS" -j REJECT --reject-with icmp-proto-unreachable
iptables -A DENY -m comment --comment "Alles andere ignorieren" -j DROP

iptables -A FORWARD -p tcp --syn -m limit --limit 1/s -j ACCEPT
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j LOG --log-prefix "Stealth Scan"

iptables -N SERVICES
iptables -A INPUT -p tcp --sport 80 -j ACCEPT
iptables -A SERVICES -p udp -m udp --dport 7777 -m comment --comment "Erlaube: DNS" -j ACCEPT
iptables -A SERVICES -p tcp -m tcp --dport **** -m comment --comment "Erlaube: SSH-Zugriff" -j ACCEPT
iptables -A SERVICES -j RETURN


iptables -A INPUT -i lo -m comment --comment "Erlaube: Loopback" -j ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -m comment --comment "Erlaube: Related und Established Verbindungen" -j ACCEPT
iptables -A INPUT -m comment --comment "Erlaube Standard Dienste" -j SERVICES
iptables -A INPUT -m comment --comment "Ignoriere alles andere" -j DENY
iptables -P INPUT DROP


iptables -N PORTSCAN
iptables -A PORTSCAN -j LOG --log-prefix "PORTSCAN detected -- "
iptables -A PORTSCAN -j DROP
iptables -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -j PORTSCAN
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN,RST -j PORTSCAN
iptables -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN -j PORTSCAN
iptables -A FORWARD -p tcp --tcp-flags SYN,FIN SYN,FIN -j PORTSCAN
iptables -A INPUT -p tcp --tcp-flags ALL FIN,URG,PSH -j PORTSCAN
iptables -A FORWARD -p tcp --tcp-flags ALL FIN,URG,PSH -j PORTSCAN
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j PORTSCAN
iptables -A FORWARD -p tcp --tcp-flags ALL ALL -j PORTSCAN
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j PORTSCAN
iptables -A FORWARD -p tcp --tcp-flags ALL NONE -j PORTSCAN
iptables -A INPUT -p tcp --tcp-flags ALL FIN -j PORTSCAN
iptables -A FORWARD -p tcp --tcp-flags ALL FIN -j PORTSCAN
iptables -A INPUT -p tcp --tcp-flags ALL URG,ACK,PSH,RST,SYN,FIN \
-j PORTSCAN
iptables -A FORWARD -p tcp --tcp-flags ALL URG,ACK,PSH,RST,SYN,FIN \
-j PORTSCAN

iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
iptables -A INPUT -f -j DROP
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP


so meine frage da das game auf UDP läuft. Wollte ich diese ein wenig absichern.
Einer hat dazu ein Screen veröffentlich wo das spiel gegen sowas absichert. nur ich kann damit nichts anfagen. evt kann mir da einer weiter helfen.

[Link: Registrierung erforderlich]

zu weiteren gibt es die möglichekeit einfach per ip tables alles was über z.b 60bytes Pakete ip kommt zu dropen?

Ich danke für eure aufmerksamkeit. (hoster habe ich bereits darauf angeschrieben)

Hallo iTweek,
bei welchem Hoster bist du denn?

Gruß
Blacki
bei myloc habe den von mein freund übernommen.
Ich habe mit myloc noch keine Erfahrung und weiß daher leider auch nicht ob diese Server eine DDOS Protection besitzen

Gruß
Blacki
Die haben alle eine ddos schutz nur wie stark oder infos darüber keine ahnung. Geben nichts raus dies bezüglich
Wichtig wäre zu wissen welche Art von DOS deinen Server zum laggen bringt.

Mach mal ein TCPDUMP das nächste mal, wenn gedosed wird und werte das mal aus.
Anhand dessen kannst du dann deine Regeln anpassen/verfeinern.

Es scheint sich wahrscheinlich um bestimmte Pakete zu handeln, die den Server zum Absturz bringen.

Bspw. wird ein bestimmtes Paket an den Server gesendet, damit dieser einen Slot reserviert, 100 Pakete davon un alle Slots wären reserviert.

Ich schätze du bist hier im Forum des Spieleherstellers besser aufgehoben, wahrscheinlich gibt es dort detaillierte Anleitungen, welche Pakete man Filtern sollte.
Referenz-URLs