Raised This Month: $12 Target: $400
 3% 

[Linux] Source Query Proxy: DDoS Protection - Kernel redirection!


Post New Thread Reply   
 
Thread Tools Display Modes
spumer
Senior Member
Join Date: Aug 2011
Old 10-08-2018 , 02:43   Re: [Linux] [PoC] DDoS Protection - Kernel redirection!
Reply With Quote #31

Today i was publish kernel-module on github:
https://github.com/spumer/source-que...-kernel-module

And Python back-end:
https://github.com/spumer/source-query-proxy

Documentation will be upgraded too.
---

Support of 4.13 will be soon. Sorry for that.
__________________

Last edited by spumer; 10-08-2018 at 02:44.
spumer is offline
spumer
Senior Member
Join Date: Aug 2011
Old 10-20-2018 , 09:50   Re: [Linux] [PoC] DDoS Protection - Kernel redirection!
Reply With Quote #32

Support of 4.13 and above added:
https://github.com/spumer/source-que...kernel-module/

Try it now!
__________________

Last edited by spumer; 10-20-2018 at 09:53.
spumer is offline
DeepLearning
Junior Member
Join Date: Dec 2017
Old 10-23-2018 , 07:18   Re: [Linux] [PoC] DDoS Protection - Kernel redirection!
Reply With Quote #33

Much appreciated, spumer! But how to setup and run whole thing for multiple instances?

Last edited by DeepLearning; 10-23-2018 at 07:18.
DeepLearning is offline
spumer
Senior Member
Join Date: Aug 2011
Old 10-24-2018 , 04:20   Re: [Linux] [PoC] DDoS Protection - Kernel redirection!
Reply With Quote #34

Quote:
Originally Posted by DeepLearning View Post
Much appreciated, spumer! But how to setup and run whole thing for multiple instances?
For multiple hosts or multiple game servers on host?
__________________
spumer is offline
hznovich
Junior Member
Join Date: Aug 2013
Old 12-03-2018 , 08:40   Re: [Linux] [PoC] DDoS Protection - Kernel redirection!
Reply With Quote #35

Quote:
Originally Posted by spumer View Post
For multiple hosts or multiple game servers on host?
Multiple game servers on host.
hznovich is offline
spumer
Senior Member
Join Date: Aug 2011
Old 12-04-2018 , 03:23   Re: [Linux] [PoC] DDoS Protection - Kernel redirection!
Reply With Quote #36

I don't have instruction, but will create it soon.

In short you need ensure you have redirection for each server (port) in kernel module
and then ensure you configure backend to handle query packets python backend config example
__________________
spumer is offline
nixonkat
Member
Join Date: Nov 2016
Location: Turkey
Old 03-22-2019 , 18:03   Re: [Linux] [PoC] DDoS Protection - Kernel redirection!
Reply With Quote #37

Block checksum 0 and you´ll be fine.
nixonkat is offline
huwong
Junior Member
Join Date: Mar 2018
Old 07-12-2019 , 05:13   Re: [Linux] [PoC] DDoS Protection - Kernel redirection!
Reply With Quote #38

I have been reporting an error after using this module.

OS:Ubuntu 18.04.2 LTS (4.15.0-54-generic)
Python Version:3.5.7 use pyenv install
Game Server:L4D2
Server port:2333
Proxy port:29150

config.json
Quote:
{
"defaults": {
"server-addr": "192.168.1.83",
"bind-addr": "192.168.1.83",
"default_cache_lifetime": 5
},
"csgo": {
"defaults": {
"server_transport_lifetime": 10
},
"ServerName<27015>":{
"proxy-port":27815,
"server-port":27016
}
},
"common": {
"l4d2":{
"proxy-port":29150,
"server-port":2333
}
}
}
hook.h
Quote:
switch(dst_port)
{
case 2333:
new_dst_port = 29150;
break;
}

