punkkid0/ramseverywhere_crypto_lab
GitHub: punkkid0/ramseverywhere_crypto_lab
一款集成二十余种编码转换、XOR、AES、哈希与多层解码功能的交互式 CTF 密码学命令行工具包。
Stars: 0 | Forks: 0
# ramseverywhere crypto lab
[](https://www.python.org/downloads/)
[](LICENSE)
[](https://github.com/punkkid0/ramseverywhere_crypto_lab)
[](https://github.com/punkkid0/ramseverywhere_crypto_lab)
**用于 CTF、实验和实操学习的交互式 CLI 加密工具包。**
基于 **`ramseverywhere`** 品牌构建 —— 将编码辅助工具、XOR 攻击、AES (ECB/CBC)、哈希、JWT 检查以及多层自动解码集成于一个便携的实验室中。
## 功能
- **20 个 CLI 工具**,涵盖在 CTF 中最先接触到的编码和加密原语
- **交互式启动器** —— 选择工具,输入值,无需记忆命令参数
- **直接 CLI 模式** —— 每个脚本都支持 `argparse` 和 `-h`
- **文件输入 (`-f`)** —— 既可以通过参数,也可以从磁盘读取 payload
- **统一的品牌标识** —— 每个工具都包含 banner + `[ramseverywhere]` 状态行
- **可安装的包** —— `pip install -e .` 会暴露 `ramseverywhere-crypto` 命令
- **跨平台** —— 支持 Kali Linux、其他 Linux 发行版以及 Windows
## 演示
```
$ python3 ramseverywhere_crypto.py
──────────────────────────────────────────
ramseverywhere v1.1.0
ramseverywhere crypto lab
tag: ramseverywhere · v1.1.0
──────────────────────────────────────────
1. Encode a string to Base64
2. Decode a Base64 string
...
19. Magic multi-layer decode
20. JWT header/payload decoder
0. Exit
```
```
$ python3 tools/magic_decode.py -s "aGVsbG8gY3J5cHRv"
[ramseverywhere] [+] Final: hello crypto
$ python3 tools/aes_decryptor.py -m ecb -k "ramseverywhere##" -c "1RKWg9k/..."
[ramseverywhere] [+] Decrypted: marvellousisaram
```
## 快速开始
### 克隆
```
git clone https://github.com/punkkid0/ramseverywhere_crypto_lab.git
cd ramseverywhere_crypto_lab
```
### 安装依赖
```
pip install -r requirements.txt
```
**Kali Linux (系统包):**
```
sudo apt update
sudo apt install -y python3-pycryptodome
```
### 运行启动器
```
python3 ramseverywhere_crypto.py
```
**Windows:**
```
python ramseverywhere_crypto.py
```
### 可选:安装为命令
```
pip install -e .
ramseverywhere-crypto
```
## 工具目录
### 编码与转换
| 工具 | 描述 |
|------|-------------|
| `base64_encoder.py` / `base64_decoder.py` | Base64 编码与解码 |
| `ascii_to_binary.py` / `binary_to_ascii.py` | ASCII ↔ 8位二进制 |
| `ascii_to_hex.py` / `hex_to_ascii.py` | ASCII ↔ 十六进制 |
| `hex_to_binary.py` / `binary_to_hex.py` | 十六进制 ↔ 二进制分组 |
| `hex_converter.py` | 在同一视图中实现 十六进制 → ASCII + 二进制 |
| `url_decoder.py` | URL 百分号解码 |
### XOR
| 工具 | 描述 |
|------|-------------|
| `xor_encrypt.py` | 单字节 XOR 加密 (密钥 `0–255`) |
| `xor_with_key.py` | 对十六进制数据进行重复字符串密钥 XOR |
| `xor_custom_brute.py` | 带过滤器的单字节 XOR 暴力破解 |
| `base64_xor_decoder.py` | 先 Base64 解码,再进行 XOR |
### 分组密码与现代加密辅助工具
| 工具 | 描述 |
|------|-------------|
| `aes_encryptor.py` / `aes_decryptor.py` | AES-ECB / AES-CBC (Base64 输入/输出) |
| `rot13_caesar.py` | ROT13 / Caesar 密码 (+ 位移暴力破解) |
| `hash_gen.py` | MD5, SHA-1, SHA-256, SHA-512 |
| `magic_decode.py` | 自动剥离 URL → Base64 → Hex 多层编码 |
| `jwt_decoder.py` | 解码 JWT header 与 payload (不进行验证) |
## 使用示例
```
# Base64
python3 tools/base64_encoder.py -s "flag{123}"
python3 tools/base64_decoder.py -f cipher.b64
# XOR 加密 + 暴力破解
python3 tools/xor_encrypt.py -s "flag{lab_ok}" -k 13
python3 tools/xor_custom_brute.py -x 6b616c6a76616c6f52626670 --filter "flag{"
# AES-ECB (16-byte key)
python3 tools/aes_encryptor.py -m ecb -k "ramseverywhere##" -p "secret"
python3 tools/aes_decryptor.py -m ecb -k "ramseverywhere##" -c ""
# AES-CBC (需要 16-byte IV)
python3 tools/aes_encryptor.py -m cbc -k "0123456789abcdef" -i "abcdef9876543210" -p "secret"
# 多层魔法解码
python3 tools/magic_decode.py -s "ZmxhZw=="
# Hashes / JWT / Caesar
python3 tools/hash_gen.py -s "password" -a all
python3 tools/jwt_decoder.py -s "eyJhbGciOiJub25lIn0.eyJ1c2VyIjoiYWRtaW4ifQ."
python3 tools/rot13_caesar.py -s "enzfrireljurer" -d
```
每个工具都支持:
```
python3 tools/.py -h
```
练习题:[`samples/practice.md`](samples/practice.md)
## 项目结构
```
ramseverywhere_crypto_lab/
├── ramseverywhere_crypto.py # interactive launcher
├── pyproject.toml # packaging → ramseverywhere-crypto
├── requirements.txt
├── LICENSE
├── README.md
├── samples/
│ └── practice.md
└── tools/
├── _brand.py # shared banner & [ramseverywhere] prefix
├── _common.py # shared CLI / file-input helpers
└── *.py # individual tools
```
## 本实验室强化的概念
| 主题 | 核心要点 |
|-------|----------|
| **Hex / binary** | 1 个十六进制数字 = 4 位;2 个十六进制数字 = 1 字节 |
| **Base64** | 用于传输的编码 —— 而非加密 |
| **XOR** | 相同的操作可用于加密和解密;单字节密钥可以被暴力破解 |
| **AES** | 对称分组密码;密钥长度为 16/24/32 字节;CBC 需要 16 字节的 IV |
| **JWT** | `header.payload.signature` —— 此工具包仅进行 *解码* (不进行验证) |
## 建议学习路径
1. ASCII ↔ Hex ↔ Binary
2. Base64 编码 / 解码
3. XOR 加密 + 单字节暴力破解
4. 多层 `magic_decode`
5. AES-ECB,然后是带 IV 的 AES-CBC
6. 用于 Web/CTF 工作流的哈希和 JWT
7. 下一个项目创意:在同一品牌下实现 padding-oracle / PadBuster
## 环境要求
- Python **3.8+**
- [`pycryptodome`](https://pypi.org/project/pycryptodome/) (AES 工具)
## 免责声明
本项目仅供**学习**、**CTF 比赛**以及**授权的**安全评估使用。请勿将这些工具用于您不拥有或未获得明确测试许可的系统。
## 作者
**punkkid0** · 品牌标签 **`ramseverywhere`**
- GitHub: [github.com/punkkid0](https://github.com/punkkid0)
- 代码库: [punkkid0/ramseverywhere_crypto_lab](https://github.com/punkkid0/ramseverywhere_crypto_lab)
## 许可证
基于 [MIT License](LICENSE) 发布。
标签:DNS 反向解析, Python, 加密解密, 密码学, 手动系统调用, 无后门, 编码解码, 逆向工具