Files
PentestPilot/bin/crypto/encoders.py
T
PentestPilot Bot 461c14d676 feat: bootstrap PentestPilot toolkit, docs, and orchestrators
Initial commit of PentestPilot — AI‑assisted pentest recon and orchestration toolkit.\n\nHighlights:\n- Resumeable pipelines (full_pipeline) with manifest state and elapsed timings\n- Rich dashboard (colors, severity bars, durations, compact/json modes)\n- Web helpers: httpx→nuclei auto, tech routing + quick scanners\n- Agents: multi‑task orchestrator (web/full/ad/notes/post) with resume\n- AD/SMB, password utils, shells, transfer, privesc, tunnels\n- QoL scripts: proxy toggle, cleanup, tmux init, URL extractor\n- Docs: README (Quick Start + Docs Index), HOWTO (deep guide), TOOLKIT (catalog with examples)\n\nStructure:\n- bin/automation: pipelines, dashboard, manifest, resume, tech_actions\n- bin/web: routing, scanners, helpers\n- bin/ai: orchestrators + robust AI utils\n- bin/ad, bin/passwords, bin/shells, bin/transfer, bin/privesc, bin/misc, bin/dns, bin/scan, bin/windows, bin/hashes\n- HOWTO.md and TOOLKIT.md cross‑linked with examples\n\nUse:\n- settarget <target>; agent full <domain|hosts.txt>; dashboard --compact\n- See HOWTO.md for setup, semantics, and examples.
2025-10-08 16:00:22 +02:00

52 lines
1.6 KiB
Python
Executable File

#!/usr/bin/env python3
import sys, base64, urllib.parse
def usage():
print("Usage: encoders.py <cmd> [args]\n"
" b64e <data> base64 encode\n"
" b64d <data> base64 decode\n"
" urle <data> url encode\n"
" urld <data> url decode\n"
" hex <data> hex encode\n"
" unhex <hex> hex decode\n"
" xor <hex> <hex> xor two equal-length hex strings\n"
" rot <n> <text> caesar shift by n (n can be -ve)\n"
, file=sys.stderr)
sys.exit(1)
if len(sys.argv) < 3:
usage()
cmd = sys.argv[1]
if cmd == 'b64e':
print(base64.b64encode(sys.argv[2].encode()).decode())
elif cmd == 'b64d':
print(base64.b64decode(sys.argv[2]).decode(errors='ignore'))
elif cmd == 'urle':
print(urllib.parse.quote(sys.argv[2]))
elif cmd == 'urld':
print(urllib.parse.unquote(sys.argv[2]))
elif cmd == 'hex':
print(sys.argv[2].encode().hex())
elif cmd == 'unhex':
print(bytes.fromhex(sys.argv[2]).decode(errors='ignore'))
elif cmd == 'xor' and len(sys.argv) >= 4:
a = bytes.fromhex(sys.argv[2]); b = bytes.fromhex(sys.argv[3])
if len(a) != len(b):
print('Lengths differ', file=sys.stderr); sys.exit(2)
print(bytes(x^y for x,y in zip(a,b)).hex())
elif cmd == 'rot' and len(sys.argv) >= 4:
n = int(sys.argv[2]) % 26
out=''
for ch in sys.argv[3]:
if 'a' <= ch <= 'z':
out += chr((ord(ch)-97+n)%26+97)
elif 'A' <= ch <= 'Z':
out += chr((ord(ch)-65+n)%26+65)
else:
out += ch
print(out)
else:
usage()