ebyebots/bspiski
GitHub: ebyebots/bspiski
BSpiski 是一个 Linux 自动化脚本,用于通过管理 IP 黑白名单设置免费的内核级 DDoS 防护,抵御 HTTP 洪水攻击。
Stars: 1 | Forks: 0
# BSpiski:国家、L7 防洪水L3/L4 🛡️
**BSpiski** — 专为 **Linux (iptables/ipset)** 设计的自动化脚本,用于从各种来源收集、过滤和合并 IP 地址数据库。它准备优化的 **白名单**(允许/"好"的)和 **黑名单**(阻断/"坏"的)网络列表,以在 Linux 内核层面建立 **免费的网站防护,抵御 L7 DDoS 攻击(HTTP 洪泛)** 以及 L3/L4 攻击。
该脚本在本地运行,非常适合入门级服务器配置(**1 个 CPU 和 1 GB 内存**)。
**BSpiski** is an automated script for Linux (iptables/ipset) designed to aggregate, filter, and merge IP address databases from various sources. It prepares optimized lists of allowed ("good") and blocked ("bad") networks to set up **free, kernel-level website protection against L7 DDoS attacks (HTTP Flood)**.
The script runs locally and is perfectly optimized for entry-level server configurations (**1 CPU and 1 GB RAM**).
## 📖 工作原理 / How It Works
### 🇷🇺 中文说明:
1. **数据库聚合:** 脚本收集所选国家(GeoIP)的子网、活跃的垃圾邮件/DDoS 情报源、不良 ASN 列表以及经过验证的搜索引擎爬虫(Google、Yandex 等)。
2. **列表生成:** 它将生产就绪的文件输出到 `bspiski` 文件夹:
* **白名单** (`ipv4.txt` / `ipv6.txt`) — 目标国家子网 + 受信任的搜索爬虫。
* **黑名单 drop 列表** (`drop_ipv4.txt` / `drop_ipv6.txt`) — 活跃的垃圾邮件情报源和恶意网络。
3. **服务器端防护:** 管理脚本 `bs.sh` 将这些列表导入到 `ipset`。来自白名单的流量访问端口 80/443 将不受任何限制地通过,而所有其他全球流量和洪水签名则会触发严格的 **L7 防洪** 内核级规则(每秒速率限制、自动临时封禁激进访客、对黑名单的即时丢弃动作)。
### 🇬🇧 英文:
1. **Database Aggregation:** The script collects subnets of the selected country (GeoIP), active spam/DDoS intelligence feeds, bad ASNs lists, and verified search engine bots (Google, Yandex, etc.).
2. **List Generation:** It outputs production-ready files into the `bspiski` folder:
* **White List** (`ipv4.txt` / `ipv6.txt`) — target country subnets + trusted search crawlers.
* **Black Drop-List** (`drop_ipv4.txt` / `drop_ipv6.txt`) — active spam feeds and malicious networks.
3. **Server-Side Protection:** The management script `bs.sh` imports these lists into `ipset`. Traffic from the whitelist to ports 80/443 passes seamlessly without restrictions, while all other global traffic and flood signatures hit strict **L7 Anti-Flood** kernel-level rules (rate-limiting per second, automated temporary banning of aggressive guests, and instant drop-actions for the blocklist).
## 💡 案例、安装与结果 / Case Study, Setup & Results
## 📚 完整文档 / Full Documentation
详细的配置和部署指南可在单独的文件中找到:
Comprehensive setup and deployment manuals are available in separate files:
* 🇷🇺 **[阅读俄语文档 (README_Russian.txt)](README_Russian.txt)**
* 🇬🇧 **[阅读英文文档 (README_English.txt)](README_English.txt)**
附言:希望这个方案能对某人有所帮助 ^_^
Telegram:@ebyebots_support
标签:DDoS防护, GeoIP, HTTP Flood防护, ipset, iptables, IP管理, L3/L4防护, 免费安全工具, 内核级防护, 后端开发, 流量过滤, 白名单, 网站保护, 网络安全, 网络防护, 脚本自动化, 自动化运维, 防火墙, 隐私保护, 黑名单