wargio / naxsi

NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

binary compatible error

Rafli277 opened this issue · comments

i still got the error :
[emerg] module "/usr/local/src/nginx-source/objs/ngx_http_naxsi_module.so" version 1022000 instead of 1018000 in /etc/nginx/nginx.conf:5
I think because I'm using nginx 1.18 and naxsi for nginx 1.22 from this command
wget --no-clobber -O nginx.tar.gz "https://nginx.org/download/nginx-1.22.0.tar.gz"

and then i tried this command for installing the 1.18 nginx version
-wget --no-clobber -O nginx.tar.gz "https://nginx.org/download/nginx-1.18.0.tar.gz"
but i still getting this error :
[emerg] 10300#10300: module "/usr/local/src/nginx-source/objs/ngx_http_naxsi_module.so" is not binary compatible in /etc/nginx/nginx.conf:5

can u help me?

Hey, may i ask how you are using naxsi?

  1. Which distro is this for?
  2. Are you trying to build naxsi from sources and use it with the nginx from the distro package?
  1. the distro that i used is virtual box ubuntu 22.04 verison
  2. i used the nginx from the distro package because i already had my web app

just to make sure, do i have to use different ubuntu verison? or using the nginx from the source?

no. the issue is the source for the nginx.
You need to use apt-source to fetch nginx and build it with the same configuration.
you can either use the CI script or follow this:

apt-get source nginx
cd nginx-XXXX
NGINX_BUILD_OPTS=$(nginx -V 2>&1 | grep "configure arguments:" | cut -d ":" -f2- | sed -e "s#/build/nginx-[A-Za-z0-9]*/#./#g" | sed 's/--add-dynamic-module=[A-Za-z0-9\/\._-]*//g')
./configure $NGINX_BUILD_OPTS --add-dynamic-module=../naxsi_src/

sorry to ask again

./configure: error: invalid option "-O2"
i keep getting this error and i dont why. i think my problem is when i /configure it just dont do it corretly. maybe because i saved my file in /usr/local/src?
because i try with new ubuntu that has no nginx in it and i install it with nginx source, when i nginx -V it shows that the nginx wasnt installed. any advice maybe where shoud i installed the nginx source folder? or maybe my configure just wrong? thank u so much for helping me because i used this for my thesis.

yes, you need to install nginx first. apt install nginx

i did install my nginx, and execte the command using echo "./configure $NGINX_BUILD_OPTS --add-dynamic-module=/root/naxsi/naxsi_src/" > tempconfigure.sh but it just show not compatile
this is my result :
user@localhost:~/nginx-1.18.0# nginx -t
nginx: [emerg] module "/etc/nginx/modules/ngx_http_naxsi_module.so" is not binary compatible in /etc/nginx/nginx.conf:5
nginx: configuration file /etc/nginx/nginx.conf test failed

user@localhost:~/nginx-1.18.0# nginx -V
nginx version: nginx/1.18.0 (Ubuntu)
built with OpenSSL 1.1.1f 31 Mar 2020
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-lUTckl/nginx-1.18.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-compat --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module

with configure you don't build it, you need to then run make

thank u very much its working! 👍