file2php 's

admin 2017年4月6日06:50:15评论362 views字数 1129阅读3分45秒阅读模式
摘要

作者:Saiy 来源:浅蓝的辐射区写了一个简单的代码,按shell哥的意思的。
只是把文件“变成”php代码。必将的时候可以直接写到php….
里到服务器再把文件释放到某目录下。
代码没写得很清晰,其实很简单,有需要的可以改改也可以自己写。

<?php
/*************************************************************************
file to php by saiy[s4t]
说明:
这个文件只是把任意文件转换成php代码
使用的时候你可以使用下面的php2file函数转换为原来的文件
为了居家旅行的入侵而已。blog:http://www.51shell.cn
************************************************************************/
function php2file($code,$file){//code为编码后的变量名,file为保存的文件名
$tmp = base64_decode($code);
$tmp = gzinflate($tmp);
$fp = fopen($file,"w");
fwrite($fp,$tmp);
fclose($fp);
}
function file2php($file){
$tmp = readfromfile($file);
$tmp = gzdeflate($tmp);
$tmp = base64_encode($tmp);
$tmp = "<?php/n/**************************/n
php to file by saiy[s4t]/n**************************/
/n/n/n$code = /"".$tmp."/";/n?".">";
return $tmp;
}
function readfromfile($file_name) {
if (file_exists($file_name)) {
$tmp=fopen($file_name,"r");
$tmp=fread($tmp, filesize($file_name));
fclose($tmp);
return $file_data;
}
}

//juest a example for use it
writeover("myrar.php",file2php("./file.rar"));
//else function
//写入文件函数
function writeover($file_name,$data,$method="w") {
$tmp=fopen($file_name,$method);;
fwrite($tmp,$data);
fclose($tmp);
}
?>

作者:Saiy 来源:浅蓝的辐射区

写了一个简单的代码,按shell哥的意思的。
只是把文件“变成”php代码。必将的时候可以直接写到php….
里到服务器再把文件释放到某目录下。
代码没写得很清晰,其实很简单,有需要的可以改改也可以自己写。

<?php
/*************************************************************************
file to php by saiy[s4t]
说明:
这个文件只是把任意文件转换成php代码
使用的时候你可以使用下面的php2file函数转换为原来的文件
为了居家旅行的入侵而已。blog:http://www.51shell.cn
************************************************************************/
function php2file($code,$file){//code为编码后的变量名,file为保存的文件名
$tmp = base64_decode($code);
$tmp = gzinflate($tmp);
$fp = fopen($file,"w");
fwrite($fp,$tmp);
fclose($fp);
}
function file2php($file){
$tmp = readfromfile($file);
$tmp = gzdeflate($tmp);
$tmp = base64_encode($tmp);
$tmp = "<?php/n/**************************/n
php to file by saiy[s4t]/n**************************/
/n/n/n$code = /"".$tmp."/";/n?".">";
return $tmp;
}
function readfromfile($file_name) {
if (file_exists($file_name)) {
$tmp=fopen($file_name,"r");
$tmp=fread($tmp, filesize($file_name));
fclose($tmp);
return $file_data;
}
}

//juest a example for use it
writeover("myrar.php",file2php("./file.rar"));
//else function
//写入文件函数
function writeover($file_name,$data,$method="w") {
$tmp=fopen($file_name,$method);;
fwrite($tmp,$data);
fclose($tmp);
}
?>

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2017年4月6日06:50:15
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   file2php 'shttps://cn-sec.com/archives/48377.html

发表评论

匿名网友 填写信息