| Crates.io | check_txt |
| lib.rs | check_txt |
| version | 0.1.0 |
| created_at | 2025-06-17 04:07:49.189446+00 |
| updated_at | 2025-06-17 04:07:49.189446+00 |
| description | A powerful file security checker for TXT and EPUB files with virus scanning capabilities |
| homepage | |
| repository | https://github.com/pjiaquan/check_txt |
| max_upload_size | |
| id | 1715173 |
| size | 1,607,333 |
Check TXT is a powerful Rust-based file security checker designed to analyze text files, EPUB files, and other document formats for potential security threats, malicious content, and suspicious patterns. It provides both command-line interface (CLI) and web-based interface for easy file analysis.
The tool performs comprehensive security analysis including:
# Clone the repository
git clone <repository-url>
cd check_txt
# Build the project
cargo build --release
# The binary will be available at target/release/check_txt
# Build Docker image
docker build -t check_txt .
# Run with Docker Compose
docker-compose up
Create a .env file in the project root:
# Required for virus scanning
VIRUSTOTAL_API_KEY=your_virustotal_api_key_here
To enable virus scanning functionality:
.env file# Check a single file
check_txt --path /path/to/file.txt --file-type txt
# Check a directory of files
check_txt --path /path/to/directory --file-type txt
# Enable deep scanning
check_txt --path /path/to/file.epub --file-type epub --deep-scan
# Enable virus scanning
check_txt --path /path/to/file.txt --file-type txt --virus-scan
# Set custom file size limit (in MB)
check_txt --path /path/to/file.txt --file-type txt --max-size 50
# Start web server
check_txt --web
Start the web server:
check_txt --web
Open your browser and navigate to http://127.0.0.1:8090
Upload files through the web interface for analysis
| Option | Short | Description | Default |
|---|---|---|---|
--path |
-p |
Path to file or directory to check | Required |
--file-type |
-f |
File type to check (txt, epub) | Required |
--max-size |
-m |
Maximum file size in MB | 100 |
--deep-scan |
-d |
Enable deep scanning | false |
--virus-scan |
-v |
Enable virus scanning | false |
--web |
-w |
Start web server | false |
check_txt --path document.txt --file-type txt
check_txt --path book.epub --file-type epub --deep-scan --virus-scan --max-size 200
check_txt --path ./documents --file-type txt --deep-scan
✅ File appears to be secure!
⚠️ Found potential security issues:
- Suspicious code pattern found: (?i)(eval\s*\()
- Advertisement pattern found: (?i)(click here)
- Potential malware pattern found: (?i)(\.exe)
check_txt/
├── src/
│ ├── main.rs # Main CLI application
│ ├── virus_check.rs # VirusTotal integration
│ └── web_server.rs # Web server implementation
├── static/
│ └── index.html # Web interface
├── temp/ # Temporary file storage
├── Cargo.toml # Rust dependencies
├── Dockerfile # Docker configuration
└── docker-compose.yml # Docker Compose setup
This project is licensed under the MIT License - see the LICENSE file for details.
Check TXT 是一个基于 Rust 的强大文件安全检查器,专为分析文本文件、EPUB 文件和其他文档格式中的潜在安全威胁、恶意内容和可疑模式而设计。它提供命令行界面(CLI)和基于 Web 的界面,方便进行文件分析。
该工具执行全面的安全分析,包括:
# 克隆仓库
git clone <repository-url>
cd check_txt
# 构建项目
cargo build --release
# 二进制文件将位于 target/release/check_txt
# 构建 Docker 镜像
docker build -t check_txt .
# 使用 Docker Compose 运行
docker-compose up
在项目根目录创建 .env 文件:
# 病毒扫描必需
VIRUSTOTAL_API_KEY=your_virustotal_api_key_here
要启用病毒扫描功能:
.env 文件中# 检查单个文件
check_txt --path /path/to/file.txt --file-type txt
# 检查目录中的文件
check_txt --path /path/to/directory --file-type txt
# 启用深度扫描
check_txt --path /path/to/file.epub --file-type epub --deep-scan
# 启用病毒扫描
check_txt --path /path/to/file.txt --file-type txt --virus-scan
# 设置自定义文件大小限制(MB)
check_txt --path /path/to/file.txt --file-type txt --max-size 50
# 启动 Web 服务器
check_txt --web
启动 Web 服务器:
check_txt --web
打开浏览器并导航到 http://127.0.0.1:8090
通过 Web 界面上传文件进行分析
| 选项 | 简写 | 描述 | 默认值 |
|---|---|---|---|
--path |
-p |
要检查的文件或目录路径 | 必需 |
--file-type |
-f |
要检查的文件类型(txt, epub) | 必需 |
--max-size |
-m |
最大文件大小(MB) | 100 |
--deep-scan |
-d |
启用深度扫描 | false |
--virus-scan |
-v |
启用病毒扫描 | false |
--web |
-w |
启动 Web 服务器 | false |
check_txt --path document.txt --file-type txt
check_txt --path book.epub --file-type epub --deep-scan --virus-scan --max-size 200
check_txt --path ./documents --file-type txt --deep-scan
✅ File appears to be secure!
⚠️ Found potential security issues:
- Suspicious code pattern found: (?i)(eval\s*\()
- Advertisement pattern found: (?i)(click here)
- Potential malware pattern found: (?i)(\.exe)
check_txt/
├── src/
│ ├── main.rs # 主 CLI 应用程序
│ ├── virus_check.rs # VirusTotal 集成
│ └── web_server.rs # Web 服务器实现
├── static/
│ └── index.html # Web 界面
├── temp/ # 临时文件存储
├── Cargo.toml # Rust 依赖项
├── Dockerfile # Docker 配置
└── docker-compose.yml # Docker Compose 设置
本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。