switch(src_port)
{
case 29150:
new_src_port = 2333;
break;
}
debug.log
Quote:
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 67, in uvloop.loop.Handle._run
File "uvloop/handles/udp.pyx", line 66, in uvloop.loop.UDPTransport._on_read_ready
File "daemon.py", line 90, in datagram_received
self.receive_callback(self.transport, data, addr)
File "daemon.py", line 305, in on_client_request
data = self.handle_fragments(data)
File "daemon.py", line 189, in handle_fragments
header = source.messages.Header.decode(packet)
File "/home/l4d2/source-query-proxy/source/messages.py", line 33, in wrap
return func(*args, **kw)
File "/home/l4d2/source-query-proxy/source/messages.py", line 469, in decode
values[field.name], buffer = field.decode(buffer, values)
File "/home/l4d2/source-query-proxy/source/messages.py", line 73, in needs_buffer
return func(self, buffer, *args, **kwargs)
File "/home/l4d2/source-query-proxy/source/messages.py", line 170, in decode
struct.unpack(self.format, field_data)[0]), left_overs)
File "/home/l4d2/source-query-proxy/source/messages.py", line 132, in validate
value, self.name))
source.messages.BrokenMessageError: Invalid value (623056409) for field 'split'
2019-07-12 17:03:42,365 ERROR: [asyncio] Exception in callback UDPTransport._on_read_ready
handle: <Handle UDPTransport._on_read_ready>
Traceback (most recent call last):
File "/home/l4d2/source-query-proxy/source/messages.py", line 128, in validate
raise ValueError
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 67, in uvloop.loop.Handle._run
File "uvloop/handles/udp.pyx", line 66, in uvloop.loop.UDPTransport._on_read_ready
File "daemon.py", line 90, in datagram_received
self.receive_callback(self.transport, data, addr)
File "daemon.py", line 305, in on_client_request
data = self.handle_fragments(data)
File "daemon.py", line 189, in handle_fragments
header = source.messages.Header.decode(packet)
File "/home/l4d2/source-query-proxy/source/messages.py", line 33, in wrap
return func(*args, **kw)
File "/home/l4d2/source-query-proxy/source/messages.py", line 469, in decode
values[field.name], buffer = field.decode(buffer, values)
File "/home/l4d2/source-query-proxy/source/messages.py", line 73, in needs_buffer
return func(self, buffer, *args, **kwargs)
File "/home/l4d2/source-query-proxy/source/messages.py", line 170, in decode
struct.unpack(self.format, field_data)[0]), left_overs)
File "/home/l4d2/source-query-proxy/source/messages.py", line 132, in validate
value, self.name))
source.messages.BrokenMessageError: Invalid value (1414856965) for field 'split'
2019-07-12 17:03:43,695 ERROR: [192.168.1.83:27016] Error received
Traceback (most recent call last):
File "daemon.py", line 51, in log_handled_exception
raise exc
File "uvloop/handles/udp.pyx", line 169, in uvloop.loop.UDPTransport.sendto
ConnectionRefusedError: [Errno 111] Connection refused
huwong is offline
spumer
Senior Member
Join Date: Aug 2011
Old 07-13-2019 , 13:21   Re: [Linux] [PoC] DDoS Protection - Kernel redirection!
Reply With Quote #39

Quote:
Originally Posted by huwong View Post
I have been reporting an error after using this module.

OS:Ubuntu 18.04.2 LTS (4.15.0-54-generic)
Python Version.5.7 use pyenv install
Game Server:L4D2
Server port:2333
Proxy port:29150

config.json


hook.h


debug.log
>ConnectionRefusedError: [Errno 111] Connection refused
I recommend you remove from config not existing servers (i mean CSGO ServerName<27015>)

> source.messages.BrokenMessageError: Invalid value (623056409) for field 'split'
Mean unexpected message redirect to daemon. I think it's ok if no other issues occured.
__________________
spumer is offline
djvx
Junior Member
Join Date: Sep 2019
Old 09-27-2019 , 21:30   Re: [Linux] [PoC] DDoS Protection - Kernel redirection!
Reply With Quote #40

Hi,

Is there any guide on how to use this? I've set up the kernel module and the query as outlined in your previous post, but when I used my proxy port on my gameserver, I can't connect or find it, but it works if I connect directly via the server port itself.

I've edited the hooks.h and config.json to match the new ports accordingly.

Do I need to setup port forwarding on the proxy port or both?
djvx is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode