PHP Obfuscation

obfuscated code

If you’ve done any searching on the web for HTML templates, themes for (WordPress || Joomla || Drupal || etc), and/or various scripts, you have most likely come upon the presence of obfuscated code. Obfuscation (and the result, obfuscated code) is basically non-human-readable code. As an end-user (or close to it), one will not be able to tell how the code works, or what it does. The practice of obfuscating code can be legitimate – if a developer wishes to make sure their links are not removed, for example. However, in most cases, this obfuscated code is used to hid a short script that will make files on your webserver accessible to the writer, or other means of invasion. If you ever see obfuscated code in a file, don’t use it – or decode it.

There are a few primary types of obfuscated PHP code, shown in examples below:

    < ?php $o="encrypted text";eval(base64_decode('rubbish'));return;?>
    < ?php $_F=__FILE__;$_X='encrypted text';eval(base64_decode('rubbish'));?>
    < ?php eval(gzinflate(base64_decode('rubbish')));?>

You can decode them all here, just upload the file.

February 10, 2010

Categories:

software

3 Responses to PHP Obfuscation

  1. Name (required) says:

    Is it supposed to be a maze?

  2. EataPhatty says:

    haha, that’s not nice, you need the maze with a );
    Everyone likes a happy ending you know (:

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

 
Content-Type: text/html