dfirence/manpage-db
GitHub: dfirence/manpage-db
自动解析 man 手册页并生成 SQLite/JSON 数据库,用于威胁狩猎和 LOLBin 分析。
Stars: 0 | Forks: 0
# ly 'by' is preposition, translate to '通过', 'regex' keep. So '通过 regex 过滤'? But word order: Chinese usually puts the method before verb. 'Filter by regex' -> '通过 regex 过滤'. Similarly 'Search by name or description' -> '通过 name 或 description 搜索'? But keep 'name' and 'description' as English? They are common terms; many Chinese translations use '名称' and '描述'. But the instruction says keep technical jargon. 'name' and 'description' are not highly technical, but they are field names. I think it's safer to translate them since they are not proper nouns or tool names. However, the instruction says "keep all professional terms". In software, 'name' and 'description' are often used as is in documentation. But let's look at the previous line: "Filter by regex" - 'regex' kept. "Search by name or description" - I'll keep 'name' and 'description' as English to be consistent with keeping terms? Alternatively, translate 'name' to '名称' and 'description' to '描述'? The example didn't have such. I'll decide to translate common English words that are not clearly technical terms. But 'command' is technical, so keep. 'binary' is technical. 'flag' and 'switch' are technical. 'regex' technical. 'manpage-db' is a proper noun. 'path' is technical. So I'll keep those. For 'name' and 'description', they are not as technical, but they are part of command-line interface terminology. I'll translate them to Chinese: '名称' and '描述'. Similarly, 'all', 'first', 'specific', 'custom', 'full', 'limited' are adjectives that should be translated. So:
Unix/Linux 系统二进制文件的 man 手册页结构化 JSON 数据库。
将 `man` 输出解析为可查询的数据库,包含:
- **命令** — 名称、章节、摘要、描述、二进制路径
- **开关** — 短/长标志、是否取值
- **参数** — 位置操作数、必需/可选/可重复
## 设置
```
npm install
```
## 生成数据库
```
# Manpage-db: keep as 'manpage-db' (proper noun)
npm run generate
# Full generation (all discoverable binaries): translate 'full generation' -> '完整生成', keep 'discoverable binaries'? 'discoverable' is an adjective, could translate as '可发现的' but binaries is technical. I'll do: '完整生成 (所有可发现的 binaries)'? Or keep 'discoverable binaries' as is? The phrase 'all discoverable binaries' - 'discoverable' might be part of a tool's output. Better to keep as English: '所有 discoverable binaries'? But the instruction says keep technical jargon in original English, so 'discoverable binaries' is a phrase that might be jargon. I'll keep: '完整生成 (所有 discoverable binaries)'. But the parentheses and content: the original has parentheses, so keep them. Similarly for 'Limited run (first 50 commands)': '有限运行 (前50 commands)'? Keep 'commands' as English.
npm run generate -- --limit 50
# Filter by regex: '通过 regex 过滤' (verb first? Actually Chinese often puts the method before verb, but we can do '过滤 by regex'? No, better: '通过 regex 过滤' or 'Regex 过滤'? The original is 'Filter by regex', so '通过 regex 过滤' is natural.
npm run generate -- --filter "^(ls|grep|find|awk|sed)$"
# Custom output path: '自定义 output path' (keep 'output path')
npm run generate -- --output ./db/custom.json
```
## 查询数据库
```
# Find a specific command: '查找特定 command' (keep '')
npm run query -- find ls
# Search by name or description: '通过 name 或 description 搜索'? Or '通过名称或描述搜索'? I'll go with keeping 'name' and 'description' as English since they are common in technical contexts. But let's see consistency: 'name' and 'description' are not as specific as 'regex' or 'flag'. I think it's safer to translate them because they are not proprietary terms. Many Chinese translations of such phrases use '名称' and '描述'. The instruction says "keep all professional terms... in their original English form". 'name' and 'description' are not specifically professional terms; they are generic. So I'll translate: '通过名称或描述搜索'.
npm run query -- search "file"
# Find commands that accept a specific flag: '查找接受特定 flag 的 commands'? Keep 'flag' and 'commands'. Or '查找接受特定 flag 的命令'? Since 'command' is a term, I'll keep as 'commands' plural, but English plural in Chinese might be awkward. I'll keep as 'commands' (English). But many Chinese translations keep '命令' for 'command'. To be consistent with 'command' in previous line, I kept 'command' as English. So here also keep 'commands'.
npm run query -- switch "-r"
# List all switches for a command: '列出某个 command 的所有 switches'? Keep 'switches' and 'command'.
npm run query -- switches grep
```
## 数据库架构
```
interface ManPageDatabase {
version: string;
generatedAt: string;
platform: string;
commandCount: number;
commands: Record;
}
```
完整类型定义请参见 `src/types.ts`。
## 程序化使用
```
import { findCommand, searchCommands, findBySwitch } from "./src/query.js";
```
标签:AMSI绕过, GNU通用公共许可证, Homebrew安装, LOLBin分析, man pages, MITM代理, Node.js, SQLite, Unix/Linux, 二进制发布, 命令解析, 威胁检测, 开源工具, 数据库, 暗色界面, 结构化数据, 自动化攻击