wazuh初次理解-8-23

一、wazuh配置:

1、进入官网下载OVA启动软件:

Virtual Machine (OVA) - Installation alternatives

2、进入虚拟机进行配置:

3、登录提示:

4、将网络连接模式更改为NAT,否则不能上网;

4、重启网络:

service network restart

6 .开启小皮Apache,输入ip进行访问,在Chrome访问,然后登录wazuh,用户名和密码默认为admin

重启wazuh:

systemctl restart wazuh-manager

二、案例复现:

当我们使用本地的cmd通过ssh一直连接wazuh的时候便会出现十级报错,此次在后台可以明显的看到有爆破的提示扫描,通过分析其具体的数据包以及对应的规则理解到wuzuh在外来访问的时候,会触发到解码器,其作用是用来抓取关键信息,其中核心便是正则表达式进行正则匹配,当数据来了之后,wazuh程序会分析我们的日志,把这些日志信息发到相对应的解码器去,通过解码器去进行解码,解码完后,再发送到相应的规则,然后把解码完的数据通过规则,再次进行匹配,最终展示到仪表盘的Modules里的Security events里

在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>";
}

前端代码:

<!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>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

RongChuJie

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值