PHP - Bypass using filters
Last updated
Was this helpful?
Last updated
Was this helpful?
PHP filters can sometimes be exploited to read the source code of a PHP file if the server is misconfigured and allows or direct access to PHP stream wrappers. This occurs when the allow_url_include and allow_url_fopen parameters are enabled on the php.ini file.
LFI on PHP files usually wonβt display the source code, because when included, the PHP interpreter executes the file instead of showing its contents, but using the PHP filters we can have access to the source code instead of executing the file.
Here we found how this can be exploited:
Use payload to retrieve the source code of a PHP file
If direct file access via php://filter is blocked, we can use it indirectly in a confirmed LFI point