Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Pragyan CTF] New Avenger writeup
# Full Writeup: https://www.megabeets.net/pragyan-ctf-new-avenger
from zipfile import ZipFile
import string
passwords =[]
i = 1
while True:
f=reversed(open("%s_image.jpg"%i).readlines())
passw = f.next()
try:
passw = passw[passw.index(':- ')+3:passw.index(' \n')]
except:
break
with ZipFile('image_%s.zip'%(i+1)) as zf:
zf.extractall(pwd=passw)
i+=1
passwords.append(passw)
locations = []
for p in passwords:
for c in range(26):
if p[c] in string.uppercase:
locations.append(c)
map_result = ''
for l in locations:
map_result += string.lowercase[l]
print "Result:", map_result
# Result: etitgepgztgxhiwthexstgbpc
# now do ROT11("etitgepgztgxhiwthexstgbpc") to get the flag
# flag: pragyanctf{peterparkeristhespiderman}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.