Skip to content

Instantly share code, notes, and snippets.

@ITAYC0HEN
Created March 5, 2017 08:25
Show Gist options
  • Save ITAYC0HEN/ec45a2482194da314a3d805a8f228369 to your computer and use it in GitHub Desktop.
Save ITAYC0HEN/ec45a2482194da314a3d805a8f228369 to your computer and use it in GitHub Desktop.
[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