{"id":1263,"date":"2019-09-12T00:16:27","date_gmt":"2019-09-11T16:16:27","guid":{"rendered":"http:\/\/van-yzt.com\/?p=1263"},"modified":"2019-09-12T00:16:27","modified_gmt":"2019-09-11T16:16:27","slug":"bandit-level-31-%e2%86%92-level-32","status":"publish","type":"post","link":"https:\/\/huzi-baozi.com\/?p=1263","title":{"rendered":"Bandit Level 31 \u2192 Level 32"},"content":{"rendered":"<h2>\u89e3\u5bc6<\/h2>\n<pre><code class=\"language-shell\">bandit31@bandit:~$ mktemp -d\n\/tmp\/tmp.UHFbV1v7DX\nbandit31@bandit:~$ cd \/tmp\/tmp.UHFbV1v7DX\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX$ git clone ssh:\/\/bandit31-git@localhost\/home\/bandit31-git\/repo\nCloning into 'repo'...\nCould not create directory '\/home\/bandit31\/.ssh'.\nThe authenticity of host 'localhost (127.0.0.1)' can't be established.\nECDSA key fingerprint is SHA256:98UL0ZWr85496EtCRkKlo20X3OPnyPSB5tB5RPbhczc.\nAre you sure you want to continue connecting (yes\/no)? yes\nFailed to add the host to the list of known hosts (\/home\/bandit31\/.ssh\/known_hosts).\nThis is a OverTheWire game server. More information on http:\/\/www.overthewire.org\/wargames\n\nbandit31-git@localhost's password:\nremote: Counting objects: 4, done.\nremote: Compressing objects: 100% (3\/3), done.\nremote: Total 4 (delta 0), reused 0 (delta 0)\nReceiving objects: 100% (4\/4), done.\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX$ cd repo\/\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX\/repo$ ls\nREADME.md\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX\/repo$ cat README.md\nThis time your task is to push a file to the remote repository.\n\nDetails:\n    File name: key.txt\n    Content: 'May I come in?'\n    Branch: master\n\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX\/repo$ echo 'May I come in?' &gt; key.txt\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX\/repo$ git add -A\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX\/repo$ git status\nOn branch master\nYour branch is up-to-date with 'origin\/master'.\nnothing to commit, working tree clean\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX\/repo$ cat .gitignore\n*.txt\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX\/repo$ :&gt;.gitignore\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX\/repo$ git status\nOn branch master\nYour branch is up-to-date with 'origin\/master'.\nChanges not staged for commit:\n  (use &quot;git add &lt;file&gt;...&quot; to update what will be committed)\n  (use &quot;git checkout -- &lt;file&gt;...&quot; to discard changes in working directory)\n\n        modified:   .gitignore\n\nUntracked files:\n  (use &quot;git add &lt;file&gt;...&quot; to include in what will be committed)\n\n        key.txt\n\nno changes added to commit (use &quot;git add&quot; and\/or &quot;git commit -a&quot;)\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX\/repo$ git add -A\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX\/repo$ git commit -m 'Try to resolve it.'\n[master e515574] Try to resolve it.\n 2 files changed, 1 insertion(+), 1 deletion(-)\n create mode 100644 key.txt\nbandit31@bandit:\/tmp\/tmp.UHFbV1v7DX\/repo$ git push\nCould not create directory '\/home\/bandit31\/.ssh'.\nThe authenticity of host 'localhost (127.0.0.1)' can't be established.\nECDSA key fingerprint is SHA256:98UL0ZWr85496EtCRkKlo20X3OPnyPSB5tB5RPbhczc.\nAre you sure you want to continue connecting (yes\/no)? yes\nFailed to add the host to the list of known hosts (\/home\/bandit31\/.ssh\/known_hosts).\nThis is a OverTheWire game server. More information on http:\/\/www.overthewire.org\/wargames\n\nbandit31-git@localhost's password:\nCounting objects: 4, done.\nDelta compression using up to 4 threads.\nCompressing objects: 100% (2\/2), done.\nWriting objects: 100% (4\/4), 339 bytes | 0 bytes\/s, done.\nTotal 4 (delta 0), reused 0 (delta 0)\nremote: ### Attempting to validate files... ####\nremote:\nremote: .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.\nremote:\nremote: Well done! Here is the password for the next level:\nremote: 56a9bf19c63d650ce78e6ec0354ee45e\nremote:\nremote: .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.\nremote:\nTo ssh:\/\/localhost\/home\/bandit31-git\/repo\n ! [remote rejected] master -&gt; master (pre-receive hook declined)\nerror: failed to push some refs to 'ssh:\/\/bandit31-git@localhost\/home\/bandit31-git\/repo'\n<\/code><\/pre>\n<h2>\n\u77e5\u8bc6\u70b9<\/h2>\n<ol>\n<li>\n<code>git<\/code>\u5de5\u5177\u4f7f\u7528<code>add<\/code>\u5c06\u6240\u6709\u5de5\u4f5c\u533a\u6539\u52a8\u5b58\u50a8\u5230\u6682\u5b58\u533a\uff1b<\/li>\n<li>\n<code>commit<\/code>\u547d\u4ee4\u5c06\u6682\u5b58\u533a\u5185\u5bb9\u5b58\u50a8\u5230\u7d22\u5f15\u533a\uff1b<\/li>\n<li>\n<code>push<\/code>\u547d\u4ee4\u5c06\u672c\u5730\u5dee\u5f02\u5185\u5bb9\u63d0\u4ea4\u5230\u8fdc\u7aef\uff1b<\/li>\n<li>\n\u8fd9\u91cc\u6709\u4e00\u4e2a<code>.gitignore<\/code>\u6587\u4ef6\uff0c\u7528\u4e8e\u6b63\u5219\u5339\u914d\u4e0d\u88ab<code>git<\/code>\u5bdf\u89c9\u5230\u6587\u4ef6\uff1b<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u5bc6 bandit31@bandit:~$ mktemp -d \/tmp\/tmp.UHFbV1v7DX bandit31@bandit:~$ cd \/tmp\/tmp.UHFbV1v7DX bandit31@bandit:\/tmp\/tmp.UHFbV1v7DX$ git clone ssh:\/\/bandit31-git@localhost\/home\/bandit31-git\/repo Cloning into &#8216;repo&#8217;&#8230; Could not create directory &#8216;\/home\/bandit31\/.ssh&#8217;. The authenticity of host &#8216;localhost (127.0.0.1)&#8217; can&#8217;t be established. ECDSA key fingerprint is SHA256:98UL0ZWr85496EtCRkKlo20X3OPnyPSB5tB5RPbhczc. Are you sure you want to continue connecting (yes\/no)? yes Failed to add the host to the list of known hosts &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/huzi-baozi.com\/?p=1263\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Bandit Level 31 \u2192 Level 32&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1263","post","type-post","status-publish","format-standard","hentry","category-bandit"],"_links":{"self":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1263"}],"version-history":[{"count":1,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1263\/revisions"}],"predecessor-version":[{"id":1264,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1263\/revisions\/1264"}],"wp:attachment":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}