Raised This Month: $319 Target: $400
 79%   Almost there!

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


Post New Thread Reply   
 
Thread Tools Display Modes
c2qute
Junior Member
Join Date: Dec 2008
Old 04-02-2021 , 19:38   Re: [Linux] Source Query Proxy: DDoS Protection - Kernel redirection!
Reply With Quote #111

Quote:
Originally Posted by spumer View Post
Looks like you place config in /root/conf.d and run sqproxy from this directory too.

You should use other working directory, cause sqproxy search configs in /etc/sqproxy/conf.d and ./conf.d directories.

I recommend use /etc/sqproxy/conf.d for configs, then you can run sqproxy from anywhere
Ok apparently its my yml having the wrong extension. I managed to fix it then using ln -s for /etc/sqproxy/conf.d/ to my /root/conf.d

Now I'm getting this:

Code:
Traceback (most recent call last):
  File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pid/base.py", line 198, in create
    self._flock(self.fh.fileno())
  File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pid/posix.py", line 22, in _flock
    fcntl.flock(self.fh.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
BlockingIOError: [Errno 11] Resource temporarily unavailable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.pyenv/versions/3.8.3/bin/sqproxy", line 10, in <module>
    sys.exit(sqproxy())
  File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/source_query_proxy/cli.py", line 14, in run
    run()
  File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pid/decorator.py", line 13, in decorator
    with PidFile(*pid_args, **pid_kwargs):
  File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pid/base.py", line 239, in __enter__
    self.create()
  File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pid/base.py", line 202, in create
    raise PidFileAlreadyLockedError(exc)
pid.base.PidFileAlreadyLockedError: [Errno 11] Resource temporarily unavailable
c2qute is offline
smast
AlliedModders Donor
Join Date: Aug 2012
Old 05-30-2021 , 16:57   Re: [Linux] Source Query Proxy: DDoS Protection - Kernel redirection!
Reply With Quote #112

Anyone had the following message before? I did not find it in the thread.

Code:
Broken data was received
Game is CSS.

Server does not appear in the browser, but I get this error message when I do a manual join via Console, so a connection is not possible.
smast is offline
spumer
Senior Member
Join Date: Aug 2011
Old 05-31-2021 , 03:37   Re: [Linux] Source Query Proxy: DDoS Protection - Kernel redirection!
Reply With Quote #113

Quote:
Originally Posted by smast View Post
Anyone had the following message before? I did not find it in the thread.

Code:
Broken data was received
Game is CSS.

Server does not appear in the browser, but I get this error message when I do a manual join via Console, so a connection is not possible.
This message appear when sqproxy got unexpected message. Unexpected bytes printed in console. Can you post full messsage here?
__________________
spumer is offline
smast
AlliedModders Donor
Join Date: Aug 2012
Old 05-31-2021 , 08:10   Re: [Linux] Source Query Proxy: DDoS Protection - Kernel redirection!
Reply With Quote #114

Quote:
Originally Posted by spumer View Post
Unexpected bytes printed in console. Can you post full messsage here?
Code:
2021-05-31 14:07:00,132 [INFO] [main] Attach eBPF program to interface ...
2021-05-31 14:07:00,132 [DEBUG] [main] Setup incoming hook (2) (b'incoming')
2021-05-31 14:07:00,209 [DEBUG] [main] Setup outgoing hook (2) (b'outgoing')
2021-05-31 14:07:00,218 [INFO] [main] Running ...
2021-05-31 14:09:05,990 [WARNING] [assault] Broken data was received: data[:150]=b'\xff\xff\xff\xffq\x07\xb6B\x020000000000\x00'
2021-05-31 14:09:13,788 [WARNING] [assault] Broken data was received: data[:150]=b'\xff\xff\xff\xffq\xdd\xed\x01\x080000000000\x00'
2021-05-31 14:09:18,917 [WARNING] [assault] Broken data was received: data[:150]=b'\xff\xff\xff\xffq\xaf\xd3\xb2\x0b0000000000\x00'
2021-05-31 14:09:21,620 [WARNING] [assault] Broken data was received: data[:150]=b'\xff\xff\xff\xffq\xd4\x0c\x1f\x020000000000\x00'
smast is offline
spumer
Senior Member
Join Date: Aug 2011
Old 06-03-2021 , 03:24   Re: [Linux] Source Query Proxy: DDoS Protection - Kernel redirection!
Reply With Quote #115

> Server does not appear in the browser, but I get this error message when I do a manual join via Console, so a connection is not possible.

I guess you try to connect to the sqproxy port instead game port?

You should use standard game port for connection purposes
__________________

Last edited by spumer; 06-03-2021 at 03:25.
spumer is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 06-18-2021 , 18:26   Re: [Linux] Source Query Proxy: DDoS Protection - Kernel redirection!
Reply With Quote #116

Updated (by uninstalling older and installing newer version) to the last version and now i can't manage to "hold" sqproxy in the background. Used this before and it was working fine:
Code:
nohup sqproxy run &
but now it is working until i close current terminal/session. After disconnecting sqproxy just disappears (commands like pgrep, ps aux etc. don't print PID) and server becomes "invisible" (which doesn't happen if you terminate sqproxy with Ctrl-C).
errors.log:
Code:
2021-06-18 20:49:06,026 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code 1
NoneType: None
2021-06-18 20:49:37,369 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code 1
NoneType: None
2021-06-18 20:51:57,145 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code 1
NoneType: None
2021-06-18 20:52:40,913 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code 1
NoneType: None
2021-06-18 20:58:29,929 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code 1
NoneType: None
2021-06-18 21:02:16,268 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code None
NoneType: None
2021-06-18 21:12:14,225 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code -1
NoneType: None
2021-06-18 21:18:21,153 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code -1
NoneType: None
2021-06-18 21:24:33,577 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code -1
NoneType: None
2021-06-18 21:43:31,935 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code 1
NoneType: None
2021-06-18 21:44:37,730 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code -1
NoneType: None
2021-06-18 21:45:36,289 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code -1
NoneType: None
2021-06-19 00:21:36,561 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code 1
NoneType: None
2021-06-19 01:11:19,651 [ERROR] [source_query_proxy.epbf] eBPF redirection exit with code -1
NoneType: None
Prints code -1 when sqproxy closes itself (after disconnecting from session).

Also found out that python -c 'import bcc; print(bcc.__version__);' throws this error:
Code:
AttributeError: 'module' object has no attribute '__version__'
python3.7 -c 'import bcc; print(bcc.__version__);' throws this:
Code:
AttributeError: module 'bcc' has no attribute '__version__'
__________________

Last edited by MAGNAT2645; 06-18-2021 at 18:28.
MAGNAT2645 is online now
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 06-18-2021 , 18:57   Re: [Linux] Source Query Proxy: DDoS Protection - Kernel redirection!
Reply With Quote #117

So i managed to hold sqproxy in the background.
1) sqproxy run
2) Ctrl-Z
3) bg
4) disown

