View Single Post
misdocumeno
Junior Member
Join Date: Jan 2019
Old 01-23-2020 , 17:50   Re: [Linux] [PoC] DDoS Protection - Kernel redirection!
Reply With Quote #53

i dont know almost anything about linux, i only use it for game servers, so its being a hell to install this for me, and i have a lot of questions

first of all, i dont fully understand how it works, it detects possible DoS attacks and redirects them to a proxy before they can reach the srcds, so it doesnt get overloaded? the proxy would be like some kind of "trash can" of unwanted requests/packets/whatever? then i have to install SourceQueryCacheMono to be the trash can? how do i install it?

i tried to install it on ubuntu 18.04. kernel version 5.0.0-1028-gcp (i dont know if you need more info, ask for it if you need it):

i used "sudo apt-get install linux-headers-5.0.0-1028-gcp" and i got this (i guess its okay?)

Quote:
linux-headers-5.0.0-1028-gcp is already the newest version (5.0.0-1028.29~18.04.1).
The following packages were automatically installed and are no longer required:
grub-pc-bin libnuma1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
then "sudo apt-get install gcc -y && sudo apt-get install make -y", i went to the poc folder, and "make", i got this
Quote:
make -C /lib/modules/`uname -r`/build M=$PWD modules
make[1]: Entering directory '/usr/src/linux-headers-5.0.0-1028-gcp'
CC [M] /home/brasil-dos-test/poc/poc.o
/home/brasil-dos-test/poc/poc.c: In function ‘init_module’:
/home/brasil-dos-test/poc/poc.c:200:2: error: implicit declaration of function ‘nf_register_hook’; did you mean ‘nf_register_net_hook’? [-Werror=implicit-function-declaration]
nf_register_hook(&pre_hook);
^~~~~~~~~~~~~~~~
nf_register_net_hook
/home/brasil-dos-test/poc/poc.c: In function ‘cleanup_module’:
/home/brasil-dos-test/poc/poc.c:215:2: error: implicit declaration of function ‘nf_unregister_hook’; did you mean ‘nf_unregister_net_hook’? [-Werror=implicit-function-declaration]
nf_unregister_hook(&pre_hook);
^~~~~~~~~~~~~~~~~~
nf_unregister_net_hook
cc1: some warnings being treated as errors
scripts/Makefile.build:291: recipe for target '/home/brasil-dos-test/poc/poc.o' failed
make[2]: *** [/home/brasil-dos-test/poc/poc.o] Error 1
Makefile:1614: recipe for target '_module_/home/brasil-dos-test/poc' failed
make[1]: *** [_module_/home/brasil-dos-test/poc] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.0.0-1028-gcp'
Makefile:8: recipe for target 'default' failed
make: *** [default] Error 2
so, as i got an error, i went to your github repository and i did what you say there
Quote:
sudo apt install dkms
sudo cp -R ./src /usr/src/sqproxy_redirect-1.0

Creating symlink /var/lib/dkms/sqproxy_redirect/1.0/source ->
/usr/src/sqproxy_redirect-1.0

DKMS: add completed.

sudo dkms add -m sqproxy_redirect -v 1.0

Kernel preparation unnecessary for this kernel. Skipping...

Building module:
cleaning build area...
make -j1 KERNELRELEASE=5.0.0-1028-gcp...
Signing module:
Generating a new Secure Boot signing key:
Can't load /var/lib/shim-signed/mok/.rnd into RNG
140251086410176:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:88:Filename=/var/lib/shim-signed/mok/.rnd
Generating a RSA private key
.+++++
............................................. ..............+++++
writing new private key to '/var/lib/shim-signed/mok/MOK.priv'
-----
- /var/lib/dkms/sqproxy_redirect/1.0/5.0.0-1028-gcp/x86_64/module/sqproxy_redirect.ko
EFI variables are not supported on this system
/sys/firmware/efi/efivars not found, aborting.
cleaning build area...

DKMS: build completed.

sudo dkms install -m sqproxy_redirect -v 1.0

sqproxy_redirect:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.0.0-1028-gcp/updates/dkms/

depmod...

DKMS: install completed.
but then i dont know what else to do, i dont know how to test it, i dont know if installing it with DKMS builds poc.ko too, if so, i dont know where is it, i dont know if it has to be loaded manually, basically im stuck

Last edited by misdocumeno; 01-23-2020 at 17:52.
misdocumeno is offline