-view-php-3a-2f-2ffilter-2fread-3dconvert.base64 Encode-2fresource-3d-2froot-2f.aws-2fcredentials Jun 2026
A typical credentials file looks like this:
The payload php://filter/read=convert.base64-encode/resource=/root/.aws/credentials exploits Local File Inclusion (LFI) to bypass PHP filters and read sensitive AWS credentials, typically located outside the web root [1]. This attack succeeds due to improper user input validation, allowing attackers to access and base64-encode the credentials file for exfiltration [1]. A typical credentials file looks like this: The
// Example usage with AWS SDK require 'vendor/autoload.php'; use Aws\AwsClient; A typical credentials file looks like this: The
The convert.base64-encode filter is used to prevent the PHP engine from executing the target file (if it was a .php file) or to ensure that special characters in the credential file do not break the HTTP response. A typical credentials file looks like this: The