| Crates.io | rtk-cli |
| lib.rs | rtk-cli |
| version | 0.1.2 |
| created_at | 2025-10-14 09:36:43.898634+00 |
| updated_at | 2025-10-14 09:36:43.898634+00 |
| description | A powerful and efficient CLI toolkit built with Rust |
| homepage | https://github.com/zhuima/rtk |
| repository | https://github.com/zhuima/rtk |
| max_upload_size | |
| id | 1881929 |
| size | 381,991 |
RTK 是一个功能完整、高性能的 Rust 命令行安全工具包,集成了文件操作、系统监控、网络安全、文本处理、加密工具和 Web 安全等多个模块。无论你是安全研究员、系统管理员还是开发者,RTK 都能为你提供强大而便捷的工具支持。
# 1. 克隆仓库
git clone https://github.com/zhuima/rtk.git
cd rtk
# 2. 编译项目
cargo build --release
# 3. 运行工具
./target/release/rtk
# 4. 可选:安装到系统路径
cargo install --path .
cargo install toolkit-rs
# 查看版本信息
rtk --version
# 查看帮助信息
rtk --help
RTK 支持两种使用模式:
直接运行 rtk 进入交互式 Shell:
rtk
在交互模式中,你可以:
help 查看所有可用命令Tab 键自动补全命令exit 退出程序直接在命令行中执行特定命令:
rtk system info
rtk network scan 192.168.1.1
rtk crypto password --length 20
强大的文件管理和分析工具:
# 搜索文件(支持正则表达式)
rtk file search --pattern "*.rs" --dir ./src
# 获取目录统计信息
rtk file stats --dir ./
# 批量重命名文件
rtk file rename --pattern "old_name" --replacement "new_name" --dir ./
# 查找重复文件
rtk file duplicates --dir ./
主要功能:
全面的系统监控和信息收集:
# 显示系统详细信息
rtk system info
# 查看运行进程(默认显示前10个)
rtk system processes --limit 20
# 内存使用情况
rtk system memory
# 磁盘使用情况
rtk system disk
主要功能:
专业的网络安全和诊断工具:
# HTTP 请求测试
rtk network get --url https://httpbin.org/get --headers
# 网络连通性测试
rtk network ping --host google.com --count 5
# 端口扫描(支持服务识别)
rtk network scan --target 192.168.1.1 --start-port 1 --end-port 1000
# DNS 查询
rtk network dns --domain example.com
主要功能:
高效的文本分析和处理工具:
# 文本搜索(支持正则表达式)
rtk text grep --pattern "fn main" --file src/main.rs --line-numbers
# 文本替换
rtk text replace --pattern "old_text" --replacement "new_text" --file data.txt
# 文件统计
rtk text count --file README.md --lines --words --chars
# 文件排序
rtk text sort --file data.txt
主要功能:
全面的加密和安全工具:
# 文件哈希计算
rtk crypto hash --file data.txt --algorithm sha256
# 安全密码生成
rtk crypto password --length 16 --symbols
# Base64 编码/解码
rtk crypto base64 "Hello World"
rtk crypto base64 "SGVsbG8gV29ybGQ=" --decode
# 凯撒密码
rtk crypto caesar "secret message" --shift 3
主要功能:
专业的 Web 安全测试工具:
# Web 目录扫描
rtk web scan --target http://example.com --threads 50 --extensions php,html,js
# Web 信息收集
rtk web recon --target http://example.com
主要功能:
专业的 SSL/TLS 证书管理和监控工具:
# SSL/TLS 证书信息检查
rtk cert info --domain example.com --port 443 --chain
# 证书有效期监控
rtk cert monitor --file domains.txt --days 30
rtk cert monitor --domain example.com --days 60
# 生成 CSR 证书签名请求
rtk cert generate --domain example.com --organization "My Company" --country "US" --output example.com
主要功能:
# 1. 目标信息收集
rtk network dns --domain target.com
rtk web recon --target https://target.com
# 2. 端口扫描
rtk network scan --target target.com --start-port 1 --end-port 65535
# 3. Web 目录扫描
rtk web scan --target https://target.com --threads 100 --recursive
# 4. 生成报告密码
rtk crypto password --length 20 --symbols
# 1. SSL 证书检查
rtk cert info --domain google.com --port 443 --chain
# 2. 批量监控证书有效期
echo -e "google.com\nfacebook.com\ngithub.com" > domains.txt
rtk cert monitor --file domains.txt --days 30
# 3. 生成新的 CSR
rtk cert generate --domain myapp.example.com \
--organization "My Company" \
--country "US" \
--state "California" \
--city "San Francisco" \
--output myapp.example.com
# 1. 系统健康检查
rtk system info
rtk system memory
rtk system disk
# 2. 日志文件分析
rtk text grep --pattern "ERROR" --file /var/log/app.log
rtk text count --file /var/log/app.log
# 3. 文件清理
rtk file duplicates --dir /home/user/Downloads
rtk file stats --dir /var/log
# 1. 代码搜索
rtk file search --pattern "TODO" --dir ./src
# 2. API 测试
rtk network get --url http://localhost:8080/api/health --headers
# 3. 文件完整性验证
rtk crypto hash --file important_file.zip --algorithm sha256
--threads: 设置并发线程数(适用于扫描类命令)--timeout: 设置超时时间--output-file: 指定输出文件--verbose: 启用详细输出--help: 查看命令帮助# 设置默认超时时间
export RTK_TIMEOUT=30
# 设置默认线程数
export RTK_THREADS=50
RTK 支持从文件读取目标列表进行批量处理:
# 批量端口扫描
echo -e "192.168.1.1\n192.168.1.2\n192.168.1.3" > targets.txt
rtk network scan --file targets.txt
支持多种输出格式:
# JSON 格式输出
rtk web scan --target http://example.com --output-format json
# 保存到文件
rtk network scan --target 192.168.1.1 --output-file scan_results.txt
我们欢迎所有形式的贡献!
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)# 克隆仓库
git clone https://github.com/zhuima/rtk.git
cd rtk
# 安装开发依赖
cargo build
# 运行测试
cargo test
# 代码格式化
cargo fmt
# 代码检查
cargo clippy
本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。
⭐ 如果这个项目对你有帮助,请给我们一个 Star!
🐛 发现 Bug?请提交 Issue 或 Pull Request。
💡 有新想法?欢迎在 Discussions 中分享!