PicoCTF 2019 - like1000


like1000

Information

Points Category Level
250 Forensics Easy

Challenge

This .tar file got tarred alot. Also available at /problems/like1000_0_369bbdba2af17750ddf10cc415672f1c.

Hint

Try and script this, it’ll save you alot of time

Solution

So it’s a tar file (compressed file) and another tar file in it and go on… We probably need to extract the last file (and by the name of the challenge there 1000 nested files). Do it manually will take too much long, so let’s use our best friend! Python!

I wrote this python script to extract the files

import tarfile #Moudle used to work with tar files

for i in range(999, 0, -1): #For loop from 999 to 0 going down by 1
	filename = str(i) + '.tar' #Get the name of the file
	#print(filename) - just for debug
	tar = tarfile.open(filename) #Open the file
	tar.extractall() #Extract what in the file
	tar.close() #Close the file


Comments speak for themselves and now I can open the last tar file and there is a flag.png in it! The flag

Flag

picoCTF{l0t5_0f_TAR5}