Helpers
OSWE Helper Scripts & Functions Cheat Sheet
1) Hashing & Encoding (multi‑lang)
Python
import hashlib, base64
# MD5 / SHA1 / SHA256
print('MD5:', hashlib.md5(b'password').hexdigest())
print('SHA1:', hashlib.sha1(b'password').hexdigest())
print('SHA256:', hashlib.sha256(b'password').hexdigest())
# Base64 (std + urlsafe)
raw = b'payload'
enc = base64.b64encode(raw).decode()
urlenc = base64.urlsafe_b64encode(raw).decode().rstrip('=')
print('b64:', enc)
print('b64url:', urlenc)
print('dec:', base64.b64decode(enc).decode())PHP
Java
C# (.NET)
Node.js
2) JWT Manipulation (decode/forge)
Python (manual decode/forge)
Node.js (modify payload, keep header)
Python (sign HS256 with known/guessable secret)
3) Symmetric Crypto Abuse (AES ECB/CTR)
Python (PyCryptodome)
PHP (openssl)
C# (ECB)
4) File Upload Tricks
MIME spoofing via curl
PHP polyglot GIF
Double extension bypass
Node.js server‑side content‑type trust
5) Auth Bypass Helpers
Timestamp‑based token (replicate server logic)
Java predictable PRNG
C# weak reset code
Python HMAC token (if key leaked)
6) (De)Serialization Payloads
PHP __destruct gadget
Python Pickle reduce RCE
Java Serializable gadget (custom class)
Node.js (node-serialize)
7) Command Execution Wrappers
Python
PHP
Java
Node.js
C#
8) Misc Utilities
URL encode/decode (Python)
Base64url helpers (PHP)
Random string (Python)
Padding XOR helper (Python)
9) Drop‑in PoC Helpers (requests wrapper)
Python HTTP client with evidence capture
Node.js fetch with cookie injection
10) WebSocket helper (Python)
Last updated