问题标签 [suricata]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1278 浏览

security - 使用 Docker 时使用 Snort 还是 Suricata?

猜猜我将为我的IDS/IPS使用多个 docker 文件——使用微服务。说它有 50 多个docker容器。你会使用Suricata还是Snort?Snort 不是多线程真的很重要吗,它的 snort 是否比 Suricata弱?

0 投票
1 回答
890 浏览

dns - 如何在 DNS rdata/IP 地址上触发规则?

我目前在 Suricata 中设置了以下 DNS 查询警报规则(用于测试目的):

当它捕获包含单词“google”的DNS事件时触发,例如在这个数据包中:

但是,我不想搜索包含“google”的资源记录名称,而是想使用这种相同类型的警报来触发解析为环回的 IP 地址,就像以下数据包的情况一样(注意该rdata字段):

正如我所注意到的,contentSuricata 规则部分仅搜索字符串。我当前的规则在与 rrname/domain 的文本匹配时触发,我将如何使规则在 rdata/IP 地址上触发?

ps 出于好奇,我尝试将警报内容部分中的“google”替换为“127.0.0.1”,但正如预期的那样,这也不起作用。

0 投票
1 回答
570 浏览

snort - 使用 Suricata 以特定顺序匹配数据包内容?

我正在尝试创建一个 Suricata 规则,当且仅当所有内容都以特定顺序找到时才会匹配数据包。

我当前规则的问题是即使数据包内容是test2 test1.

有没有办法在不使用 pcre 的情况下实现此功能?

0 投票
1 回答
506 浏览

suricata - 在 nfqueue 模式下停止 suricata 并启用 FW 规则,会终止所有连接

我已经按照此处的文档在 IPS 模式下安装了 suricata 4.0 :

我可以用 开始它/etc/init.d/suricata start,但是一旦我用它停止它,/etc/init.d/suricata stop它就会断开与盒子的所有连接,并且不允许进一步的连接。我已经运行: sudo iptables -A OUTPUT -j NFQUEUE & sudo iptables -A INPUT -j NFQUEUE 只有在启动 b/c 之后,如果我事先运行这些,就会发生同样的事情,所有连接都被删除,我无法 ssh 回到盒子中。

它将重新启动(启用 iptable 规则),但在重新启动过程中连接处于暂停状态(无法从其他位置键入或 ssh),虽然大约需要 5 秒,但它确实成功恢复。

这让我提出了几个问题,但让我们保持不变,我怎样才能添加这些防火墙规则而不听读一些东西NFQUEUE 因为 suricata 会转发或丢弃,我假设因为它们不会从队列中删除,所以它们永远不会进一步处理。

谢谢!

0 投票
1 回答
349 浏览

docker - Feedback Request - Restarting Docker container on file change

I have this working but was wondering if there is any potential side effects or even a better way to do this. The example below is generic.

I have a docker-compose file with two containers (container_1 and container_2).

container_1 exposes a volume that contains various config files that it uses to run the installed service.

container_2 mounts the volume from container_1 and periodically runs a script that pulls files and updates the config of the service running in container_1.

Every time the configs are updated I want to restart the service in container_1 without having to use cron or some of the other methods I have seen discussed.

My solution:

I put a script on container_1 that checks if the config file has been updated (the file is initially empty and that md5sum is stored in a separate file) and if the file has changed based on md5sum it updates the current hash and kills the process.

In the compose file I have a healthcheck that runs the script periodically and restart is set to always. When the script in container_2 runs and updates the config files in container_1 the monitor_configs.sh the script on container_1 will kill the process of the service and the container will be restarted and reload the configs.

monitor_config.sh

docker-compose.yml

I know this is not the intended use of healthcheck but it seemed like the cleanest way to get the desired effect while still maintaining only one running process in each container.

I have tried with and without tini in container_1 and it seems to work as expected in both cases.

I plan on extending the interval of the healthcheck to 24 hours as the script in container_2 only runs once a day.

Use case

I'm running Suricata in container_1 and pulledpork in container_2 to update the rules for Suricata. I want to run pulledpork once a day and if the rules have been update, restart Suricata to load the new rules.

0 投票
0 回答
320 浏览

json - MHN Suricata Wordpot/Cowrie ELK Stack only a few events in ELK

我从 github 成功安装了 MHN。在部署了几个传感器后,我观察到 MHN 的 honeymap 和攻击页面正确地注册了攻击(nmap 或登录 wordpot 或 cowrie)。然而,ELK Stack 只收集了 wordpot 和 cowrie 事件。

/opt/hpfeeds-logger/json.json 中的通道包括 suricata.events。

/opt/suricata/etc/suricata/suricata.yml 包含以下 hpfeeds 输出:

例如 /opt/wordpot/wordpot.conf 包含以下内容:

据我了解 MHN ELK 的想法,所有输出都应该转到服务器上的文件:

不幸的是,只有 wordpot/cowrie 事件能做到这一点。有没有办法检查 suricata.events 在前往 logstash 的途中丢失的位置?

整个事情都在父代理之后,而 mhn 服务器本身正在运行一个 squid 实例来为要安装的传感器提供父代理的代理(避免传感器直接访问互联网)。

0 投票
1 回答
277 浏览

regex - 在具有多个参数随机值的 URL 上匹配正则表达式 PCRE

我想与正则表达式 PCRE 匹配的示例 GET 请求:

random.php?blue=value1&green=value2&red=value3&orange=value4&grey=value5&black=value6

事实:

random.php - 文件名是随机的,只有“.php?” 是固定的

我有大约 10 种颜色定义为参数

颜色没有特定顺序 - .php?blue=[a-zA-Z0-9]{1,20}

可以只是 2 种颜色作为参数,也可以是全部 10 种颜色,但我想匹配所有 GET 请求,多个参数用 \& 连接

值始终介于 1-20 之间,并带有字母数字 - .php?blue=[a-zA-Z0-9]{1,20}

你会如何处理这个问题?

0 投票
1 回答
12241 浏览

ssh - 使用 snort/suricata,我想为每次登录家庭网络失败生成 SSH 警报

我正在使用 Suricata 设置入侵检测系统 (IDS)。我想编写一个自定义规则,只要我的虚拟机发生登录尝试失败,它就会生成警报。

例子:

alert tcp any any -> $HOME_NET 22 (msg:"SSH Brute Force Attempt";flow:established,to_server;content:"SSH";nocase;offset:0; depth:4;detection_filter:track by_src, count 2, seconds 2;sid:2005;rev:1;)

我尝试了 SSH 规则的各种组合,但无法在 Suricata 警报部分看到任何警报,其中包含多次错误的 SSH 尝试。(错误尝试 => 使用无效密码生成警报)

请让我知道该怎么做。

0 投票
1 回答
3995 浏览

user-interface - Suricata gui 而不是 snorby

您好,我正在为 Surricata IDS 寻找一些 gui。我从 Snort 尝试了 Snorby,但由于 ruby​​ 兼容性,现在无法安装它。知道用什么吗?谢谢

0 投票
1 回答
1648 浏览

python - 运行 manage.py migrate 时出错

当我尝试在我的 Ubuntu 16.04 LTS 上运行 Sciius 项目时,我遇到了一个无法修复的错误,而我是该领域的新手。有人可以帮帮我吗,我需要运行我从https://github.com/StamusNetworks/sciius克隆的这个项目