Skip to content

Instantly share code, notes, and snippets.

@ctnguyenvn
Created September 30, 2018 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctnguyenvn/901ab781fd4bfc78503c037771bfb723 to your computer and use it in GitHub Desktop.
Save ctnguyenvn/901ab781fd4bfc78503c037771bfb723 to your computer and use it in GitHub Desktop.
challenge ransomware file decode D-CTF
#!/usr/bin/python3
import string
import sys
index = int(sys.argv[1])
char = str(sys.argv[2])
allp = string.ascii_letters + string.punctuation + string.digits
file = open('youfool.exe', 'rb').read()
key = ''
for i in allp:
key = chr(ord(i) ^ file[index])
if key == char:
print(i)
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment