December 02, 2016 12:07PM
Обнаружил уязвимость. Надеюсь не я первый.... и уже есть таблетка.
Команда DELETE (модуля WEBDAV) исполняется мастер-процессом nginx от пользователя root. Так как по умолчанию мастер-процесс стартует от рута для доступа к портам 80 & 443 (0-1024).
root 9100 0.0 0.4 331232 7960 ? Ss 14:06 0:00 nginx: master process /usr/sbin/nginx
nginx 9101 0.1 0.9 388432 18548 ? S 14:06 0:11 nginx: worker process
nginx 9102 0.0 0.8 388164 16620 ? S 14:06 0:07 nginx: worker process
nginx 9103 0.0 0.4 331236 8676 ? S 14:06 0:00 nginx: cache manager process

Это уязвимость предоставляет внешним пользователям удалять в области доступа любые файлы и папки, вне
зависимости от владельца и прав доступа. (включая файлы созданные рутом или иным пользователем.)

Дырка обнаружена на конфигурации:
nginx version: nginx/1.7.11
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-pcre-jit --with-debug --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --add-module=/usr/src/1/nginx-dav-ext-module-master --with-http_flv_module --add-module=/usr/src/1/f4f-hds-master --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-http_auth_request_module --add-module=/usr/src/1/echo-nginx-module-master --add-module=/usr/src/1/nginx_md5_filter-master --add-module=/usr/src/1/ngx_devel_kit-master --add-module=/usr/src/1/lua-nginx-module-master --add-module=/usr/src/1/set-misc-nginx-module-master --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-ld-opt=' -Wl,-E,-rpath,/usr/local/openresty/luajit/lib'

ngx_http_dav_ext_module.c 30.05.2013

Первая мысль которая приходит в голову - это стартовать мастер-процесс nginx, как и воркеры, от пользователя nginx. Но тогда по логике демон потеряет доступ к портам 80 и 443..... или не потеряет?
Уважаемые подскажите плизззз! как дырку правильно запаять!
Subject Author Posted

HACK NGINX+DAV

itcod December 02, 2016 12:07PM

Re: HACK NGINX+DAV

itcod December 02, 2016 12:23PM

Re: HACK NGINX+DAV

Maxim Dounin December 02, 2016 01:12PM

Re: HACK NGINX+DAV

itcod December 02, 2016 01:48PM

Re: HACK NGINX+DAV

Dmitry Ivanov December 02, 2016 03:34PM

Re: HACK NGINX+DAV

itcod December 03, 2016 05:03AM

Re: HACK NGINX+DAV

Vitaliy Okulov December 03, 2016 05:16AM

Re: HACK NGINX+DAV

itcod December 03, 2016 05:35AM

Re: HACK NGINX+DAV

Denis Kot December 03, 2016 07:54AM

Re: HACK NGINX+DAV

itcod December 03, 2016 09:41AM

Re: HACK NGINX+DAV

Vitaliy Okulov December 03, 2016 09:08AM

Re: HACK NGINX+DAV

itcod December 03, 2016 10:20AM

Re: HACK NGINX+DAV

Vitaliy Okulov December 03, 2016 02:22PM

[offtop] was: HACK NGINX+DAV

Anton Yuzhaninov December 03, 2016 12:44PM

Re: HACK NGINX+DAV

Konstantin Baryshnikov December 03, 2016 06:38PM

Re: HACK NGINX+DAV

itcod December 04, 2016 02:24AM

Re: HACK NGINX+DAV

Илья Шипицин December 04, 2016 07:44AM

Re: HACK NGINX+DAV

itcod December 04, 2016 02:08AM

Re: HACK NGINX+DAV

Maksim Kulik December 04, 2016 02:22AM

Re: HACK NGINX+DAV

itcod December 04, 2016 02:50AM

Re: HACK NGINX+DAV

itcod December 04, 2016 03:26AM

Re: HACK NGINX+DAV

Gena Makhomed December 04, 2016 04:04AM

Re: HACK NGINX+DAV

itcod December 04, 2016 06:45AM

Re: HACK NGINX+DAV

Vadim A. Misbakh-Soloviov December 04, 2016 07:28AM

Re: HACK NGINX+DAV

itcod December 04, 2016 08:22AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 213
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready