RSS Feed

Decrypt nested eval gzinflate str_rot13 base64_decode

Posted on Saturday, March 22, 2008 in Coding

So I went ahead and wrote a script to undo massively nested eval(gzinflate(str_rot13(base64_decode(‘STRING’)))); and eval(gzinflate(base64_decode(‘STRING’))); “encryptions” with a multitude of both of them inside it. The string from the original footer here had to go through 67 different iterations before it got to the real source code (talk about overkill).
If you have strings that aren’t nested, you can probably just do this:

$string = gzinflate(str_rot13(base64_decode('YOUR STRING')));
$string = htmlentities($string, ENT_NOQUOTES);
echo $string;

If you have a string from that fits that description you can decrypt it here

Or if you just want to test it here’s the original string from the footer of this one of my old themes:

  1. Did the job, thank you!

  2. Is it normal to take a ~20,000 byte string (in a file) down to source code of only ~640 bytes?

    Also, should I be able to drop the “source” in place of the “encrypted” file and all work as normal (as I can’t…)?

    Very good work, btw. I just am trying to learn and have those and possibly a few more questions.

  3. it really just depends on how they did it and how many times. the one that was in this footer was originally 11,139 bytes and the actual source was only 6,842 bytes. although that’s not quite as drastic of a difference as 20kb –> .6kb it is possible.

    and yes, you should be able to just replace the eval(‘blah blah blah’); with the actual source code.
    if it’s not working feel free to send me what you’re trying to decode and i can try and help out.

    josh (at) thespiffylife (dot) com

  4. By the way, I just fixed the decrypting page to allow for either eval(gzinflate(str_rot13(base64_decode('STRING')))); or eval(gzinflate(base64_decode('STRING'))); (and others nested up inside them). So that should help most everyone.

  5. thanks, your scripts helpfull me

  6. thanks for sharing…without a doubt easiest and most efficient solution I found on the web…

  7. It’s awsome man!
    Realy thanks… that did my job.

  8. this is so great! thanks a lot for saving my time to search on the decoding. fantastic!!!!

  9. thanks so much, i have been dying to unencrypt one part of a template that i found but had some junk links plugged into it. i had found others that promised and others that had some ethical problems with unencrypting code.

  10. awesome job man!! resolved my head ache so much.. haha… coders nowadays got so many ways to send their spyware, backdoor etc… gosh.. u’re great man.. by the way, nice theme.. hehe..

  11. AWESOME … COOL man,,it really works,,so i can edit any wp footer.. THANKS!

  12. Please could some one decode this into php for me?

  13. I’m guessing WordPress filtered out your comment. If you can’t post it here and you need some with it something just email me whatever it is to josh (at) thespiffylife (dot) com

  14. I have one that will not work in your decoder. It starts out with: eval(gzinflate(base64_decode(‘DZa1
    and ends with: vf//n/wE=’)));

    I put in in the form starting with the DZ and ending with wE=
    a couple of times, and it said “Your string doesn’t appear to be encoded using eval(gzinflate(str_rot13(base64_decode(‘STRING’))))
    or eval(gzinflate(base64_decode(‘STRING’)))

    maybe you put it in wrong?”

    I tried it with your example above and that one worked perfectly. Would you be willing to take a shot at it?

  15. just send me the code in an email to josh (at) thespiffylife (dot) com and i’ll see if i can figure it out for you.

  16. nice job , you break http://www.rightscripts.com/phpencode/index.php …heheheh

  17. Holy crap! I did it! It worked!

    Josh, you have a very spiffy life! Thank you.

    After searching the internet for hours trying to decode that wordpress footer, you took care of it in less than 30 seconds!

    I added you to “my favorites”.

    From now on, whenever I have a coding problem, I know right where to go!

    THANK YOU! THANK YOU! THANK YOU!

    Danielle

  18. @Rodrigo Gregorio
    lol, you’re right. I just tested it with a really long PHP script I have to generate RSS feeds and mine reversed it no problem :P

  19. AWESOME! Saved me so much time. You’re the man.

  20. Thanks for this :)

  21. THANKS!!!

  22. Hi there,

    I have a “eval(gzinflate(base64_decode” that does not want to encode….. I have tried the decode method where you write a scrip and then it writes the decoded script in the file decode.txt, and I have also tried the plain decode php file, that is the only one that actualy decoded on line of the code.. Can someone pleas advise me on what I can do to decode this….

    Regards
    Nickey

  23. You can generally change the eval function to simple echo instead and it should print out everything inside instead of run it. This doesn’t always work, it really just depends on what the code inside is/does.
    It might be best to do something like

    echo htmlentities( gzinflate(base64_decode('string')), ENT_QUOTES);


    I’ve also had some luck with just doing a simple

    file_put_contents('decode.txt', gzinflate(base64_decode('long string')));


    and viewing that to see it.
    Your mileage may vary because of how it was encoded or what’s hidden on the inside. If you still can’t figure out how to take care of it, feel free to send me what you’re working on to josh (at) thesiffylife (dot) com and I’ll see if I can’t help you out ;)

  24. Great work, thank you!

  25. THANK YOU! What an awesome tool.

  26. Thank you! I don’t get why they do this crap when you’ve paid for the WP theme…

  27. I need source phpL0ckit decrypt. please help me. thanks :)

  28. Thank for the script! It works very well!

  29. i have one file can one of you guys decrypt it for me?

  30. thank you so much!

  31. Not working for me. I have something different in the footer like this:

    $_F=__FILE__;$_X=’encryted-code-here’;eval(base64_decode(‘another-encrypted-code’));

    Which code should i take?

    Thanks,
    Boyz

  32. That’s probably one that may need to done in pieces. First decrypt (either using my form or by hand) this part: eval(base64_decode(‘another-encrypted-code’));
    Then once you have the actual code from their $_X will probably be visible and you can decrypt that.

  33. just change eval to echo.

    Can you even call this obfuscation? might as well not even do it. Any one can figure that out :p

  34. thank you. it’s working great for me

1 Trackbacks/Pings Not Shown.

  1. [...] NattyWP preloaded their footer.php file with one of these ciphers so that users couldn’t remove all of the “Created by NattyWP” links plus all of the other mumbo-jumbo they add to the list. Well, after a quick google search, I was able to decipher the cipher using Josh’s Random Non-Sense Blog (Big Thanks!). [...]

Leave a Comment