一款PHP加密编码工具

刚刚在老外的博客上看到了一个php加密编码工具,拿来试了下,貌似挺好的,phpspy加密之后杀毒软件就认不出来了,嘿嘿,拿出来共享给大家,鄙视改人家代码改人家版权,然后取个名拿出来忽悠人的,现在这种人真TM太多了。

用法:

carbylamine.php [file to encode] [output file]

 

<?php
function rstr() //Random String Function
{
 $len=rand(3,6);
 $chr='';
 for($i=1;$i<=$len;$i++)
 {
  $chr.=rand(0,1) ? chr(rand(65,90)) : chr(rand(97,122));
 }
 return $chr;
}
function enjumble($data) //Custom Encoding + Base64 + gzinflate()
{
 for($i=0;$i<strlen($data);$i++)
 {
  $data[$i]=chr(ord($data[$i])+1);
 }
 return base64_encode(gzdeflate($data,9));
}
function striptag($in) //Remove '<?php' from initial code
{
 $pos = strpos($in,"<?php"); //to do: add support for short_tags 
 if(is_numeric($pos))
 {
  for($i=$pos;$i<=$pos+4 && strlen($in) >=5;$i++)
  {
  $in[$i]=' ';
  }
  return $in;
 }
 else
 {
 return $in;
 }
}
function makeoutfile($str)
{ $funcname=rstr();
$varname='$'.rstr();
$template=
"<?php function ".$funcname."($varname)
{ 
$varname=gzinflate(base64_decode($varname));
 for(\$i=0;\$i<strlen($varname);\$i++)
 {
".$varname."[\$i] = chr(ord(".$varname."[\$i])-1);
 }
 return $varname;
 }eval($funcname(\"";
  $str=enjumble($str);
 $template = $template . $str."\"));?>";
 return $template;
}
function main($argc,$argv)
{
$banner=
"\n +-------------------------------------------------------------------+
 |+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
 |+                                                                 +|
 +____               _             _                    _           +| 
/  __ \             | |           | |                  (_)          +|   
| /  \/  __ _  _ __ | |__   _   _ | |  __ _  _ __ ___   _  _ __    _+|_ 
| |     / _` || '__|| '_ \ | | | || | / _` || '_ ` _ \ | || '_ \  / _ \
| \__/\| (_| || |   | |_) || |_| || || (_| || | | | | || || | | ||  __/
 \____/ \__,_||_|   |_.__/  \__, ||_| \__,_||_| |_| |_||_||_| |_| \___|
 |+                         __/ |                                    +|  
 |+                    Carbylamine PHP Encoder                      +|  
 |+                           v0.1.1 Nightly                        +|
 |+                                                                 +|
 |+                                                                 +|
 |+                      Coded by Prakhar Prasad                    +|
 |+                        (prakharpd@gmail.com)                    +|
 |+                                                                 +|
 |+                                                                 +|
 |+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
 +-------------------------------------------------------------------+\n\n";
$usage="$banner Syntax: ".$_SERVER['PHP_SELF']." <file to encode> <output file>\n";
if($argc==1) {echo $usage ; die();}
if($argc>1) $file = $argv[1];
if($argc>2) $outfile = $argv[2];
if(empty($file) || empty($outfile)) { echo "Input/Output filename not entered!\n\n\x07" ;die();}
if(!file_exists($file))
{
echo "$banner Error: Input file doesn't exist\n\n\x07";
}
else{
$orginal_size=round(filesize($file)/1024,2);
echo "$banner  Encoding : $file ($orginal_size KB) \n\n ";
$output_filename=$outfile;
$outfile=fopen($outfile,'w+');
$file=fread(fopen($file,'r'),filesize($file));
$outdata=makeoutfile(striptag($file));
$newsize=round(strlen($outdata)/1024,2);
echo " Compression : ".@round(100-(($newsize*100)/($orginal_size!=0?$orginal_size:1)),2)."%\n\n";
if(!fwrite($outfile,$outdata))
{
 echo " Unable to write to $output_filename\n\n\x07";
}
else
{
echo "  Successfully Encoded! to $output_filename\n\n" ;
}}}
main($argc,$argv);
?>
本文标题:一款PHP加密编码工具
本文链接:https://www.nigesb.com/php-script-encoder.html
订阅本站:http://www.nigesb.com/feed
转载请注明来源,如果喜欢本站可以Feed订阅本站。

发表评论?

10 条评论。

  1. 这款工具怎么使用呢,在PHP环境不能直接IE访问,CMD按图片命令方法打相应命令也不行,请问该怎么做,求指教!

  2. 谢谢指点,确实由于我装的是精简版AMP,缺少了组件,问题已解决了!

  3. 还真不明白怎么使用它

  4. 这个混淆出来的代码太容易破解 把eval 改成 echo 然后 浏览器查看源码 一清二楚

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>