Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   Этичный хакинг или пентестинг (https://forum.antichat.xyz/forumdisplay.php?f=209)
-   -   [ PHP-FPM+Nginx ] Почти .htaccess (https://forum.antichat.xyz/showthread.php?t=460156)

crlf 02.02.2018 15:53

В ходе исследований описанных в этом топике, к своему стыду, только сейчас обнаружил интересную фичу в этой связке:

Код:

Code:
[pid  6514] open("/proc/sys/kernel/ngroups_max", O_RDONLY) = 5
[pid  6514] open("/etc/group", O_RDONLY|O_CLOEXEC) = 5
[pid  6513] lstat("/home/www/1/2/3/4/5/6/index.php", {st_mode=S_IFREG|0755, st_size=28, ...}) = 0
[pid  6513] lstat("/home/www/1/2/3/4/5/6", {st_mode=S_IFDIR|0775, st_size=100, ...}) = 0
[pid  6513] lstat("/home/www/1/2/3/4/5", {st_mode=S_IFDIR|0775, st_size=60, ...}) = 0
[pid  6513] lstat("/home/www/1/2/3/4", {st_mode=S_IFDIR|0775, st_size=60, ...}) = 0
[pid  6513] lstat("/home/www/1/2/3", {st_mode=S_IFDIR|0775, st_size=60, ...}) = 0
[pid  6513] lstat("/home/www/1/2", {st_mode=S_IFDIR|0775, st_size=60, ...}) = 0
[pid  6513] lstat("/home/www/1", {st_mode=S_IFDIR|0775, st_size=60, ...}) = 0
[pid  6513] lstat("/home/www", {st_mode=S_IFDIR|0777, st_size=360, ...}) = 0
[pid  6513] lstat("/home", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4220, ...}) = 0
[pid  6513] stat("/home/www/.user.ini", 0x7ffcc2015030) = -1 ENOENT (No such file or directory)
[pid  6513] stat("/home/www/1/.user.ini", 0x7ffcc2015030) = -1 ENOENT (No such file or directory)
[pid  6513] stat("/home/www/1/2/.user.ini", 0x7ffcc2015030) = -1 ENOENT (No such file or directory)
[pid  6513] stat("/home/www/1/2/3/.user.ini", 0x7ffcc2015030) = -1 ENOENT (No such file or directory)
[pid  6513] stat("/home/www/1/2/3/4/.user.ini", 0x7ffcc2015030) = -1 ENOENT (No such file or directory)
[pid  6513] stat("/home/www/1/2/3/4/5/.user.ini", 0x7ffcc2015030) = -1 ENOENT (No such file or directory)
[pid  6513] stat("/home/www/1/2/3/4/5/6/.user.ini", {st_mode=S_IFREG|0755, st_size=26, ...}) = 0
[pid  6513] open("/home/www/1/2/3/4/5/6/.user.ini", O_RDONLY) = 6
[pid  6513] open("/home/www/1/2/3/4/5/6/index.php", O_RDONLY) = 6

Какой такой .user.ini? Шиндоус тебя покусал...

А вот какой:

Цитата:

Сообщение от php.net
php.net said:
Since PHP 5.3.0, PHP includes support for configuration INI files on a per-directory basis. These files are processed
only
by the CGI/FastCGI SAPI. This functionality obsoletes the PECL htscanner extension. If you are running PHP as Apache module, use .htaccess files for the same effect.
In addition to the main php.ini file, PHP scans for INI files in each directory, starting with the directory of the requested PHP file, and working its way up to the current document root (as set in
$_SERVER['DOCUMENT_ROOT']
). In case the PHP file is outside the document root, only its directory is scanned.
...

Что это даёт? Честно сказать, в уме, применение смоделировать удалось только одно.

Допустим, приложение фильтрует загрузки по чёрному списку, супер-пупер регулярка, которая не пускает php и любые другие производные типа phtml и pht. А остальные расширения прогружаются, тогда, при наличии пустого индексного пхп файла:

[PHP]
PHP:
[COLOR="#000000"][COLOR="#007700"]

t0ma5 03.02.2018 02:00

в отдельную бы статью оформить и про то как php связан с остальными парнями(apache->mod_php,cgi,fastcgi,fpm), было бы очень круто


Время: 00:42