eval gzinflate base64_decode str_rot13 part 2
Oktober 19th, 2006 by admin
on all my servers the php configuration value short_open_tag is disabled. that means i must write < ?php and can not use the short < ? to open the php session. another fact is "quote from php.net/eval):
eval() is used to protect (read: hide) source code. A well known way to encrypt some php code is security through obscurity. Someone used eval(base64_encode(".....")); - which basically had 10-16 nested calls to eval(base64_encode()) inside the data.
the most of these protected scripts use the short version to open php. so i can not execute them. therefor i coded a little function that deals with the problem. but the old function just decrypt "gzinflate(str_rot13(base64_decode(.....)))" and "gzinflate(base64_decode(...))" that is crap an does not work on most scripts (see comments). now i coded a whole class that deals with this problem. the class can recursive "decrypt" these scripts and let you download the original source code. i tested the class with scripts that are protected with the following functions (of couse recursive).
note: the class is really easy to use. look at the source and you know how.
note2: please do not edit the class and ask for help if you get any error (see comments).
note3: THIS IS IMPORTANT -> do NOT use the class to break any license,law or copyright.
the last note: check the decrypted source code and you will see 2 little errors. correct them and you are done.
-
class decode
-
{
-
function __construct($file)
-
{
-
$this->result = $this->org_data;
-
$this->done = false;
-
$this->file = $file;
-
}
-
-
function strip_php_tags($str)
-
{
-
}
-
-
function strip_what_to_execute()
-
{
-
{
-
}
-
}
-
-
function clean_string($str)
-
{
-
$str = trim($str,"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f");
-
$str = trim($str,"\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff");
-
return $str;
-
}
-
-
function test_possible_code($str)
-
{
-
$str = $this->clean_string($this->strip_php_tags($str));
-
//echo $str."\n";
-
{
-
$this->done = true;
-
return false;
-
}
-
foreach($functions as $function)
-
{
-
if($function!='' && $function!='eval')
-
{
-
$this->error('sorry but i can not access the function:"'.$function.'"');
-
else
-
$this->execute[] = $function;
-
}
-
}
-
return true;
-
}
-
-
function execute()
-
{
-
$cmd_str = '';
-
$cmd_end = '';
-
foreach($this->execute as $cmd)
-
{
-
$cmd_str .= $cmd.'(';
-
$cmd_end .= ')';
-
}
-
$eval = $cmd_str."'".$this->result."'".$cmd_end;
-
}
-
-
function error($msg)
-
{
-
}
-
-
function decode()
-
{
-
$this->strip_what_to_execute();
-
{
-
$this->execute();
-
$this->decode();
-
}
-
else
-
{
-
//i think this is the "decrypted"
-
$this->download();
-
}
-
}
-
-
function download()
-
{
-
}
-
}
-
$decode = new decode('test.php');
-
$decode->decode();
Dezember 27th, 2006 at 21:54
I run it and download a file with no content. Anyone can help me. Thanks a lot
Dezember 28th, 2006 at 12:27
please mail me your code. maybe i can help you.
Dezember 30th, 2006 at 13:48
Please help me decode this code below:
Januar 1st, 2007 at 11:03
I also have the same problem.
I run it and download a file with no content.
Januar 1st, 2007 at 14:27
ok for all who use this script.
it is important to place your encoded script in the same directory as my decoder script.
then change line 101:
$decode = new decode(’test.php’); // test.php is your encoded script
thats it. still problems? -> mail me the code.
Januar 5th, 2007 at 08:36
but i still download a file with no content
this is my test.php:
Januar 5th, 2007 at 15:26
Hello ,
I have e-mail my code to you.
Also, could you tell me what server configure you used.
Thanks
Januar 6th, 2007 at 20:02
it does not matter what server config you use.
PHP 5 -> this is important.
Januar 18th, 2007 at 17:33
it ist really easy to decode a script but you have to remove all unnecessary code.
the encoded script sould look like this:
< ? eval(gzinflate(str_rot13(base64_decode('***********)))); ?>
there are no comments and no “normal” codeblocks.
if you use the script this way it sould work fine.
Januar 19th, 2007 at 20:21
Admin need your email, the code is this:
Januar 19th, 2007 at 20:22
give me your email plz and i mail you mi code, thanks!
Januar 20th, 2007 at 00:55
[…] The following code snippet is a simple PHP class found at the postby macosbrain entitled DecodeFunction: eval gzinflate base64_decode str_rot13 […]
Januar 20th, 2007 at 12:23
admin, plz give me your email
Januar 20th, 2007 at 13:11
ebg2 @ macosbrain dot com
Januar 22nd, 2007 at 22:22
Well it’s not warking on this encoded data:
JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCc3Q…..
I would appreciate any help. 10x!
Januar 28th, 2007 at 07:45
I am running the script, and the result file just spits out the code I am trying to decrypt.
Any suggestions are appreciated!
Thanks for publishing the script
Januar 31st, 2007 at 18:09
please do not post any code here.
second if you try to decode and the result ist the same. please look at comment nr. 14
Februar 1st, 2007 at 16:57
[…] my previous post i released a class which “decrypt” php scripts that hide source code with special functions like eval, gzinflate, […]
Februar 3rd, 2007 at 12:11
once again.
I DO NOT SUPPORT ANY ILLEGAL ACTIONS.
I DO NOT HELP YOU TO CRACK PROTECTIONS IN PHP SCRIPTS!
Februar 7th, 2007 at 21:41
i got a lot of email with the request to decode a script from http://www.uploadscript.net(UPLOADSCRIPT v1.02)
i take a quick look at the source and i give you one serious advice -> look for another upload script.
here is a list with security related “bugs” in the upload script:
phpinfo.php -> really bad
*.txt -> bad too - because everyone can read it and got access to your data
storagedata -> directory is unprotected
Februar 13th, 2007 at 08:10
well what file uploader do you recommand tho?
Februar 14th, 2007 at 18:21
good question.
i have no answer. but i know if i need an upload script i would not use UPLOADSCRIPT, because of its massive seurity bugs.
Mai 27th, 2007 at 22:27
I used this function but i wont work for me.. It give me decrypt_test.php with same contents of encoded data..
ie:
test.php (encoded)
decrypted_test.php (decoded)
Mai 27th, 2007 at 22:28
test.php encoded
eval(gzinflate(str_rot13(base64_decode(’HZzHYcRDZVJ/cmkzAy6YE3lrw….’);
decrypted_test.php (decoded)
eval(gzinflate(str_rot13(base64_decode(’HZzHYcRDZVJ/cmkzAy6YE3lrw….’);
Mai 28th, 2007 at 17:51
it works fine just. please have a look at comment 9
http://wordpress.macosbrain.com/2006/10/19/eval-gzinflate-base64_decode-str_rot13-part-2/#comment-1733
Juli 17th, 2007 at 22:41
i tried to contact upload script owner but no reply
can you just check if this code you can decode or not..
i dont want to violate terms of uploadscript .. i will keep copyright of them.. but he is not answering and i need to make few changes in script
let me know if you can help me
Juli 17th, 2007 at 22:42
here is the code
FZrHDoTIG………./76669//uPv//zr7/8B
edit: what is that??? what should i do with this code ????
August 16th, 2007 at 12:06
hey script doesn’t work!!
the file decrypted_test.php is the same of test.php!
and the code of test.php is like :
August 16th, 2007 at 19:12
the script works fine. please look at your source code an delete all comments.
September 22nd, 2007 at 02:39
I deciphered a peice of code that was already encoded with any other type of encryption, can you take a look at it for me?
Here is a sample of the code:
”5²Å¶·2Þt‡1Å·Ä,]18bfÖêÿsWu²²¼ÒáŸúk§jHòŸ,ÝKû_QæsQü×ÌRXwÃKüE=×–={(G®
September 23rd, 2007 at 11:58
if you got any trouble with the decryption please mail me the whole php file to ebg2 at macosbrain dot com
Oktober 7th, 2007 at 20:19
Hi
I would like to know if I can use this to encrypt the source of a php script.
I want to make it so that the code of the php file is all encrypted.
Does this do it?
Can you please say how too?
Thanks
Februar 24th, 2008 at 12:05
Dear macosbrain & team,
I have come with multi string eval base decoder.just have a look http://haryanahome.info/forum/showthread.php?t=4 and paste the code here
http://haryanahome.info gives you something new
Jai Haryana Jai Bharat
Februar 24th, 2008 at 13:12
Am i not allowed to post codes here ? My posts being blocked plz get this code from and paste it here http://haryanahome.info/showthread.php?t=3
Note: I am not author of this script. credit goes to Jurgan(the mastermind).I have just made it easy and compitable with all PHP
Februar 24th, 2008 at 13:25
Sorry above url is mispelled its http://haryanahome.info/forum/showthread.php?t=3
Februar 24th, 2008 at 13:25
yes this is right. phpids does a very good job
please mail me the sourcecode.
Mai 6th, 2008 at 17:53
can’t execute your script
Parse error: syntax error, unexpected T_CLASS in /home/user/public_html/decode.php on line 3
Mai 8th, 2008 at 17:06
which php version do you use?