{"id":1241,"date":"2019-09-10T22:00:29","date_gmt":"2019-09-10T14:00:29","guid":{"rendered":"http:\/\/van-yzt.com\/?p=1241"},"modified":"2019-09-10T22:00:29","modified_gmt":"2019-09-10T14:00:29","slug":"bandit-level-21-%e2%86%92-level-22","status":"publish","type":"post","link":"https:\/\/huzi-baozi.com\/?p=1241","title":{"rendered":"Bandit Level 21 \u2192 Level 22"},"content":{"rendered":"<p>A program is running automatically at regular intervals from cron, the time-based job scheduler. Look in \/etc\/cron.d\/ for the configuration and see what command is being executed.<\/p>\n<h2>\n\u89e3\u5bc6<\/h2>\n<pre><code class=\"language-shell\">bandit21@bandit:~$ ls -l \/etc\/cron.d\/\ntotal 12\n-rw-r--r-- 1 root root 120 Oct 16  2018 cronjob_bandit22\n-rw-r--r-- 1 root root 122 Oct 16  2018 cronjob_bandit23\n-rw-r--r-- 1 root root 120 Oct 16  2018 cronjob_bandit24\nbandit21@bandit:~$ crontab -l\ncrontabs\/bandit21\/: fopen: Permission denied\nbandit21@bandit:~$ cat \/etc\/cron.d\/cronjob_bandit22\n@reboot bandit22 \/usr\/bin\/cronjob_bandit22.sh &amp;&gt; \/dev\/null\n* * * * * bandit22 \/usr\/bin\/cronjob_bandit22.sh &amp;&gt; \/dev\/null\nbandit21@bandit:~$ cat \/usr\/bin\/cronjob_bandit22.sh\n#!\/bin\/bash\nchmod 644 \/tmp\/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv\ncat \/etc\/bandit_pass\/bandit22 &gt; \/tmp\/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv\nbandit21@bandit:~$ cat \/tmp\/t7O6lds9S0RqQh9aMcz6ShpAoZKF7fgv\nYk7owGAcWjwMVRwrTesJEwB7WVOiILLI\n<\/code><\/pre>\n<h2>\n\u77e5\u8bc6\u70b9<\/h2>\n<ol>\n<li>\ncron\u662flinux\u7684\u5b9a\u65f6\u4efb\u5de5\u5177\uff1b<\/li>\n<li>\n<code>crontab<\/code>\u67e5\u770b\u8fd0\u884c\u5b9a\u65f6\u4efb\u52a1\uff08\u5728\u8fd9\u91cc\u4e0d\u80fd\u4f7f\u7528\uff09\uff1b<\/li>\n<li>\n\u6839\u636e\u63d0\u793a\uff0c\u67e5\u770b<code>\/etc\/cron.d\/<\/code>\u4e0b\u7684\u5b9a\u65f6\u4efb\u52a1\uff1b<\/li>\n<li>\n\u67e5\u770b\u76f8\u5173\u811a\u672c\uff0c\u53d1\u73b0\u662f\u628a\u5bc6\u7801\u5199\u5230\/tmp\u4e0b\u7684\u4e00\u4e2a\u6587\u4ef6\uff0c\u67e5\u770b\u5f97\u5230\u5bc6\u7801\uff1b<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>A program is running automatically at regular intervals from cron, the time-based job scheduler. Look in \/etc\/cron.d\/ for the configuration and see what command is being executed. \u89e3\u5bc6 bandit21@bandit:~$ ls -l \/etc\/cron.d\/ total 12 -rw-r&#8211;r&#8211; 1 root root 120 Oct 16 2018 cronjob_bandit22 -rw-r&#8211;r&#8211; 1 root root 122 Oct 16 2018 cronjob_bandit23 -rw-r&#8211;r&#8211; 1 root &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/huzi-baozi.com\/?p=1241\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Bandit Level 21 \u2192 Level 22&#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-1241","post","type-post","status-publish","format-standard","hentry","category-bandit"],"_links":{"self":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1241","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=1241"}],"version-history":[{"count":1,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1241\/revisions"}],"predecessor-version":[{"id":1242,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1241\/revisions\/1242"}],"wp:attachment":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}