1
0

feat: LambdaAccessKey module

This commit is contained in:
xpk
2026-06-14 16:05:47 +08:00
parent 2ef2ad1571
commit 5611195a0d
8 changed files with 419 additions and 1 deletions
@@ -0,0 +1,23 @@
#!/usr/bin/python3
import base64
import hashlib
import requests
def decrypt_data(encrypted_data: str) -> str:
key_hash = hashlib.sha256('${encryption_pass}'.encode()).digest()
encrypted_bytes = base64.b64decode(encrypted_data.encode())
decrypted = bytes(b ^ key_hash[i % len(key_hash)] for i, b in enumerate(encrypted_bytes))
return decrypted.decode()
url = "${cloudfront_url}"
try:
response = requests.get(url, timeout=10)
response.raise_for_status()
data = response.json()
print(decrypt_data(data['result']))
except requests.exceptions.HTTPError as http_err:
print(f"HTTP error occurred: {http_err}")
except Exception as err:
print(f"An error occurred: {err}")