Stateful SRCDS firewall

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
Zeus
Member
Posts: 52
Joined: Sat Mar 24, 2018 5:25 pm
Location: Chicago
Contact:

Stateful SRCDS firewall

Postby Zeus » Tue Mar 27, 2018 4:13 am

Hello!

I'd like to make a stateful firewall for my srcds server (Team Fortress 2 specfically). Along side some other things i'm doing with my server's firewall to prevent DoS, one of things I'm unable to do is totally prevent UDP flooding unless I could do some kind of port knocking. To my knowledge; a connection to any source server starts with a valid TCP handshake on the server query port. Since that is the case, it's possible to keep UDP closed unless that TCP handshake was valid, then my firewall (IPTables) can allow that client to join over UDP.

I've seen this repo here:
https://github.com/KirillMysnik/SP-ConnectFilter

I'm not quite sure where to start on doing this, especially when it comes to finding those memory offsets to hook those functions?
Anyone have initial thoughts on this? Thanks! :D
User avatar
Zeus
Member
Posts: 52
Joined: Sat Mar 24, 2018 5:25 pm
Location: Chicago
Contact:

Re: Stateful SRCDS firewall

Postby Zeus » Wed Mar 28, 2018 4:40 am

So i did some testing, it looks like the connection is a direct UDP connect and does not actually do any port knocking.

Code: Select all

$ tcpdump -n -i ens3 "host x.x.x.x and port 27015"

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ens3, link-type EN10MB (Ethernet), capture size 262144 bytes
04:35:23.680806 IP x.x.x.x.46029 > x.x.x.x.27015: UDP, length 20
04:35:29.696099 IP x.x.x.x.46029 > x.x.x.x.27015: UDP, length 20
04:35:35.711757 IP x.x.x.x.46029 > x.x.x.x.27015: UDP, length 20
04:35:41.741033 IP x.x.x.x.46029 > x.x.x.x.27015: UDP, length 20


Looks like it'll retry 4 times then quit. I might look into how src handles this connection to see if this would still be possible
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Stateful SRCDS firewall

Postby Ayuto » Wed Mar 28, 2018 9:40 pm


Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 14 guests