Metadata-Version: 2.4
Name: PyVaultV2
Version: 2.0.0
Summary: Lightweight Remote Code Execution (RCE) & Obfuscation module using dpaste.com API v2 and GitHub Raw URLs
Home-page: https://github.com/GunYamazakii/Stripe-Charge
Author: Diwas XD
Author-email: 
License: MIT
Project-URL: Bug Tracker, https://github.com/GunYamazakii/Stripe-Charge/issues
Project-URL: Source Code, https://github.com/GunYamazakii/Stripe-Charge
Keywords: rce obfuscation dpaste remote-code-execution
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# PyVaultV2

**Lightweight Remote Code Execution (RCE) & Obfuscation Module**

> Backend: dpaste.com API v2 (primary) + GitHub Raw URLs (fallback)  
> Author: **Diwas XD**

---

## Features

- **Upload** local Python files to dpaste.com with built-in obfuscation (zlib + base64)
- **Remote Execution** of code via short dpaste session IDs or direct GitHub Raw URLs
- **Custom User-Agent** header on every request for identification
- **Zero third-party code storage** — your real code never touches external databases
- **Robust error handling** for missing files, network failures, 404s, and execution tracebacks
- **Automatic de-obfuscation** when fetching obfuscated payloads back

---

## Installation

```bash
pip install PyVaultV2
```

---

## Quick Start

### 1. Upload a local file to dpaste.com

```python
from pyvaultv2 import CodeManager

session_id = CodeManager.enc("my_secret.py", expiry_days=7)
# Output:
# [PyVaultV2] Upload successful!
# [PyVaultV2] Session ID : ABCDEF
# [PyVaultV2] URL        : https://dpaste.com/ABCDEF
```

### 2. Execute code via session ID

```python
CodeManager.run("ABCDEF")
# [PyVaultV2] Fetching from dpaste session: https://dpaste.com/ABCDEF.txt
# [PyVaultV2] Executing remote code ...
# [PyVaultV2] Done.
```

### 3. Execute code via GitHub Raw URL

```python
CodeManager.run("https://raw.githubusercontent.com/user/repo/main/script.py")
# [PyVaultV2] Fetching code from URL: https://raw.githubusercontent.com/...
# [PyVaultV2] Executing remote code ...
# [PyVaultV2] Done.
```

### 4. Convenience aliases

```python
from pyvaultv2 import upload, execute

upload("my_code.py")
execute("ABCDEF")
```

---

## API Reference

### `CodeManager.enc(file_path, expiry_days=7)`

Reads a local Python file, obfuscates it, and uploads it to dpaste.com.

| Parameter       | Type  | Default | Description                          |
|-----------------|-------|---------|--------------------------------------|
| `file_path`     | `str` | —       | Path to the local `.py` file         |
| `expiry_days`   | `int` | `7`     | dpaste.com retention period in days  |

**Returns:** `str | None` — The dpaste session ID, or `None` on failure.

### `CodeManager.run(target)`

Fetches remote Python code and executes it via `exec()`.

| Parameter  | Type  | Default | Description                                          |
|------------|-------|---------|------------------------------------------------------|
| `target`   | `str` | —       | dpaste session ID, full URL, or GitHub Raw URL       |

**Returns:** `None` — Executes code in a clean namespace.

---

## How Obfuscation Works

```
Source Code → zlib.compress() → base64.b64encode() → Upload to dpaste
dpaste Response → base64.b64decode() → zlib.decompress() → exec()
```

The obfuscated payload uses **symmetric compression + encoding** with no external crypto dependencies. The real code is never stored in plaintext on dpaste.

---

## Error Handling

PyVaultV2 handles the following error cases gracefully:

| Error Type               | Behaviour                              |
|--------------------------|----------------------------------------|
| Missing file             | Prints error, returns `None`           |
| Empty file               | Prints error, returns `None`           |
| Network failure          | Prints error, returns `None`           |
| HTTP 404 (not found)     | Prints error                           |
| HTTP non-200             | Prints error with response body        |
| Invalid session ID       | Prints error                           |
| Syntax error in code     | Prints traceback                       |
| Execution exception      | Prints full traceback                  |

---

## Publishing to PyPI

```bash
# 1. Install build tools
pip install --upgrade build twine

# 2. Build distribution
python -m build

# 3. Upload to PyPI
twine upload dist/*
```

---

## License

MIT License — Copyright (c) 2026 Diwas XD

---

## Disclaimer

This module is intended for **educational and authorized testing purposes only**. 
Never use remote code execution on systems you do not own or have permission to test.
