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>

执行后的结果

相关推荐
白帽黑客沐瑶22 分钟前
【网络安全就业】信息安全专业的就业前景(非常详细)零基础入门到精通,收藏这篇就够了
网络·安全·web安全·计算机·程序员·编程·网络安全就业
深盾安全26 分钟前
符号执行技术实践-求解程序密码
安全
贾维思基1 小时前
被监管警告后,我连夜给系统上了“双保险”!
安全
00后程序员张2 小时前
iOS App 混淆与加固对比 源码混淆与ipa文件混淆的区别、iOS代码保护与应用安全场景最佳实践
android·安全·ios·小程序·uni-app·iphone·webview
Devil枫5 小时前
鸿蒙深链落地实战:从安全解析到异常兜底的全链路设计
安全·华为·harmonyos
lubiii_12 小时前
网络安全渗透测试第一步信息收集
安全·web安全·网络安全
你的人类朋友14 小时前
🔒什么是HMAC
后端·安全·程序员
阿部多瑞 ABU16 小时前
《基于国产Linux的机房终端安全重构方案》
linux·安全
小刘鸭地下城17 小时前
内容安全策略(CSP)深度指南:从基础配置到高级防护
安全
内心如初1 天前
应急响应事件处理(网络安全体系架构与应急响应的前置知识)
安全·web安全