{"id":4856,"date":"2023-11-22T20:38:11","date_gmt":"2023-11-22T11:38:11","guid":{"rendered":"https:\/\/www.photoguraphy.com\/?p=4856"},"modified":"2023-12-05T20:18:48","modified_gmt":"2023-12-05T11:18:48","slug":"picoctf-transformation-%ed%92%80%ec%9d%b4","status":"publish","type":"post","link":"https:\/\/www.photoguraphy.com\/?p=4856","title":{"rendered":"[picoCTF] Transformation \ud480\uc774"},"content":{"rendered":"<p>\uc870\ud68c\uc218: 12<\/p><h2>\ubb38\uc81c<\/h2>\n<p><code>I wonder what this really is... enc ''.join([chr((ord(flag[i]) &lt;&lt; 8) + ord(flag[i + 1])) for i in range(0, len(flag), 2)])<\/code><\/p>\n<hr \/>\n<p>enc \ud30c\uc77c\uc744 \ub2e4\uc6b4\ubc1b\uc544\uc11c \uc5f4\uc5b4\ubcf4\uba74 \uc774\uc0c1\ud55c \uae00\uc790\uac00 \ubcf4\uc778\ub2e4.<\/p>\n<p>\u7069\u636f\u4354\u467b\u3136\u5f62\u6974\u735f\u696e\u7374\u3334\u645f\u6f66\u5f38\u5f30\u3463\u3037\u3630\u647d<\/p>\n<p>\ubb54\ub9d0\uc778\uc9c0 \ucc57gpt\uc5d0\uac8c \ubc88\uc5ed\uc744 \ubd80\ud0c1\ud574\ubcf4\uc790.<\/p>\n<hr \/>\n<p><em>\uc81c\uacf5\ub41c \ud14d\uc2a4\ud2b8\ub294 \uc77c\ubd80 \ubb34\uc758\ubbf8\ud55c \ubb38\uc790\uc640 \uae30\ud638\ub85c \uc774\ub8e8\uc5b4\uc9c4 \uac83\uc73c\ub85c \ubcf4\uc785\ub2c8\ub2e4. \ubc88\uc5ed\ud560 \uc218 \uc788\ub294 \ud615\uc2dd\uc758 \uc5b8\uc5b4 \ub610\ub294 \uc758\ubbf8 \uc788\ub294 \ub0b4\uc6a9\uc774 \uc5c6\uae30 \ub54c\ubb38\uc5d0 \ud2b9\ubcc4\ud55c \uc758\ubbf8\uac00 \uc5c6\ub294 \ubb38\uc790\uc5f4\ub85c \ubcf4\uc785\ub2c8\ub2e4. \ucd94\uac00 \uc815\ubcf4\ub098 \ubc88\uc5ed\uc774 \ud544\uc694\ud55c \ub0b4\uc6a9\uc774 \uc788\ub2e4\uba74 \uc790\uc138\ud55c \uc815\ubcf4\ub97c \uc81c\uacf5\ud574 \uc8fc\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.<\/em><\/p>\n<hr \/>\n<p>\u314b\u314b\u314b\u314b\u314b\u314b<br \/>\n\uadf8\ub0e5 \ud558\uc790.<\/p>\n<p>\ubb38\uc81c\uc5d0\uc11c<\/p>\n<pre><code class=\"language-python line-numbers\">''.join([chr((ord(flag[i]) &lt;&lt; 8) + ord(flag[i + 1])) for i in range(0, len(flag), 2)])` \n<\/code><\/pre>\n<p>\uc774 \ubd80\ubd84\uc744 \ud574\uc11d \ud574 \ubcf4\uc790.<br \/>\n\uae00\uc790\ub97c \ud558\ub098 \uac00\uc838\uc640\uc11c flag[i]\uc5d0 \ub123\uc740 \ub2e4\uc74c 8\ube44\ud2b8\ub97c \uc88c\uce21\uc73c\ub85c \uc62e\uae30\uace0(2\uc9c4 \uc26c\ud504\ud2b8), \uadf8 \ube48 \uc790\ub9ac\uc5d0 flag[i+1]\uc744 \ub123\uc740 \ub2e4\uc74c \ud558\ub098\uc758 \uae00\uc790\ub85c \ub9cc\ub4e4\uace0 \ub2e4\uc2dc \ubc18\ubcf5\ud558\uace0... \ubb50 \uadf8\ub7f0 \uc791\uc5c5\uc744 \uac70\uce5c \uacb0\uacfc\ubb3c\uc774 enc \ud30c\uc77c\uc778 \uac83 \uac19\ub2e4. \uacb0\uad6d \uc9c0\uae08 \ud55c \uae00\uc790\ub294 \ucd1d 16\ube44\ud2b8.<\/p>\n<p>\uadf8\ub7fc \uc774 \uc791\uc5c5\uc744 \ubc18\ub300\ub85c \ud558\uba74 \ud480\ub9ac\uaca0\uc9c0.<\/p>\n<pre><code class=\"language-ruby line-numbers\">path = '.\/enc'\nfile = File.read(path)\narr = []\narrr = []\n\nfor num in 0..18\n    arr[num] = file.chars[num]\n    arrr[num] = arr[num].ord &gt;&gt; 8\n    print arrr[num].chr\n    res = arr[num].encode(\"UTF-16\").bytes\n    print res.last.chr\nend\n<\/code><\/pre>\n<hr \/>\n<h3>\ucf54\ub4dc \uc124\uba85<\/h3>\n<pre><code class=\"language-ruby line-numbers\">path = '.\/enc'\nfile = File.read(path)\narr = []\narrr = []\n<\/code><\/pre>\n<p>\uc774 \ubd80\ubd84\uc740 \ud574\ub2f9 \ud30c\uc77c\uc744 \ubd88\ub7ec\uc624\uace0 \ubc30\uc5f4\ubcc0\uc218\ub97c \uc120\uc5b8\ud558\ub294 \uacf3\uc774\ub2c8 \ub118\uc5b4\uac00\uc790.<\/p>\n<pre><code class=\"language-ruby line-numbers\">for num in 0..18\n~~\nend\n<\/code><\/pre>\n<p>0~\u115f18\uae4c\uc9c0 \ucd1d 19\ubc88 \ubc18\ubcf5\ud55c\ub2e4. \uae00\uc790\uc218\ub97c \uc54c\uc544\uc11c \uc77d\ub3c4\ub85d\ud574\ub3c4 \ub418\uc9c0\ub9cc \uc5b4\ucc28\ud53c 19\uc790\ub2c8\uae4c...\u314b\u314b<\/p>\n<pre><code class=\"language-ruby line-numbers\">arr[num] = file.chars[num]\narrr[num] = arr[num].ord &gt;&gt; 8\nprint arrr[num].chr\n<\/code><\/pre>\n<p>\ubd88\ub7ec\uc628 \ud30c\uc77c\uc758 \ud55c\uae00\uc790\ub97c arr\ubc30\uc5f4\uc5d0 \ub123\uace0<br \/>\narrr\ubc30\uc5f4\uc5d0\ub294 \uadf8 \uae00\uc790\ub97c \uc624\ub978\ucabd\uc73c\ub85c 8\ubc88 \uc26c\ud504\ud2b8\ud55c \uac12\uc744 \ub123\uc740 \ud6c4<br \/>\narrr\ubc30\uc5f4\uc5d0 \uc788\ub294 \uac12\uc744 \ud14d\uc2a4\ud2b8\ub85c \ucd9c\ub825\ud55c\ub2e4.<br \/>\nputs\ub294 \uc904\ubc14\uafc8\uc774 \uc788\uc5b4 \ubcf4\uae30 \ud798\ub4e4\uace0 print\ub294 \uc904\ubc14\uafc8\uc744 \ud558\uc9c0 \uc54a\uc544 \uc774\ub7f4 \ub54c \ud3b8\ud558\ub2e4.<\/p>\n<pre><code class=\"language-ruby line-numbers\">res = arr[num].encode(\"UTF-16\").bytes\nprint res.last.chr\n<\/code><\/pre>\n<p>arr \ubc30\uc5f4\uc5d0 \uc788\ub294 \uac12\uc744 utf-16\uc73c\ub85c \uc778\ucf54\ub529\ud558\uace0 \ubc14\uc774\ud2b8 \uac12\uc73c\ub85c \ubc14\uafd4 res\uc5d0 \uc800\uc7a5\ud55c \ub2e4\uc74c<br \/>\n\ub05d 1\ubc14\uc774\ud2b8(8\ube44\ud2b8)\ub9cc \ud14d\uc2a4\ud2b8\ub85c \ubc14\uafd4 \ucd9c\ub825\ud55c\ub2e4.<\/p>\n<hr \/>\n<p>\uadf8\ub9ac\uace0 \uc774 \ub8e8\ube44 \ud30c\uc77c\uc744 \uc2e4\ud589\ud55c\ub2e4.<\/p>\n<pre><code class=\"language-bash line-numbers\">\u276f ruby run.rb\n<\/code><\/pre>\n<p>\ub05d.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc870\ud68c\uc218: 12\ubb38\uc81c I wonder what this really is... enc ''.join([chr((ord(flag[i]) &lt;&lt; 8) + ord(flag[i + 1])) for i in range(0, len(flag), 2)]) enc \ud30c\uc77c\uc744 \ub2e4\uc6b4\ubc1b\uc544\uc11c \uc5f4\uc5b4\ubcf4\uba74 \uc774\uc0c1\ud55c \uae00\uc790\uac00 \ubcf4\uc778\ub2e4. \u7069\u636f\u4354\u467b\u3136\u5f62\u6974\u735f\u696e\u7374\u3334\u645f\u6f66\u5f38\u5f30\u3463\u3037\u3630\u647d \ubb54\ub9d0\uc778\uc9c0 \ucc57gpt\uc5d0\uac8c \ubc88\uc5ed\uc744 \ubd80\ud0c1\ud574\ubcf4\uc790. \uc81c\uacf5\ub41c \ud14d\uc2a4\ud2b8\ub294 \uc77c\ubd80 \ubb34\uc758\ubbf8\ud55c \ubb38\uc790\uc640 \uae30\ud638\ub85c \uc774\ub8e8\uc5b4\uc9c4 \uac83\uc73c\ub85c \ubcf4\uc785\ub2c8\ub2e4. \ubc88\uc5ed\ud560 \uc218 \uc788\ub294 \ud615\uc2dd\uc758 \uc5b8\uc5b4 \ub610\ub294 \uc758\ubbf8 \uc788\ub294 \ub0b4\uc6a9\uc774 \uc5c6\uae30 \ub54c\ubb38\uc5d0 \ud2b9\ubcc4\ud55c&hellip;<a href=\"https:\/\/www.photoguraphy.com\/?p=4856\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">[picoCTF] Transformation \ud480\uc774<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[54,53],"class_list":["post-4856","post","type-post","status-publish","format-standard","hentry","category-computer","tag-ctf","tag-picoctf"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.photoguraphy.com\/index.php?rest_route=\/wp\/v2\/posts\/4856","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.photoguraphy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.photoguraphy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.photoguraphy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.photoguraphy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4856"}],"version-history":[{"count":4,"href":"https:\/\/www.photoguraphy.com\/index.php?rest_route=\/wp\/v2\/posts\/4856\/revisions"}],"predecessor-version":[{"id":4863,"href":"https:\/\/www.photoguraphy.com\/index.php?rest_route=\/wp\/v2\/posts\/4856\/revisions\/4863"}],"wp:attachment":[{"href":"https:\/\/www.photoguraphy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.photoguraphy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.photoguraphy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}