Skip to content

Instantly share code, notes, and snippets.

@Geobm
Created February 20, 2021 00:27
Show Gist options
  • Save Geobm/b2ae9c3f9cfb119d53320678dacb8b31 to your computer and use it in GitHub Desktop.
Save Geobm/b2ae9c3f9cfb119d53320678dacb8b31 to your computer and use it in GitHub Desktop.
Tenablectf stego- a3s turtless
"""
Created on Fri Feb 19 16:30:44 2021
@author: Geovani BM
"""
import zipfile
def main():
parent_file_name = 'turtles128.zip'
pswd = '0'
global bits
with zipfile.ZipFile(parent_file_name, 'r') as parent_file:
parent_file.extractall(pwd=bytes(pswd, 'utf-8'))
next_zip_name = parent_file.namelist()[0] # getting the first child
while True:
try:
if (pswd == '0'):
with zipfile.ZipFile(next_zip_name, 'r') as child_file:
child_file.extractall(pwd=bytes(pswd, 'utf-8')) # extracting the zip
next_zip_name = child_file.namelist()[0] # getting the next zip name
bits.append(int(pswd))
##print(child_file)
print(pswd,end='')
pswd = '1'
elif (pswd == '1'):
with zipfile.ZipFile(next_zip_name, 'r') as child_file:
child_file.extractall(pwd=bytes(pswd, 'utf-8'))
next_zip_name = child_file.namelist()[0]
bits.append(int(pswd))
##print(child_file)
print(pswd,end='')
pswd = '1'
except:
if(pswd=='1'):
pswd='0'
else:
pswd='1'
if __name__ == '__main__':
main()
bits = []
print(bits)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment