Skip to main content

Lightweight Remote Code Execution (RCE) & Obfuscation module using dpaste.com API v2 and GitHub Raw URLs

Project description

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

pip install PyVaultV2

Quick Start

1. Upload a local file to dpaste.com

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

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

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

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

# 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvaultv2-2.0.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvaultv2-2.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file pyvaultv2-2.0.0.tar.gz.

File metadata

  • Download URL: pyvaultv2-2.0.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyvaultv2-2.0.0.tar.gz
Algorithm Hash digest
SHA256 4d72fa076c52f4b145d26983248bd9676567fdb1b7c9ff8c6ce1b9980434a9d9
MD5 b9168dc9d809abb4399f0bf6bbb035d0
BLAKE2b-256 6e6ded7768abe4620a8e8db9c725a0e446f85a884d912d5fe7d41758c1457fcf

See more details on using hashes here.

File details

Details for the file pyvaultv2-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyvaultv2-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pyvaultv2-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 138ace606f7e2ec35a2fd261270b3523967212df18e98c046f9b75c33fc7a1e8
MD5 3385b64bc8875840c7fbda0ed6be2c93
BLAKE2b-256 0ec672eb98dadbbdfeb201f2fb6fbaa56e686118a6c676d48134295bbd8367f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page