But now i don't know how to properly set this sequence in the crontab :/
__________________
MAGNAT2645 is online now
Basblem
New Member
Join Date: Jun 2021
Old 06-21-2021 , 22:52   Re: [Linux] Source Query Proxy: DDoS Protection - Kernel redirection!
Reply With Quote #118

I have this error:
Code:
2021-06-21 22:45:00,138 [WARNING] [pyroute2] Beware of the coming changes in the                                                                                                                                                              project packaging
2021-06-21 22:45:00,138 [WARNING] [pyroute2] https://github.com/svinota/pyroute2                                                                                                                                                             /discussions/786
2021-06-21 22:45:00,147 [INFO] [sqproxy.config] Found config: /etc/sqproxy/conf.                                                                                                                                                             d/00-globals.yaml
2021-06-21 22:45:00,150 [INFO] [sqproxy.config] Found config: /etc/sqproxy/conf.                                                                                                                                                             d/01-dummy-game.yaml
2021-06-21 22:45:00,151 [INFO] [sqproxy.config] Found config: /etc/sqproxy/conf.                                                                                                                                                             d/02-hlds-game.yaml
2021-06-21 22:45:00,153 [INFO] [sqproxy.config] Found config: conf.d/00-globals.                                                                                                                                                             yaml
Traceback (most recent call last):
  File "/usr/local/bin/sqproxy", line 8, in <module>
    sys.exit(sqproxy())
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 829, in __ca                                                                                                                                                             ll__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1259, in inv                                                                                                                                                             oke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1066, in inv                                                                                                                                                             oke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 610, in invo                                                                                                                                                             ke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/source_query_proxy/cli.py", line                                                                                                                                                              14, in run
    run()
  File "/usr/local/lib/python3.7/dist-packages/pid/decorator.py", line 14, in de                                                                                                                                                             corator
    return func(*func_args, **func_kwargs)
  File "/usr/local/lib/python3.7/dist-packages/source_query_proxy/__main__.py",                                                                                                                                                              line 19, in run
    asyncio.run(_run_servers())
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "uvloop/loop.pyx", line 1466, in uvloop.loop.Loop.run_until_complete
  File "/usr/local/lib/python3.7/dist-packages/source_query_proxy/__main__.py",                                                                                                                                                              line 23, in _run_servers
    if not config.servers:
  File "/usr/local/lib/python3.7/dist-packages/source_query_proxy/config.py", li                                                                                                                                                             ne 323, in __getattr__
    return settings.servers
  File "/usr/local/lib/python3.7/dist-packages/cached_property.py", line 36, in                                                                                                                                                              __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/usr/local/lib/python3.7/dist-packages/source_query_proxy/config.py", li                                                                                                                                                             ne 172, in servers
    merged_config_data = self.merged_config_data
  File "/usr/local/lib/python3.7/dist-packages/cached_property.py", line 36, in                                                                                                                                                              __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/usr/local/lib/python3.7/dist-packages/source_query_proxy/config.py", li                                                                                                                                                             ne 161, in merged_config_data
    return load_configs(iter_config_files(self.confdir_0, self.confdir_1))
  File "/usr/local/lib/python3.7/dist-packages/source_query_proxy/config.py", li                                                                                                                                                             ne 265, in load_configs
    raise ConfigurationError('eBPF already configured')
