Saturday, June 27, 2015

How to Decode PhpCipher

PhpCipher is an encryption without a loader that can be decoded 100% correctly. It doesn’t matter if the files have been encoded with a license or not, they can be decoded without errors.

As you know, a script encoded with PhpCipher comes with an auxiliary file named “phpcipher.bin”. This files is loaded by all the php files encoded with PhpCipher like a functions file and, for a better protection, “phpcipher.bin” is encoded with Zend Guard and php 5.2

To decode a php file encrypted with PhpCipher you will have to make the following steps:

  • Decode “phpcipher.bin” and extract from it an encryption key, an array actually.
  • Extract the encrypted code from the target php file.
  • Place the two variables from above in a function which will give the decoded file.

Decode “phpcipher.bin”.

Phpcipher.bin is encoded with Zend Guard and php 5.2 and it can be decoded by any decoder made for IonCube and php 5.2. You can find, free on the internet, the following programs: iDezender_40 or iDezender8.

  • Change the extension “phpcipher.bin” to “phpcipher.php”.
  • Put the file into one of the decoders above and it will be decoded.

You can extract then this array: “$phpCipher2873a7e1e7e09b518d6c49ad2391d5d0“. Keep in mind that this key is unique for each script.

Extract the code from the php file.

In each php file encode with PhpCipher, you will find this variable: “$phpCipher“. Extract all the code.

PhpCipher Decoding Function

You will have to put the two variables from above in this function and to run it. You will get the decoded file, 100% accurately decoded.

The decoded file

Below, you will see the decoded file.

The files used in this article can be downloaded from here.

Paid PhpCipher decoding.

Tuesday, February 24, 2015

How to Decode PhpLockIt 2.2.0

I recently saw an entire WordPress theme encoded with PhpLockIt 2.2.0 and I realized that this encryption is still widely used and that someone could be interested to find out a way to decrypt it.

Since PhpLockIt 2.2.0 is practically a base64 encoding, it can be decoded without errors, 100% clean, and the output script will work without the need to correct syntax errors or make additional changes to the code.

How to decode PhpLockIt 2.2.0:

Original file - This is the original test file, unedited. Save it please in a php file "1.php".

Step 1 - Write down the hex variable before eval. You will use it later.
$start = 0xa8;

Step 2 - See what "eval" contains.
Replace "eval" with "echo" and run the file. You will get the result below.

Write down 3 variables from above. You will use them later.
$offset = 0x501 + 0x3a8;
$key = 'nPDJexW2L/moSgMZOQAGK4NcFb6akY038phqi1UdBflwvRrTtIX7yH5sVzuC+jE9=',

Step 3 - Decoding function. I have replaced the variables $file, $key, $start, $offset as arguments for the function.

Save the decoding function above in a php file named "decode.php", in the same folder with "1.php". Run "decode.php" and you'll get the decoded file.

You can decode any file encoded with PhpLockIt 2.2.0, if you follow the steps above.

  • Replace "eval" with "echo" in the original file and run it. Write down the variables.
  • Insert the variables in the decoding function.
  • Run the file that contains the function and you'll get the decoded file.