Using only 7 different characters to write and execute php.
Only support PHP 7+ currently.
The following source will execute system('id');
:
<?php
(((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[]).[])[([]^[])]^(([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[]).[])[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]).((([].[]))[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[]).[])[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])]^(([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([].[]))[([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[]).[])[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[]).[])[([]^[])]^(([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[]).[])[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]))([].[]^[].[],((([].[]))[([]^[])]^(([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])]).((([].[]))[([]^[])]^(([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[]).[])[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([].[]))[([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[]).[])[([]^[])]).((([].[]))[([]^[[]])]^(([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[]).[])[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[]).[])[([]^[])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])]^(([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])+([]^[[]])+([]^[[]])]^(([].[]))[([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[[]]).[])[([]^[])]).((([].[]))[([]^[[]])]^(([].[]))[([]^[[]])+([]^[[]])+([]^[[]])+([]^[[]])]^(([]^[]).[])[([]^[])]))();
?>
usage: phpfuck.py [-h] [-O FILE] [-P] code
positional arguments:
code any php code to encode.
optional arguments:
-h, --help show this help message and exit
-O FILE, --output-file FILE
write encoded code into some file.
-P, --plain-string encode as plain string (without eval it).
You can just use it like this: python3 phpfuck.py "system('id');"