source_query_proxy.config.ConfigurationError: eBPF already configured
Basblem is offline
spumer
Senior Member
Join Date: Aug 2011
Old 06-22-2021 , 04:34   Re: [Linux] Source Query Proxy: DDoS Protection - Kernel redirection!
Reply With Quote #119

Quote:
Originally Posted by MAGNAT2645 View Post
So i managed to hold sqproxy in the background.
1) sqproxy run
2) Ctrl-Z
3) bg
4) disown

But now i don't know how to properly set this sequence in the crontab :/
I recommend you use screen. You can add your script to crontab autostart e.g

And i'm release 1.2.1 version, which will fix (i hope)

Quote:
eBPF redirection exit with code 1
NoneType: None
Quote:
Originally Posted by Basblem View Post
I have this error:
Code:
2021-06-21 22:45:00,138 [WARNING] [pyroute2] Beware of the coming changes in the                                                                                                                                                              project packaging
2021-06-21 22:45:00,138 [WARNING] [pyroute2] https://github.com/svinota/pyroute2                                                                                                                                                             /discussions/786
2021-06-21 22:45:00,147 [INFO] [sqproxy.config] Found config: /etc/sqproxy/conf.                                                                                                                                                             d/00-globals.yaml
2021-06-21 22:45:00,150 [INFO] [sqproxy.config] Found config: /etc/sqproxy/conf.                                                                                                                                                             d/01-dummy-game.yaml
2021-06-21 22:45:00,151 [INFO] [sqproxy.config] Found config: /etc/sqproxy/conf.                                                                                                                                                             d/02-hlds-game.yaml
2021-06-21 22:45:00,153 [INFO] [sqproxy.config] Found config: conf.d/00-globals.                                                                                                                                                             yaml
Traceback (most recent call last):
 ....
source_query_proxy.config.ConfigurationError: eBPF already configured
Looks like you run sqproxy from `/etc/sqproxy/` folder. This is why conf.d/00-globals.yaml was found twice and generate this error. Try to run from another folder.

And i will fix it to prevent this situation in future)
__________________
spumer is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 06-22-2021 , 07:22   Re: [Linux] Source Query Proxy: DDoS Protection - Kernel redirection!
Reply With Quote #120

Quote:
Originally Posted by spumer View Post
And i'm release 1.2.1 version, which will fix (i hope)
It seems to work fine again with nohup & (has disconnected and then logged in again, sqproxy didn't disappear). Thanks.
__________________
MAGNAT2645 is online now
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 09:56.


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