alessandromrc/unwanted-threats
GitHub: alessandromrc/unwanted-threats
这是一个聚合多个公开威胁情报源,自动生成并持续更新 IP、域名和网络阻断列表的项目,旨在帮助防火墙和安全工具拦截恶意流量。
Stars: 1 | Forks: 0
# 不必要的威胁
此仓库将多个公开威胁情报源聚合为统一的 JSON 和文本文件。
数据会自动刷新(通过 GitHub Actions)并从 `output` 分支提供,以便通过 HTTPS 进行消费。
## 在你的 MikroTik 上使用此列表
你可以使用以下脚本获取阻止列表,并将其中的 IP 添加到 unwanted-threats 地址列表中,从而允许你阻止进出已知恶意主机的流量。
```
:local name "[unwanted-threats]"
:local url "https://alessandromrc.github.io/unwanted-threats/ips.rsc"
:local fileName "unwanted-threats-ips.rsc"
:log info "$name fetch blocklist from $url"
/tool fetch url="$url" mode=https dst-path=$fileName idle-timeout="30s"
:if ([:len [/file find name=$fileName]] > 0) do={
:log info "removing old ipv4 blocklist"
/ip/firewall/address-list/remove [find where list="unwanted-threats"]
:log info "removing old ipv6 blocklist"
/ipv6/firewall/address-list/remove [find where list="unwanted-threats"]
:log info "$name import;start"
/import file-name=$fileName verbose=yes
:log info "$name import:done"
} else={
:log error "$name failed to fetch the blocklist"
}
```
## 数据输出
所有生成的文件都位于 `output` 目录中(部署时则在 `output` 分支中)。
| 数据类型 | 文件 |
| --------- | ---- |
| **IP 地址(每行一个)** | `ips.txt` |
| **IP 地址(JSON 数组)** | `ips.json` |
| **主机名/域名(每行一个)** | `hosts.txt` |
| **主机名/域名(JSON 数组)** | `hosts.json` |
| **CIDR 网络(每行一个)** | `networks.txt` |
| **CIDR 网络(JSON 数组)** | `networks.json` |
| **摘要 / 元数据** | `summary.json` |
## 威胁情报源
该脚本当前从以下公开源拉取:
- AIP 历史黑名单 (CSV)
- Adblock NoCoin 主机文件
- EmergingThreats Block IPs
- URLHaus hostfile
- Ipsum IP 黑名单
- ThreatFox hostfile
- FireHOL DShield 7‑天 IP 集
这些是硬编码在 `main.js` 中的具体 URL:
- ```https://mcfp.felk.cvut.cz/publicDatasets/CTU-AIPP-BlackList/Todays-Blacklists/AIP_historical_blacklist_prioritized_by_newest_attackers.csv```
- ```https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt```
- ```https://rules.emergingthreats.net/fwrules/emerging-Block-IPs.txt```
- ```https://urlhaus.abuse.ch/downloads/hostfile/```
- ```https://raw.githubusercontent.com/stamparm/ipsum/master/ipsum.txt```
- ```https://threatfox.abuse.ch/downloads/hostfile/```
- ```https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/dshield_7d.netset```
## 工作原理
- `main.js` 下载每个源并解析 IP 地址、CIDR 以及主机名/主机类指标。
- 所有数据经过标准化和去重处理后写入 `./output/`。
- 定时的 GitHub Actions 工作流可以运行 `node main.js` 并使用 GitHub Pages 将 `output` 目录部署到 `output` 分支,这与 `tor-monitoring` 仓库非常相似。
## 本地运行
```
npm install
npm run start
```
生成的文件将出现在本地的 `output` 目录中。
标签:CIDR, DShield, FireHOL, GitHub Actions, Homebrew安装, IP黑名单, MikroTik, MITM代理, RouterOS, Streamlit, ThreatFox, URLHaus, 入侵防护, 域名黑名单, 威胁情报, 威胁情报聚合, 开发者工具, 恶意IP, 恶意域名, 持续更新, 网络安全, 网络调试, 自动化, 自动笔记, 自定义脚本, 访问控制, 防火墙规则, 阻断, 隐私保护, 黑名单