Shearwater CTF: Law

Another challenge, another post - this time it’s all about the text. It said the flag was somewhere in a file, this time a .docx file. I assumed it would be something tricky as the file format’s essentially a .zip file full of metadata and content files. I wasted a good five minutes messing around in the file, extracting it and poking through the XML files.

It seems it was even easier than that - once I opened it in Apple’s Pages. The capitals out of place all over the file lead me to the solution quick smart - the American “misspelling” of behaviour helped even more. :)

law, defined by Wikipedia

I copied the text to a string in python and did a simple filter.


stringvar = """[file contents]"""

flag = ""
for letter in stringvar:
    if letter.isupper() or letter in [ '{', '}' ]:
        flag += letter.lower()
print flag

I’ll admit - I had to add the underscores - but the essential part of the flag came out.


It’s irrelevant to the task, but the text is basically the content of the Wikipedia page ‘Law’.

#CTF #AusCERT2016 #python