MEWBIES@: Facebook Twitter G+ YouTube DeviantArt Forum Wall
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ██
█▌ - IONCUBE & ZEND ENCODED PHP FILES - █▌
█▌ █▌
█ ▐▌
█ ionCube and Zend Guard (Zend Encoder) are programs to encode PHP files so ▐▌
█ they aren't human readable. If you want to run PHP files that have been ▐▌
█ encoded using either you need to install the decoder 'Zend Optimizer' or ▐▌
█ now called 'Zend Guard' or the decoder IonCube Loader, so that a browser ▐▌
█ can load the encrypted PHP files correctly. ▐▌
█ ▐▌
█ This tutorial is for Linux, Mac and Windows Xampp. ▐▌
█ NOTES: When installing add-ons to Apache and PHP it's better to do it ▐▌
█ manually as some of the included installers/scripts will remove custom ▐▌
█ settings. If upgrading Apache and or PHP via package manager such as ▐▌
█ aptitude or agtget to prevent your own settings being overwritten always ▐▌
█ select the option to keep 'local configuration files' then you can edit ▐▌
█ in, if needed, changes manually. ▐▌
█ ▐▌
█ If you aren't familiar with command lines ending with: \ Read HERE: ▐▌
█ Do NOT add a space at the end of the \ or the cmd won't work. ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ ZEND ENCODED FILES ▐▌
█ ZEND ERRORS ▐▌
█ ▐▌
█ IONCUBE ENCODED FILES ▐▌
█ IONCUBE ERRORS ▐▌
█ ▐▌
█ DECRYPT ZEND OR IONCUBE ENCODED FILES - WINDOWS ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ ZEND ENCODED FILES: ▐▌
█ ``````````````````` ▐▌
█ PREREQUISITES: ▐▌
█ PHP 4.0.5 or higher ▐▌
█ Zend Optimizer ▐▌
█ Root / admin access to install Zend Optimizer ▐▌
█ ▐▌
█ INSTALL ZEND OPTIMIZER: ▐▌
█ 1. Use 'phpinfo()' to verify your version of PHP and if 'Zend Optimizer' ▐▌
█ is already available on your server. PHP version will be listed at the ▐▌
█ top. If you have PHP v4.0.5 - v5.2 search for 'Zend Optimizer'. PHP ▐▌
█ v5.3 + search for 'Zend Guard Loader': (Optimizer is for PHP 5.2 and ▐▌
█ earlier. Guard Loader is for PHP v5.3+) ▐▌
Or if PHP v4 - 5.2 :
█ ▐▌
█ Or if you are doing this in your shell you could, but won't be as detailed ▐▌
█ nor help if you are having problems with it: ▐▌
█ php -v ▐▌
█ My output on Debian: ▐▌
█ PHP 5.3.3-7+squeeze15 with Suhosin-Patch (cli)(built: Mar 4 2013 14:05:25)▐▌
█ Copyright (c) 1997-2009 The PHP Group ▐▌
█ Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies ▐▌
█ with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH ▐▌
█ ▐▌
█ 2. If it is listed but not working, continue to verify the install and ▐▌
█ version is correct. ▐▌
█ ▐▌
█ If 'Zend Optimizer' or 'Zend Guard Loader' isn't listed then: ▐▌
█ a. Check their site for the latest and correct version for your OS ▐▌
█ HERE*; click the tab for your OS. ▐▌
█ *They require you to register to download the files so: ▐▌
█ You can use bogus registration info; no need to confirm the e-mail ▐▌
█ Or ▐▌
█ HERE is a list of the direct download links. ▐▌
█ ▐▌
█ 3. If doing this on your shell, edit to match your download, for example: ▐▌
█ wget http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz
█ tar xvzf ZendGuardLoader-php-5.3-linux-glibc23-i386.tar.gz ▐▌
█ su ▐▌
█ ls /usr/local/lib/ ▐▌
█ If you don't have a Zend directory make one: ▐▌
█ mkdir /usr/local/lib/Zend ▐▌
cp ZendGuardLoader-php-5.3-linux-glibc23-i386/php-5.3.x/ZendGuardLoader.so \
/usr/local/lib/Zend/ZendGuardLoader.so
█ Or if you are still using PHP 5.2 and ealier: ▐▌
cp ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so \
/usr/local/lib/Zend/ZendOptimizer.so
█ ▐▌
█ If you aren't working in the shell the above just means download the ▐▌
█ file, extract the contents then copy 'ZendGuardLoader.so', or Windows is ▐▌
█ 'ZendExtensionManager.dll', to the location you require for the Zend ▐▌
█ files. ▐▌
█ Windows Xampp users: xampp\php\zendOptimizer\lib\ZendExtensionManager.dll ▐▌
█ ▐▌
█ Edit your php.ini to reflect the path of the file and save the changes: ▐▌
█ pico /etc/php5/apache2/php.ini ▐▌
█ Windows Xampp it is here: xampp\php\php.ini ▐▌
█ Linux and Mac PHP v5.2 and ealier - ▐▌
█ At the top of the file after '[PHP]' add this: ▐▌
█ zend_extension=/usr/local/lib/Zend/ZendOptimizer.so ▐▌
█ ▐▌
█ Linux and Mac PHP v5.3+: ▐▌
█ zend_extension=/usr/local/lib/Zend/ZendGuardLoader.so ▐▌
█ ▐▌
█ Either version of PHP also add these lines: ▐▌
█ zend_optimizer.optimization_level=15 ▐▌
█ zend_loader.enable=1 ▐▌
█ zend_loader.disable_licensing=0 ▐▌
█ zend_loader.obfuscation_level_support=3 ▐▌
█ ▐▌
█ Windows Xampp users search for '[Zend]' about line 1262: ▐▌
█ [Zend] ▐▌
█ zend_extension_ts = "D:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll"
█ zend_extension_manager.optimizer_ts = "D:\xampp\php\zendOptimizer\lib\Optimizer"
█ zend_optimizer.enable_loader = 1 ▐▌
█ zend_optimizer.optimization_level=15 ▐▌
█ ▐▌
█ Note: 'zend_optimizer.enable_loader = 1' 1 is to enable the loader. ▐▌
█ ▐▌
█ Or if you are still using PHP 5.2 and ealier: ▐▌
cp ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so \
/usr/local/lib/Zend/ZendOptimizer.so
█ pico /etc/php5/apache2/php.ini ▐▌
█ Add these two lines at the top: ▐▌
█ [PHP] ▐▌
█ zend_extension=/usr/local/lib/Zend/ZendOptimizer.so ▐▌
█ zend_optimizer.optimization_level=15 ▐▌
█ ▐▌
█ If using PHP v4.x then search search for: ▐▌
█ ;Enable compatibility mode with Zend Engine 1 (PHP 4.x) ▐▌
█ zend.ze1_compatibility_mode = Off ▐▌
█ ▐▌
█ Change Off to On to enable it. ▐▌
█ ▐▌
█ 5. Restart your apache server ▐▌
█ /etc/init.d/apache2 restart ▐▌
█ ▐▌
█ View your phpnfo.php again, if all worked where it has: ▐▌
█ This program makes use of the Zend Scripting Language Engine: ▐▌
█ Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies ▐▌
█ ▐▌
█ It will now have below that: ▐▌
█ with Zend Optimizer v3.3, Copyright (c) 1998-2010, by Zend Technologies ▐▌
█ ▐▌
█ And it will now have a new column heading (lower down) 'Zend Optimizer' or ▐▌
█ 'Zend Guard Loader' as in the images above. If it's there, you are done :) ▐▌
█ ▐▌
█ Once you are finished don't forget to delete your test phpinfo() page. ▐▌
█ Log out of root: ▐▌
█ exit ▐▌
█ Clean up: ▐▌
█ rm ZendOptimizer-3.3.9-linux-glibc23-i386 -rf ▐▌
█ ▐▌
█ ZEND ERRORS: ▐▌
█ This error will happen after an upgrade of your PHP. It means that you ▐▌
█ need to upgrade Zend Optimizer/Guard Loader to a compatible version of ▐▌
█ your PHP: ▐▌
█ Cron <root@yourdomain> [ -x /usr/lib/php5/maxlifetime ] && ▐▌
█ [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin ▐▌
█ +$(/usr/lib/php5/maxlifetime) -delete ▐▌
█ Zend Optimizer requires Zend Engine API version 220060519. ▐▌
█ The Zend Engine API version 220090626 which is installed, is newer. ▐▌
█ Contact Zend Technologies at http://www.zend.com/ for a later version of ▐▌
█ Zend Optimizer. ▐▌
█ Or the error will state Loader: ▐▌
█ Zend Guard Loader requires Zend Engine API version 220090626. ▐▌
█ The Zend Engine API version 220100525 which is installed, is newer. ▐▌
█ It will also be stated repeatedly in your logs: ▐▌
█ tail -50 /var/log/apache2/error.log ▐▌
█ ▐▌
█ Just do as above when you first installed it, for example: ▐▌
█ PHP version: php -v ▐▌
█ Output: PHP 5.4.4-14+deb7u5 [snip] ▐▌
█ Go to their site as stated above, download correct version for your php. ▐▌
█ wget http://downloads.zend.com/guard/6.0.0/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz
█ tar xvzf ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386.tar.gz ▐▌
█ su ▐▌
█ ls -al /usr/local/lib/Zend ▐▌
█ mv /usr/local/lib/Zend/ZendGuardLoader.so /usr/local/lib/Zend/ZendGuardLoader.so-old
█ cd /ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386/cd php-5.4.x ▐▌
█ cp ZendGuardLoader.so /usr/local/lib/Zend/ZendGuardLoader.so ▐▌
█ /etc/init.d/apache2 restart ▐▌
█ tail -50 /var/log/apache2/error.log ▐▌
█ View your phpnfo.php again to view it as demonstrated in the above images. ▐▌
█ exit ▐▌
█ Clean up: ▐▌
█ cd ~ && rm ZendGuardLoader-70429-PHP-5.4-linux-glibc23-i386 -rf ▐▌
█ ▐▌
█ Tip: To view all extensions PHP is listed to load: ▐▌
█ grep -Hrv ";" /etc/php5 | grep -i "extension=" ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ IONCUBE ENCODED FILES: ▐▌
█ `````````````````````` ▐▌
█ PREREQUISITES: ▐▌
█ PHP 4.0.5 or higher ▐▌
█ ionCube Loader ▐▌
█ Root / admin access to install ionCube Loader ▐▌
█ ▐▌
█ INSTALL IONCUBE LOADER: ▐▌
█ 1. Use 'phpinfo()' to verify your version of PHP and if 'ionCube' is ▐▌
█ already available on your server. PHP version will be listed at the top:▐▌
█ ▐▌
█ 2. Check ioncube.com for the latest and correct version for your OS HERE. ▐▌
█ If doing this for Windows "Non-TS' means Thread Safety is disabled. To ▐▌
█ know if you require TS or Non-Ts view on your phpinfo page under ▐▌
█ "Thread Safety". It will state either enabled or disabled. ▐▌
█ ▐▌
█ If doing this on your shell, edit to match your download, for example: ▐▌
█ wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
█ tar xvfz ioncube_loaders_lin_x86.tar.gz ▐▌
█ su ▐▌
█ mkdir /usr/local/lib/ioncube ▐▌
█ Depending on what version is your PHP will be what version of the loader ▐▌
█ you will use. List the files in ioncube directory: ▐▌
█ ls ioncube ▐▌
█ ▐▌
█ So for example if you have PHP 5.3.3 you would use ▐▌
█ ioncube_loader_lin_5.3.so. Windows: ioncube_loader_win_5.3.dll ▐▌
█ cp ioncube/ioncube_loader_lin_5.3.so /usr/local/lib/ioncube/ioncube_loader_lin_5.3.so
█ ▐▌
█ If you aren't working in the shell the above just means download the ▐▌
█ file, extract the contents, create the directory 'ioncube' then copy ▐▌
█ 'ioncube_loader_lin_5.3.so', or Windows 'ioncube_loader_win_5.3.dll', to ▐▌
█ the location you required. ▐▌
█ ▐▌
█ Windows Xampp users: xampp\php\ioncbue\ioncube_loader_win_5.3.dll ▐▌
█ ▐▌
█ 3. Edit your php.ini to add the path to your ioncube_loader_*.so: ▐▌
█ pico /etc/php5/apache2/php.ini ▐▌
█ Windows Xampp it is here: xampp\php\php.ini ▐▌
█ ▐▌
█ Linux and Mac PHP: ▐▌
█ Add the line at the beginning of the file after [PHP] and BEFORE any zend ▐▌
█ entries IF you have them (or the server won't load) like this: ▐▌
█ [PHP] ▐▌
█ zend_extension=/usr/local/lib/ioncube/ioncube_loader_lin_5.3.so ▐▌
█ ▐▌
█ Since I have both Zend Optimizer and ionCube, mine is like this: ▐▌
█ [PHP] ▐▌
█ zend_extension=/usr/local/lib/ioncube/ioncube_loader_lin_5.3.so ▐▌
█ zend_extension=/usr/local/lib/Zend/ZendGuardLoader.so ▐▌
█ zend_optimizer.optimization_level=15 ▐▌
█ zend_loader.enable=1 ▐▌
█ zend_loader.disable_licensing=0 ▐▌
█ zend_loader.obfuscation_level_support=3 ▐▌
█ ▐▌
█ Windows Xampp, edit to your correct path, add the line at the beginning ▐▌
█ of the file after [PHP] and BEFORE any zend entries IF you have them (or ▐▌
█ the server won't load), for example: ▐▌
█ [PHP] ▐▌
█ zend_extension = "D:\xampp\php\ioncube\ioncube_loader_win_5.3.dll" ▐▌
█ ▐▌
█ 4. Restart your apache server ▐▌
█ /etc/init.d/apache2 restart ▐▌
█ ▐▌
█ View your phpnfo() again for the entry 'ionCube Loader' as in the image ▐▌
█ above. If it's there, you are done :) ▐▌
█ Don't forget to delete your test phpinfo() page. ▐▌
█ If you are having a problem you can use the included 'loader-wizard.php'; ▐▌
█ copy to website root then open the page in a browser. After delete it: ▐▌
█ ▐▌
█ Log out of root: ▐▌
█ exit ▐▌
█ Clean up: ▐▌
█ rm ioncube -rf ▐▌
█ ▐▌
█ IONCUBE ERRORS: ▐▌
█ This error will happen after an upgrade of your PHP. It means that you ▐▌
█ need to upgrade ionCube to the compatible version of your PHP: ▐▌
█ Cron <root@yourdomain> [ -x /usr/lib/php5/maxlifetime ] && ▐▌
█ [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin ▐▌
█ +$(/usr/lib/php5/maxlifetime) -delete ▐▌
█ Cannot load the ionCube PHP Loader - it was built with configuration ▐▌
█ 2.2.0, whereas running engine is API220090626,NTS ▐▌
█ ▐▌
█ Or in your logs: tail -50 /var/log/apache2/error.log ▐▌
█ It will state: ▐▌
█ Failed loading /usr/local/lib/ioncube/ioncube_loader_lin_5.3.so: ▐▌
█ /usr/local/lib/ioncube/ioncube_loader_lin_5.3.so: undefined symbol: ▐▌
█ php_body_write ▐▌
█ Do the original steps to install it; download correct version for your PHP ▐▌
█ version, extract files, copy ioncube_loader_lin_5.4.so (or which ever one ▐▌
█ is correct version for your php) to the correct location, then edit your ▐▌
█ php.ini to the newer file name: ▐▌
█ pico /etc/php5/apache2/php.ini ▐▌
█ Had this: ▐▌
█ zend_extension=/usr/local/lib/ioncube/ioncube_loader_lin_5.3.so ▐▌
█ Changed to: ▐▌
█ zend_extension=/usr/local/lib/ioncube/ioncube_loader_lin_5.4.so ▐▌
█ ▐▌
█ /etc/init.d/apache2 restart ▐▌
█ View your phpinfo again, it should be on it and no more errors in the log. ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ DECRYPT ZEND OR IONCUBE ENCODED FILES - WINDOWS: ▐▌
█ ```````````````````````````````````````````````` ▐▌
█ If for example you have lost your source code for your own Zend or ▐▌
█ ionCube PHP files, there are a few ways to decrypt them to human readable ▐▌
█ format. Note that all the comments and white spaces will be removed on the ▐▌
█ decrypted file but at least you will be able to recover a large portion of ▐▌
█ you work. ▐▌
█ ▐▌
█ If you don't have a Zend Encoded file but want to try out the below ▐▌
█ methods, I have put one HERE for you to play with. There are also sample ▐▌
█ files included in the dezend.zip below for both PHP 4 & 5. ▐▌
█ ▐▌
█ A) DEZEND: ▐▌
█ 1. For Zend encoded files download Dezend by The Necenzurat, which can be ▐▌
█ found HERE, dezend.zip 8.1MB (06/16/2008). Just in case that link goes ▐▌
█ dead I have put the same file HERE. ▐▌
█ SHA-160: 69579AB812D7A8C0BAFB584FEE5F09777DC63B2D ▐▌
█ MD5: 2EDBD49FC217A0F1D1064D817AB350EA ▐▌
█ ▐▌
█ Unzip dezend.zip to any directory. ▐▌
█ ▐▌
█ 2. Determine if the your php file is PHP 4 or PHP 5 - open it in a text ▐▌
█ editor, such a Notepad: ▐▌
█ If it is PHP 4, at the top it will have similar to: ▐▌
█ <?php ▐▌
█ if (you see some php code) ▐▌
█ If it is PHP 5, at the top it will have similar to: ▐▌
█ <?php @Zend; ▐▌
█ 4244; ▐▌
█ ?> ▐▌
█ Or unreadable code. ▐▌
█ If you aren't sure try both \dezend\dezend 4\ & \dezend\dezend 5\ as ▐▌
█ instructed below. ▐▌
█ ▐▌
█ 3. For this example will say it's PHP 5. Copy your encrypted php file to: ▐▌
█ \dezend\dezend 5\ ▐▌
█ Drag and drop your encrypted php file over php.exe ▐▌
█ Wait a second then you'll now see it created 'testdecrypt.de.php' which is ▐▌
█ the decrypted file. ▐▌
█ ▐▌
█ If it didn't create a decrypted file for you, it might be because it is ▐▌
█ PHP 4. If that is the case then copy your encrypted php file to: ▐▌
█ \dezend\dezend 4\ ▐▌
█ Drag and drop your encrypted php file over php.exe ▐▌
█ ▐▌
█ NOTES: ▐▌
█ 1. Do not make any changes to your php file, including the comments, or ▐▌
█ decrypting will not work. ▐▌
█ ▐▌
█ 2. You can also use dezend via cmd line which is useful to view errors: ▐▌
█ Copy the zend encoded php files you want decrypted to \dezend\dezend 5\ ▐▌
█ Open a cmd prompt window; logo key +r, type in cmd, press OK ▐▌
█ change to the directory you have the dezend php.exe in: ▐▌
█ cd C:\dezend\dezend 5\ ▐▌
█ Then run the cmd, changing testdecrypt.php to the name of your file: ▐▌
█ php.exe testdecrypt.php ▐▌
█ ▐▌
█ If for instance you you try to decrypt a PHP 5 file using \dezend\dezend ▐▌
█ 4\php.exe ▐▌
█ You'll receive an error similar to: ▐▌
█ PHP Fatal error: Incompatible file format: The encoded file has format ▐▌
█ major ID 2, whereas the Optimizer expects 1; The encoded file was ▐▌
█ probably encoded by the Zend Guard for PHP 5 (zendenc5), and therefore ▐▌
█ cannot be run on PHP 4 in C:\dezend\dezend\dezend 4\testdecrypt.php ▐▌
█ .php on line 0 Content-type: text/html X-Powered-By: PHP/4.4.0 ▐▌
█ ▐▌
█ 3. If you have many files to decrypt and don't want to drag and drop; ▐▌
█ write a batch / .bat file for it. ▐▌
█ ▐▌
█ 4. I've read that you need to have Zend Optimizer (which needs a ▐▌
█ Web-Server) installed for this to work- I didn't have either installed and ▐▌
█ it worked just fine :) ▐▌
█ ▐▌
█ B) FREE ON-LINE SERVICE TO DECRYPT A VARIETY OF FILES: ▐▌
█ HERE. Press the browse button, upload your file, type in the captcha code, ▐▌
█ press 'Show My Code'. ▐▌
█ It worked great for my file. ▐▌
█ ▐▌
█ C) PAY FOR THE SERVICE: ▐▌
█ Another last option are sites that you pay for the service to decrypt a ▐▌
█ variety of different encrypted PHP files. I'm not going to list them; ▐▌
█ search Google if you want. ▐▌
█ ▐▌
█ //---------------------------------------------------------------------- ▐▌
█ ▐▌
█ If you find mistakes, have suggestions, and or questions please post at ▐▌
█ mewbies forum HERE - thank you. ▐▌
█ ▐▌
█ Last update on 18 Nov '13 ▐▌
█ ▐▌
█▌ █▌
█▌ - mewbies.com - █▌
█▌ █▌
██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██