
Argh! It's so ugly and confusing! What are we going to do with these strings? This is where the PHP sandbox comes into play. Note the strings, along with it's concatenations. We're going to have to do some extra work.
#Php deobfuscator online code
Copy and paste the code into UnPHP: Īnd you'll see it doesn't deobfuscate it for us. Let's put our tools to use, and use two previous examples of PHP deobfuscation on this website.
#Php deobfuscator online how to
Learning how to do this yourself will help you learn more about PHP, and more about what's going on. How can I deobfuscate PHP Files by myself?īecause we cannot help (we can, I can, but they won't let me! :P) with every single PHP malware snippet out there, it would be better to teach you how to do it. Fortunately, many of the aforementioned methods should assist you in de-obfuscating this time. You'll have to decode that yourself, as they vary considerably. Garbage stored in a string, split by for loops, regex, etc.QXNzdW1pbmcgZGlyZWN0IGNvbnRyb2w= Assuming direct control.ZXZhbChiYXNlNjRfZGVjb2RlKCJoYXgiKSk7 = eval(base64_decode("hax")).Base64 is a bit different than the aforementioned methods of obfuscation, but is still relatively easy to decode. Almost the same as above, but \u# instead of \x#. However, they aren't necessarily represented only by \x. In PHP, these can be represented by backslash x, followed by a number or letter. You'll be looking for the HEX number on that table list. Let's list some of the common techniques so we know how to spot them and then decode them: There are several different ways that hackers obfuscate their code. While base64_decode is used in nearly all of the hacks we've come across, it mainly serves as a layer of obfuscation. Also, check out the OWASP PHP Cheat Sheet.To prevent this answer from becoming too large, I'm going to link to this question about commonly-exploited PHP functions. There are plenty of good uses for preg_replace(), but if you don't know how it got there, and especially if it appears alongside obfuscated code, that's a clear indication that you've been hacked. Frequently used with eval() to allow for arbitrary code execution. Just finding this function in use on your website could be an indication that you've been hacked.


This can be an evil function, as it allows arbitrary execution of PHP code. The vast majority of hacks are using some form of eval, or preg_place, or both: We'll use this to run echo commands when needed. You can also look for other sandboxes on google.
#Php deobfuscator online Offline
Some of these Base64 websites look kind of shady, so if you prefer to use an offline version without visiting those websites, I whipped up a quick tool for Windows (get Base64Decode.exe). I'm linking to Google search for this one. This is an excellent tool for splitting up single-line files which are otherwise very difficult to read. In those cases, other tools we'll list will suffice.

However, in some cases, UnPHP cannot deobfuscate the initial payload. In many cases, this website, and those like it, should be the first one for you to visit.

This greatly aids in de-obfuscating scripts that have nested obfuscation in excess of 100 nested functions. We're going to use these four methods to create a canonical answer.īefore we begin, let's collect a list of common tools that assist in deobfuscating these malicious files so we can do the work ourselves. Fortunately, almost all PHP scripts can be deobfuscated with 4 simple methods.
