wazuh环境配置及案例复现

文章目录

wazuh环境配置及案例复现

wazuh环境配置

进入官网下载ova软件

https://documentation.wazuh.com/current/deployment-options/virtual-machine/virtual-machine.html

打开下载的ova,密码和用户名会显示在上面

设置NAT模式

然后重启网络,查看ip

复制代码
service network restart
ip add

开启小皮,在浏览器上输入ip进行访问,用户名和密码都是admin

进入之后的页面

案例复现

首先。在nginx的目录/var/www/html创建一个文件index.php

复制代码
<?php
function fun($var): bool{
    $blacklist = ["\$_", "eval","copy" ,"assert","usort","include", "require", "$", "^", "~", "-", "%", "*","file","fopen","fwriter","fput","copy","curl","fread","fget","function_exists","dl","putenv","system","exec","shell_exec","passthru","proc_open","proc_close", "proc_get_status","checkdnsrr","getmxrr","getservbyname","getservbyport", "syslog","popen","show_source","highlight_file","`","chmod"];
 
    foreach($blacklist as $blackword){
        if(strstr($var, $blackword)) return True;
    }
 
    
    return False;
}
error_reporting(0);
//设置上传目录
define("UPLOAD_PATH", "./uploads");
$msg = "Upload Success!";
if (isset($_POST['submit'])) {
$temp_file = $_FILES['upload_file']['tmp_name'];
$file_name = $_FILES['upload_file']['name'];
$ext = pathinfo($file_name,PATHINFO_EXTENSION);
if(!preg_match("/php/i", strtolower($ext))){
die("只要好看的php");
}
 
$content = file_get_contents($temp_file);
if(fun($content)){
    die("诶,被我发现了吧");
}
$new_file_name = md5($file_name).".".$ext;
        $img_path = UPLOAD_PATH . '/' . $new_file_name;
 
 
        if (move_uploaded_file($temp_file, $img_path)){
            $is_upload = true;
        } else {
            $msg = 'Upload Failed!';
            die();
        }
        echo '<div style="color:#F00">'.$msg." Look here~ ".$img_path."</div>";
}

然后创建一个前端页面index.html

复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="light"><span class="glow">
            <form enctype="multipart/form-data" method="post" action="./index.php">
                嘿伙计,传个火,点支烟,快活人生?!
                <input class="input_file" type="file" name="upload_file" />
                <input class="button" type="submit" name="submit" value="upload" />
            </form>
    </span><span class="flare"></span>
    </div>
</body>
</html>

执行后的结果

相关推荐
麦聪聊数据1 小时前
为何通用堡垒机无法在数据库运维中实现精准风控?
数据库·sql·安全·低代码·架构
m0_466525292 小时前
绿盟科技风云卫AI安全能力平台成果重磅发布
大数据·数据库·人工智能·安全
晚霞的不甘3 小时前
守护智能边界:CANN 的 AI 安全机制深度解析
人工智能·安全·语言模型·自然语言处理·前端框架
枷锁—sha3 小时前
【SRC】SQL注入快速判定与应对策略(一)
网络·数据库·sql·安全·网络安全·系统安全
数字护盾(和中)3 小时前
信创生态 + 国密算法 筑牢数字安全韧性根基
安全
devmoon4 小时前
在 Polkadot 上部署独立区块链Paseo 测试网实战部署指南
开发语言·安全·区块链·polkadot·erc-20·测试网·独立链
成茂峰4 小时前
软考高级·系统架构设计师 | 四、信息技术安全知识
安全·信息安全·系统架构·架构设计师
向哆哆4 小时前
CANN生态安全保障:cann-security-module技术解读
人工智能·安全·cann
wuli_滔滔5 小时前
CANN安全机制源码探秘 仓库中的权限校验与数据加密实现
安全·cann
liann1195 小时前
3.1_网络——基础
网络·安全·web安全·http·网络安全