Skip to content

Instantly share code, notes, and snippets.

Created Feb 12, 2021
What would you like to do?
#!/usr/bin/env python3
import sys
import re
import random
import base64
with open(sys.argv[1], "rb") as f:
lines = f.readlines()
obfuscated_lines = b""
for line in lines:
matches = re.findall(b'"[^"]*"', line)
for match in matches:
replace = b'$([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String("' + base64.b64encode(match[1:-1]) + b'")))'
line = line.replace(match, replace)
obfuscated_lines += line
with open(sys.argv[1] + '.obfu', 'wb+') as f:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment