{"id":6533,"date":"2025-12-26T12:06:32","date_gmt":"2025-12-26T04:06:32","guid":{"rendered":"https:\/\/dingxuan.info\/wp\/?p=6533"},"modified":"2025-12-26T12:06:32","modified_gmt":"2025-12-26T04:06:32","slug":"%e4%bf%ae%e5%a4%8dreact2shell%e6%bc%8f%e6%b4%9e%e5%af%bc%e8%87%b4%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%9d%83%e9%99%90%e6%b3%84%e9%9c%b2-%e4%b9%8b%e4%ba%8c","status":"publish","type":"post","link":"https:\/\/dingxuan.info\/wp\/?p=6533","title":{"rendered":"\u4fee\u590dReact2Shell\u6f0f\u6d1e\u5bfc\u81f4\u670d\u52a1\u5668\u6743\u9650\u6cc4\u9732 \u4e4b\u4e8c"},"content":{"rendered":"<p>\u53c2\u8003\u8fd9\u7bc7\u5206\u6790\u62a5\u544a\uff0c\u91cd\u65b0\u505a\u4e00\u8f6e\u68c0\u67e5\u4fee\u590d\nhttps:\/\/www.huntress.com\/blog\/peerblight-linux-backdoor-exploits-react2shell<\/p>\n<p><strong>\u6838\u5fc3\u76f8\u4f3c\u70b9\uff1a<\/strong><\/p>\n<ol>\n<li><strong>\u4f2a\u88c5\u7cfb\u7edf\u6587\u4ef6\uff1a<\/strong> \u6587\u7ae0\u63d0\u5230\u6076\u610f\u8f6f\u4ef6\u4f1a\u5c06\u81ea\u5df1\u4f2a\u88c5\u6210\u770b\u4f3c\u5408\u6cd5\u7684\u7cfb\u7edf\u8fdb\u7a0b\u3002\u4f60\u9047\u5230\u7684 <code>\/bin\/systemd-daemon<\/code> \u6b63\u662f\u8fd9\u79cd\u5178\u578b\u624b\u6bb5\uff08\u771f\u6b63\u7684 systemd \u4e0d\u5728\u8fd9\u4e2a\u4f4d\u7f6e\uff0c\u4e5f\u4e0d\u53eb\u8fd9\u4e2a\u540d\u5b57\uff09\u3002<\/li>\n<li><strong>\u6301\u4e45\u5316\u673a\u5236\uff1a<\/strong> \u5229\u7528 Systemd \u670d\u52a1\uff08Service\uff09\u8fdb\u884c\u9a7b\u7559\uff0c\u786e\u4fdd\u6740\u4e0d\u6b7b\u3001\u91cd\u542f\u81ea\u6108\u3002<\/li>\n<li><strong>\u884c\u4e3a\u6a21\u5f0f\uff1a<\/strong> \u4f5c\u4e3a\u201c\u52a0\u8f7d\u5668\uff08Dropper\uff09\u201d\uff0c\u5b9a\u671f\u4ece C2 \u670d\u52a1\u5668\uff08\u4f60\u7684\u6848\u4f8b\u4e2d\u662f <code>185.196.9.41<\/code>\uff09\u4e0b\u8f7d\u5e76\u6267\u884c\u65b0\u7684\u6076\u610f\u811a\u672c\uff08<code>um2<\/code>\uff09\u3002<\/li>\n<\/ol>\n<p>\u65e2\u7136<strong>\u6682\u65f6\u4e0d\u80fd\u91cd\u88c5\u7cfb\u7edf<\/strong>\uff0c\u6211\u4eec\u9700\u8981\u5236\u5b9a\u4e00\u4e2a\u201c<strong>\u5916\u79d1\u624b\u672f\u5f0f<\/strong>\u201d \u7684\u6df1\u5ea6\u6e05\u7406\u65b9\u6848\u3002\u8bf7\u52a1\u5fc5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\uff0c<strong>\u4e00\u6b21\u6027\u3001\u8fde\u8d2f\u5730<\/strong>\u6267\u884c\uff0c\u4e0d\u8981\u4e2d\u65ad\uff0c\u4ee5\u9632\u75c5\u6bd2\u5229\u7528\u65f6\u95f4\u5dee\u590d\u6d3b\u3002<\/p>\n<!--more-->\n<hr \/>\n<h3 class=\"wp-block-heading\">\u6df1\u5ea6\u6e05\u7406\u65b9\u6848 (\u65e0\u91cd\u88c5\u7248)<\/h3>\n<h4 class=\"wp-block-heading\">\u7b2c\u4e00\u9636\u6bb5\uff1a\u5207\u65ad\u901a\u8baf\u4e0e\u9501\u5b9a\u73b0\u573a<\/h4>\n<p>\u5728\u52a8\u624b\u6740\u8fdb\u7a0b\u4e4b\u524d\uff0c\u5148\u5207\u65ad\u5b83\u4e0e\u5916\u754c\u7684\u8054\u7cfb\uff0c\u9632\u6b62\u5b83\u63a5\u6536\u6307\u4ee4\u6216\u4e0a\u4f20\u6570\u636e\u3002<\/p>\n<ol>\n<li>\n<p><strong>\u5c01\u9501\u6076\u610f IP (\u9632\u706b\u5899)<\/strong>\n\u9664\u4e86\u521a\u624d\u7684 IP\uff0c\u5efa\u8bae\u5c01\u9501\u6574\u4e2a\u7f51\u6bb5\uff08\u5982\u679c\u4e1a\u52a1\u5141\u8bb8\uff09\uff0c\u6216\u8005\u53ea\u5c01\u9501\u8be5\u7279\u5b9a IP\u3002<\/p>\n<pre><code class=\"language-bash\"># \u5c01\u9501\u4f60\u5728\u65e5\u5fd7\u4e2d\u770b\u5230\u7684\u6076\u610f IP\niptables -I INPUT -s 185.196.9.41 -j DROP\niptables -I OUTPUT -d 185.196.9.41 -j DROP\n\n# \u5982\u679c\u6709\u5176\u4ed6\u53ef\u7591 IP\uff0c\u7ee7\u7eed\u6dfb\u52a0\u3002\n# \u6bd4\u5982\u6587\u7ae0\u4e2d\u63d0\u5230\u7684 C2 \u57df\u540d\uff0c\u5982\u679c\u6709\u89e3\u6790\u51fa IP\uff0c\u4e5f\u4e00\u5e76\u5c01\u9501\u3002\n<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u4fee\u6539 DNS (\u9632\u6b62\u89e3\u6790\u6076\u610f\u57df\u540d)<\/strong>\n\u6682\u65f6\u5c06\u670d\u52a1\u5668 DNS \u4fee\u6539\u4e3a\u516c\u5171 DNS\uff08\u5982 8.8.8.8\uff09\uff0c\u9632\u6b62\u88ab\u672c\u5730\u88ab\u7be1\u6539\u7684 DNS \u52ab\u6301\u3002<\/p>\n<pre><code class=\"language-bash\">echo &quot;nameserver 8.8.8.8&quot; &gt; \/etc\/resolv.conf\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h4 class=\"wp-block-heading\">\u7b2c\u4e8c\u9636\u6bb5\uff1a\u5b9a\u4f4d\u5e76\u79fb\u9664\u670d\u52a1 (\u5173\u952e\u6b65\u9aa4)<\/h4>\n<p>\u5355\u7eaf <code>kill<\/code> \u8fdb\u7a0b\u6ca1\u7528\uff0c\u5fc5\u987b\u627e\u5230\u5b88\u62a4\u5b83\u7684 Systemd \u670d\u52a1\u6587\u4ef6\u3002<\/p>\n<ol>\n<li>\n<p><strong>\u901a\u8fc7 PID \u53cd\u67e5\u670d\u52a1\u540d<\/strong>\n\u4f60\u4e4b\u524d\u7684\u65e5\u5fd7\u663e\u793a\u6076\u610f\u8fdb\u7a0b PID \u662f <code>729<\/code>\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u627e\u51fa\u5b83\u5bf9\u5e94\u7684\u670d\u52a1\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-bash\">systemctl status 729\n<\/code><\/pre>\n<ul>\n<li><strong>\u89c2\u5bdf\u8f93\u51fa\uff1a<\/strong> \u5bfb\u627e <code>Loaded: loaded (\/etc\/systemd\/system\/xxxx.service; ...)<\/code> \u8fd9\u4e00\u884c\u3002<\/li>\n<li><strong>\u8bb0\u4e0b\uff1a<\/strong> \u90a3\u4e2a <code>.service<\/code> \u6587\u4ef6\u7684\u5b8c\u6574\u8def\u5f84\u548c\u540d\u5b57\uff08\u4f8b\u5982 <code>system-daemon.service<\/code> \u6216 <code>sys-update.service<\/code>\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u505c\u6b62\u5e76\u7981\u7528\u670d\u52a1<\/strong>\n\u5047\u8bbe\u670d\u52a1\u540d\u53eb <code>malicious-service<\/code> (\u8bf7\u66ff\u6362\u4e3a\u4f60\u67e5\u5230\u7684\u540d\u5b57)\uff1a<\/p>\n<pre><code class=\"language-bash\">systemctl stop malicious-service\nsystemctl disable malicious-service\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h4 class=\"wp-block-heading\">\u7b2c\u4e09\u9636\u6bb5\uff1a\u89e3\u9664\u9501\u5b9a\u5e76\u5220\u9664\u6587\u4ef6<\/h4>\n<p>\u6076\u610f\u8f6f\u4ef6\u901a\u5e38\u4f7f\u7528 <code>chattr +i<\/code> (immutable) \u5c5e\u6027\u9501\u5b9a\u6587\u4ef6\uff0c\u5bfc\u81f4 root \u7528\u6237\u4e5f\u65e0\u6cd5\u76f4\u63a5\u5220\u9664\u3002<\/p>\n<ol>\n<li>\n<p><strong>\u5904\u7406\u6bcd\u4f53\u6587\u4ef6 (\/bin\/systemd-daemon)<\/strong><\/p>\n<pre><code class=\"language-bash\"># \u89e3\u9501\nchattr -i \/bin\/systemd-daemon\n# \u5220\u9664\nrm -f \/bin\/systemd-daemon\n<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u5904\u7406\u670d\u52a1\u914d\u7f6e\u6587\u4ef6<\/strong>\n(\u66ff\u6362\u4e3a\u4f60\u7b2c\u4e8c\u9636\u6bb5\u67e5\u5230\u7684\u670d\u52a1\u6587\u4ef6\u8def\u5f84)<\/p>\n<pre><code class=\"language-bash\">chattr -i \/etc\/systemd\/system\/malicious-service.service\nrm -f \/etc\/systemd\/system\/malicious-service.service\nsystemctl daemon-reload\n<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u5904\u7406\u4e34\u65f6\u76ee\u5f55\u6b8b\u7559<\/strong>\n\u6e05\u7406\u4e0b\u8f7d\u5668\u811a\u672c\u3002<\/p>\n<pre><code class=\"language-bash\">rm -rf \/tmp\/um2\nrm -rf \/tmp\/xxvvxx\n# \u68c0\u67e5 \/var\/tmp \u662f\u5426\u6709\u5f02\u5e38\nls -al \/var\/tmp\n<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u5904\u7406\u4e4b\u524d\u7684\u6b8b\u7559 (\/etc\/sshd)<\/strong>\n\u5982\u679c\u4f60\u4e4b\u524d\u6ca1\u5220\u6389\uff0c\u73b0\u5728\u4e00\u5e76\u5904\u7406\uff1a<\/p>\n<pre><code class=\"language-bash\">chattr -i \/etc\/sshd\nrm -f \/etc\/sshd\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<h4 class=\"wp-block-heading\">\u7b2c\u56db\u9636\u6bb5\uff1a\u5168\u76d8\u626b\u63cf\u4e0e\u6e05\u7406\u5b9a\u65f6\u4efb\u52a1<\/h4>\n<ol>\n<li>\n<p><strong>\u68c0\u67e5 Crontab (\u5b9a\u65f6\u4efb\u52a1)<\/strong>\n\u9ed1\u5ba2\u53ef\u80fd\u5728 Cron \u91cc\u7559\u4e86\u540e\u624b\uff0c\u6bcf\u5206\u949f\u68c0\u67e5\u4e00\u6b21\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff0c\u4e0d\u5b58\u5728\u5c31\u91cd\u65b0\u4e0b\u8f7d\u3002<\/p>\n<pre><code class=\"language-bash\"># \u68c0\u67e5\u6240\u6709\u7528\u6237\u7684 cron\ncat \/etc\/crontab\nls -la \/etc\/cron.d\/\nls -la \/var\/spool\/cron\/crontabs\/\n\n# \u91cd\u70b9\u67e5\u770b root \u7528\u6237\u7684\ncrontab -l\n<\/code><\/pre>\n<p><em>\u53d1\u73b0\u4efb\u4f55\u5305\u542b <code>wget<\/code>, <code>curl<\/code>, <code>base64<\/code>, \u6216\u5947\u602a IP \u7684\u884c\uff0c\u7acb\u5373\u5220\u9664\u3002<\/em><\/p>\n<\/li>\n<li>\n<p><strong>\u68c0\u67e5 SSH \u5bc6\u94a5 (\u518d\u6b21\u5f3a\u8c03)<\/strong>\n\u8fd9\u662f\u9ed1\u5ba2\u56de\u6765\u7684\u5927\u95e8\u3002<\/p>\n<pre><code class=\"language-bash\">cat \/root\/.ssh\/authorized_keys\ncat \/home\/admin\/.ssh\/authorized_keys\n<\/code><\/pre>\n<p><em>\u53ea\u8981\u4e0d\u662f\u4f60\u4eb2\u624b\u653e\u8fdb\u53bb\u7684 Key\uff0c\u5168\u90e8\u5220\u6389\u3002<\/em><\/p>\n<\/li>\n<li>\n<p><strong>\u68c0\u67e5\u542f\u52a8\u9879 rc.local<\/strong><\/p>\n<pre><code class=\"language-bash\">cat \/etc\/rc.local\n<\/code><\/pre>\n<p><em>\u786e\u4fdd\u91cc\u9762\u662f\u7a7a\u7684\uff0c\u6216\u8005\u53ea\u6709\u4f60\u8ba4\u8bc6\u7684\u547d\u4ee4\u3002<\/em><\/p>\n<\/li>\n<\/ol>\n<h4 class=\"wp-block-heading\">\u7b2c\u4e94\u9636\u6bb5\uff1a\u67e5\u627e\u5165\u4fb5\u5165\u53e3 (\u9632\u6b62\u518d\u6b21\u611f\u67d3)<\/h4>\n<p>\u6587\u7ae0\u4e2d\u63d0\u5230 <strong>React2Shell<\/strong> \u5f80\u5f80\u5229\u7528 Web \u5e94\u7528\u6f0f\u6d1e\uff08\u5982 Redis \u672a\u6388\u6743\u8bbf\u95ee\u3001WebLogic \u6f0f\u6d1e\u7b49\uff09\u8fdb\u5165\u3002<\/p>\n<ol>\n<li>\n<p><strong>\u68c0\u67e5\u5f00\u653e\u7aef\u53e3<\/strong><\/p>\n<pre><code class=\"language-bash\">netstat -antlp\n<\/code><\/pre>\n<ul>\n<li>\u770b\u662f\u5426\u6709 Redis (6379), Docker (2375), WebLogic (7001) \u7b49\u7aef\u53e3\u5bf9\u5916\u5f00\u653e\uff1f<\/li>\n<li>\u5982\u679c\u6709\uff0c<strong>\u5fc5\u987b\u7acb\u5373\u914d\u7f6e\u9632\u706b\u5899\u7981\u6b62\u5916\u7f51\u8bbf\u95ee\u8fd9\u4e9b\u7aef\u53e3<\/strong>\uff0c\u6216\u8005\u8bbe\u7f6e\u5f3a\u5bc6\u7801\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u68c0\u67e5\u6700\u8fd1\u4fee\u6539\u7684\u6587\u4ef6<\/strong>\n\u67e5\u627e\u6700\u8fd1 24 \u5c0f\u65f6\u5185\u88ab\u4fee\u6539\u8fc7\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u9632\u6b62\u7cfb\u7edf\u547d\u4ee4\uff08\u5982 <code>ls<\/code>, <code>ps<\/code>\uff09\u88ab\u66ff\u6362\u3002<\/p>\n<pre><code class=\"language-bash\">find \/bin \/usr\/bin \/usr\/sbin -type f -mtime -1\n<\/code><\/pre>\n<p><em>\u5982\u679c\u53d1\u73b0 <code>ls<\/code>, <code>ps<\/code>, <code>netstat<\/code> \u6700\u8fd1\u88ab\u4fee\u6539\u8fc7\uff0c\u8bf4\u660e\u7cfb\u7edf\u547d\u4ee4\u88ab\u66ff\u6362\u4e86\uff08Rootkit\uff09\uff0c\u8fd9\u65f6\u5019\u4e0d\u91cd\u88c5\u51e0\u4e4e\u65e0\u6cd5\u4fee\u590d\u3002<\/em><\/p>\n<\/li>\n<\/ol>\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<\/h3>\n<ol>\n<li><strong>\u53c2\u8003\u4ef7\u503c\uff1a<\/strong> \u90a3\u7bc7\u6587\u7ae0\u786e\u8ba4\u4e86\u8fd9\u662f\u4e00\u6b21<strong>\u6709\u7ec4\u7ec7\u3001\u81ea\u52a8\u5316\u7684\u6076\u610f\u8f6f\u4ef6\u653b\u51fb<\/strong>\uff0c\u5229\u7528 Systemd \u8fdb\u884c\u6301\u4e45\u5316\u3002<\/li>\n<li><strong>\u6838\u5fc3\u64cd\u4f5c\uff1a<\/strong> <code>systemctl status &lt;PID&gt;<\/code> \u627e\u5230\u670d\u52a1 -&gt; \u505c\u6b62\u670d\u52a1 -&gt; <code>chattr -i<\/code> \u89e3\u9501\u6587\u4ef6 -&gt; \u5220\u9664\u6587\u4ef6 -&gt; \u6e05\u7406 SSH Key\u3002<\/li>\n<li><strong>\u6700\u540e\u9632\u7ebf\uff1a<\/strong> \u5982\u679c\u6267\u884c\u5b8c\u4e0a\u8ff0\u6b65\u9aa4\uff0cCPU \u4f9d\u7136\u9ad8\u5360\u7528\uff0c\u6216\u8005\u4e0d\u660e\u8fdb\u7a0b\u4f9d\u7136\u51fa\u73b0\uff0c\u8bf4\u660e\u53ef\u80fd\u690d\u5165\u4e86\u5185\u6838\u7ea7 Rootkit\u3002\u5728\u90a3\u4e4b\u540e\uff0c\u9664\u4e86\u91cd\u88c5\u7cfb\u7edf\uff0c\u522b\u65e0\u4ed6\u6cd5\u3002<\/li>\n<\/ol>\n<p>\u8bf7\u6309\u7167\u4e0a\u8ff0\u6b65\u9aa4\u64cd\u4f5c\uff0c\u5e76\u968f\u65f6\u53cd\u9988\u4efb\u4f55\u65b0\u7684\u62a5\u9519\u6216\u53d1\u73b0\u3002<\/p>\n<h2 class=\"wp-block-heading\">\u4f7f\u7528nft\u9632\u706b\u5899\u5c4f\u853dIP<\/h2>\n<p>\u4f7f\u7528 <code>nftables<\/code> (nft) \u5c4f\u853d\u7279\u5b9a IP \u7684\u903b\u8f91\u662f\uff1a\u5728 <code>inet<\/code> (\u540c\u65f6\u652f\u6301 IPv4\/IPv6) \u5730\u5740\u65cf\u7684 <code>filter<\/code> \u8868\u4e2d\uff0c\u5206\u522b\u5728 <code>input<\/code> (\u5165\u53e3) \u548c <code>output<\/code> (\u51fa\u53e3) \u94fe\u6dfb\u52a0 <code>drop<\/code> \u89c4\u5219\u3002<\/p>\n<p>\u9274\u4e8e\u670d\u52a1\u5668\u6b63\u5728\u906d\u53d7\u653b\u51fb\uff0c\u6211\u4eec\u9700\u8981<strong>\u53cc\u5411\u963b\u65ad<\/strong>\u8be5 IP (<code>185.196.9.41<\/code>)\u3002<\/p>\n<p>\u8bf7\u6309\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<h3 class=\"wp-block-heading\">1. \u786e\u8ba4\u8868\u548c\u94fe\u662f\u5426\u5b58\u5728<\/h3>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u786e\u4fdd\u4f60\u6709\u4e00\u4e2a\u53ef\u4ee5\u627f\u8f7d\u89c4\u5219\u7684\u8868\u3002\u5927\u591a\u6570\u7cfb\u7edf\u9ed8\u8ba4\u4f7f\u7528 <code>inet filter<\/code>\u3002<\/p>\n<p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-bash\">nft list ruleset\n<\/code><\/pre>\n<ul>\n<li>\u5982\u679c\u4f60\u770b\u5230 <code>table inet filter<\/code> \u4ee5\u53ca\u5176\u4e2d\u7684 <code>chain input<\/code> \u548c <code>chain output<\/code>\uff0c\u76f4\u63a5\u8df3\u5230<strong>\u6b65\u9aa4 3<\/strong>\u3002<\/li>\n<li>\u5982\u679c\u8f93\u51fa\u4e3a\u7a7a\uff0c\u6216\u8005\u6ca1\u6709\u8fd9\u4e24\u4e2a\u94fe\uff0c\u8bf7\u5148\u6267\u884c<strong>\u6b65\u9aa4 2<\/strong>\u3002<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\">2. \u521b\u5efa\u57fa\u7840\u8868\u548c\u94fe (\u5982\u679c\u6b65\u9aa41\u4e3a\u7a7a)<\/h3>\n<p>\u5982\u679c\u4f60\u7684 nftables \u662f\u7a7a\u7684\uff0c\u9700\u8981\u5148\u521d\u59cb\u5316\uff1a<\/p>\n<pre><code class=\"language-bash\"># \u521b\u5efa\u4e00\u4e2a\u540d\u4e3a filter \u7684\u8868\uff0c\u7c7b\u578b\u4e3a inet\nnft add table inet filter\n\n# \u521b\u5efa input \u94fe (\u5904\u7406\u5165\u7ad9\u6d41\u91cf)\nnft add chain inet filter input { type filter hook input priority 0 \\; }\n\n# \u521b\u5efa output \u94fe (\u5904\u7406\u51fa\u7ad9\u6d41\u91cf)\nnft add chain inet filter output { type filter hook output priority 0 \\; }\n<\/code><\/pre>\n<h3 class=\"wp-block-heading\">3. \u6dfb\u52a0\u5c4f\u853d\u89c4\u5219 (\u6838\u5fc3\u6b65\u9aa4)<\/h3>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u7acb\u5373\u5207\u65ad\u4e0e\u6076\u610f IP \u7684\u6240\u6709\u8fde\u63a5\u3002<\/p>\n<p><strong>\u5c4f\u853d\u5165\u7ad9 (\u9632\u6b62\u9ed1\u5ba2\u518d\u6b21\u8fde\u63a5\u4f60)\uff1a<\/strong><\/p>\n<pre><code class=\"language-bash\"># \u8bed\u6cd5\uff1a\u5728 inet filter \u8868\u7684 input \u94fe\u4e2d\uff0c\u6e90 IP (saddr) \u4e3a\u6076\u610f IP \u65f6\uff0c\u4e22\u5f03 (drop)\nnft add rule inet filter input ip saddr 185.196.9.41 drop\n<\/code><\/pre>\n<p><strong>\u5c4f\u853d\u51fa\u7ad9 (\u9632\u6b62\u75c5\u6bd2\u4e0b\u8f7d\u540e\u7eed\u6728\u9a6c\u6216\u56de\u4f20\u6570\u636e)\uff1a<\/strong><\/p>\n<pre><code class=\"language-bash\"># \u8bed\u6cd5\uff1a\u5728 inet filter \u8868\u7684 output \u94fe\u4e2d\uff0c\u76ee\u7684 IP (daddr) \u4e3a\u6076\u610f IP \u65f6\uff0c\u4e22\u5f03 (drop)\nnft add rule inet filter output ip daddr 185.196.9.41 drop\n<\/code><\/pre>\n<h3 class=\"wp-block-heading\">4. \u9a8c\u8bc1\u89c4\u5219\u662f\u5426\u751f\u6548<\/h3>\n<p>\u518d\u6b21\u67e5\u770b\u89c4\u5219\u96c6\uff0c\u786e\u8ba4\u89c4\u5219\u5df2\u6dfb\u52a0\uff1a<\/p>\n<pre><code class=\"language-bash\">nft list ruleset\n<\/code><\/pre>\n<p>\u4f60\u5e94\u8be5\u80fd\u770b\u5230\u7c7b\u4f3c\u8fd9\u6837\u7684\u8f93\u51fa\uff1a<\/p>\n<pre><code class=\"language-text\">table inet filter {\n    chain input {\n        ...\n        ip saddr 185.196.9.41 drop\n    }\n    chain output {\n        ...\n        ip daddr 185.196.9.41 drop\n    }\n}\n<\/code><\/pre>\n<h3 class=\"wp-block-heading\">5. (\u8fdb\u9636) \u5c4f\u853d\u6574\u4e2a\u7f51\u6bb5<\/h3>\n<p>\u9ed1\u5ba2\u7ecf\u5e38\u62e5\u6709\u540c\u4e00\u4e2a\u7f51\u6bb5\u7684\u591a\u4e2a IP\u3002\u5982\u679c\u4f60\u53d1\u73b0\u5b83\u6362\u4e86\u4e2a\u5c3e\u53f7\u7ee7\u7eed\u653b\u51fb\uff0c\u53ef\u4ee5\u76f4\u63a5\u5c01\u9501\u6574\u4e2a C \u6bb5 (256\u4e2a IP)\uff1a<\/p>\n<pre><code class=\"language-bash\">nft add rule inet filter input ip saddr 185.196.9.0\/24 drop\nnft add rule inet filter output ip daddr 185.196.9.0\/24 drop\n<\/code><\/pre>\n<h3 class=\"wp-block-heading\">6. \u4fdd\u5b58\u914d\u7f6e (\u975e\u5e38\u91cd\u8981\uff01)<\/h3>\n<p><code>nft<\/code> \u547d\u4ee4\u6dfb\u52a0\u7684\u89c4\u5219\u5728\u91cd\u542f\u540e\u4f1a<strong>\u4e22\u5931<\/strong>\u3002\u4f60\u5fc5\u987b\u5c06\u5f53\u524d\u914d\u7f6e\u4fdd\u5b58\u5230\u6587\u4ef6\uff0c\u5e76\u786e\u4fdd nftables \u670d\u52a1\u5f00\u673a\u81ea\u542f\u3002<\/p>\n<p><strong>Debian \/ Ubuntu:<\/strong><\/p>\n<pre><code class=\"language-bash\"># \u4fdd\u5b58\u5f53\u524d\u89c4\u5219\u5230\u914d\u7f6e\u6587\u4ef6\nnft list ruleset &gt; \/etc\/nftables.conf\n\n# \u5f00\u542f\u5f00\u673a\u81ea\u542f\nsystemctl enable nftables\n<\/code><\/pre>\n<p><strong>CentOS \/ RHEL \/ Fedora:<\/strong><\/p>\n<pre><code class=\"language-bash\"># \u4fdd\u5b58\u5f53\u524d\u89c4\u5219\nnft list ruleset &gt; \/etc\/sysconfig\/nftables.conf\n\n# \u5f00\u542f\u5f00\u673a\u81ea\u542f\nsystemctl enable nftables\n<\/code><\/pre>\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<\/h3>\n<p>\u4f60\u73b0\u5728\u7684\u5f53\u52a1\u4e4b\u6025\u662f\u6267\u884c<strong>\u6b65\u9aa4 3<\/strong>\u3002\u6267\u884c\u5b8c\u540e\uff0c\u90a3\u4e2a\u75c5\u6bd2\u8fdb\u7a0b\u5c31\u65e0\u6cd5\u518d\u4ece <code>185.196.9.41<\/code> \u4e0b\u8f7d <code>um2<\/code> \u811a\u672c\u4e86\uff0c\u8fd9\u4e3a\u4f60\u6e05\u7406\u7cfb\u7edf\u4e89\u53d6\u4e86\u65f6\u95f4\u3002<\/p>\n<h2 class=\"wp-block-heading\">\u68c0\u67e5\u81ea\u52a8\u8fd0\u884c\u89c4\u5219<\/h2>\n<p>cd \/ &amp;&amp; run-parts &#8211;report \/etc\/cron.hourly<\/p>\n<pre><code>root@Server:~# cat \/etc\/crontab\n# \/etc\/crontab: system-wide crontab\n# Unlike any other crontab you don&#039;t have to run the `crontab&#039;\n# command to install the new version when you edit this file\n# and files in \/etc\/cron.d. These files also have username fields,\n# that none of the other crontabs do.\n\nSHELL=\/bin\/sh\nPATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/sbin:\/bin:\/usr\/sbin:\/usr\/bin\n\n# Example of job definition:\n# .---------------- minute (0 - 59)\n# |  .------------- hour (0 - 23)\n# |  |  .---------- day of month (1 - 31)\n# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...\n# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat\n# |  |  |  |  |\n# *  *  *  *  * user-name command to be executed\n17 *    * * *   root    cd \/ &amp;&amp; run-parts --report \/etc\/cron.hourly\n25 6    * * *   root    test -x \/usr\/sbin\/anacron || ( cd \/ &amp;&amp; run-parts --report \/etc\/cron.daily )\n47 6    * * 7   root    test -x \/usr\/sbin\/anacron || ( cd \/ &amp;&amp; run-parts --report \/etc\/cron.weekly )\n52 6    1 * *   root    test -x \/usr\/sbin\/anacron || ( cd \/ &amp;&amp; run-parts --report \/etc\/cron.monthly )\n\nroot@Server:~# crontab -l\n# Edit this file to introduce tasks to be run by cron.\n#\n# Each task to run has to be defined through a single line\n# indicating with different fields when the task will be run\n# and what command to run for the task\n#\n# To define the time you can provide concrete values for\n# minute (m), hour (h), day of month (dom), month (mon),\n# and day of week (dow) or use &#039;*&#039; in these fields (for &#039;any&#039;).\n#\n# Notice that tasks will be started based on the cron&#039;s system\n# daemon&#039;s notion of time and timezones.\n#\n# Output of the crontab jobs (including errors) is sent through\n# email to the user the crontab file belongs to (unless redirected).\n#\n# For example, you can run a backup of all your user accounts\n# at 5 a.m every week with:\n# 0 5 * * 1 tar -zcf \/var\/backups\/home.tgz \/home\/\n#\n# For more information see the manual pages of crontab(5) and cron(8)\n#\n# m     h       dom     mon     dow     command\n12      2       *       *       *       cron_unidump backup db newapi\n12      3       *       *       *       \/root\/scripts\/rsyncPush.sh\n*\/1     *       *       *       *       pkill -9 xmrig\n# @reboot \/etc\/sshd\n<\/code><\/pre>\n<h3 class=\"wp-block-heading\">1. \u5173\u4e8e <code>\/etc\/crontab<\/code> (\u7cfb\u7edf\u7ea7\u5b9a\u65f6\u4efb\u52a1)<\/h3>\n<p><strong>\u7ed3\u8bba\uff1a\u8fd9\u90e8\u5206\u770b\u8d77\u6765\u662f\u6b63\u5e38\u7684 Linux (Debian\/Ubuntu) \u9ed8\u8ba4\u914d\u7f6e\u3002<\/strong><\/p>\n<p>\u4f60\u95ee\u7684 <code>cd \/ &amp;&amp; run-parts --report \/etc\/cron.hourly<\/code> \u662f\u4ec0\u4e48\u610f\u601d\uff1f<\/p>\n<ul>\n<li><strong><code>cd \/<\/code><\/strong>: \u5207\u6362\u5230\u6839\u76ee\u5f55\uff0c\u786e\u4fdd\u811a\u672c\u5728\u5df2\u77e5\u8def\u5f84\u4e0b\u8fd0\u884c\u3002<\/li>\n<li><strong><code>&amp;&amp;<\/code><\/strong>: \u5982\u679c\u5207\u6362\u76ee\u5f55\u6210\u529f\uff0c\u5219\u6267\u884c\u540e\u9762\u7684\u547d\u4ee4\u3002<\/li>\n<li><strong><code>run-parts --report \/etc\/cron.hourly<\/code><\/strong>: <code>run-parts<\/code> \u662f\u4e00\u4e2a\u5de5\u5177\uff0c\u5b83\u4f1a<strong>\u8fd0\u884c\u6307\u5b9a\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u53ef\u6267\u884c\u811a\u672c<\/strong>\u3002\n<ul>\n<li>\u8fd9\u610f\u5473\u7740\uff1a\u7cfb\u7edf\u4f1a\u5728\u6bcf\u5c0f\u65f6\u7684\u7b2c 17 \u5206\u949f\uff0c\u81ea\u52a8\u628a <code>\/etc\/cron.hourly\/<\/code> \u76ee\u5f55\u91cc\u6240\u6709\u7684\u811a\u672c\u90fd\u8dd1\u4e00\u904d\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>\u26a0\ufe0f \u8b66\u60d5\u70b9\uff1a<\/strong>\n\u867d\u7136\u8fd9\u884c\u914d\u7f6e\u672c\u8eab\u662f\u6b63\u5e38\u7684\uff0c\u4f46<strong>\u9ed1\u5ba2\u7ecf\u5e38\u628a\u75c5\u6bd2\u811a\u672c\u6254\u8fdb <code>\/etc\/cron.hourly\/<\/code> \u76ee\u5f55\u91cc<\/strong>\u3002\u56e0\u4e3a\u7cfb\u7edf\u4f1a\u81ea\u52a8\u8fd0\u884c\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u4e1c\u897f\u3002<\/p>\n<p><strong>\u4f60\u9700\u8981\u7acb\u5373\u6267\u884c\u7684\u64cd\u4f5c\uff1a<\/strong>\n\u68c0\u67e5\u8be5\u76ee\u5f55\u4e0b\u662f\u5426\u6709\u5947\u602a\u7684\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-bash\">ls -la \/etc\/cron.hourly\/\n<\/code><\/pre>\n<ul>\n<li><strong>\u6b63\u5e38\u60c5\u51b5\uff1a<\/strong> \u901a\u5e38\u53ea\u6709 <code>0anacron<\/code> (\u5982\u679c\u5b89\u88c5\u4e86\u7684\u8bdd) \u6216\u8005\u7a7a\u76ee\u5f55\u3002<\/li>\n<li><strong>\u5f02\u5e38\u60c5\u51b5\uff1a<\/strong> \u5982\u679c\u770b\u5230 <code>gcc<\/code>, <code>sh<\/code>, <code>update<\/code>, <code>sync<\/code> \u7b49\u540d\u5b57\u5f88\u6cdb\u6216\u8005\u4e71\u7801\u7684\u6587\u4ef6\uff0c<strong>\u67e5\u770b\u5185\u5bb9\u5e76\u5220\u9664<\/strong>\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3 class=\"wp-block-heading\">2. \u5173\u4e8e <code>crontab -l<\/code> (root \u7528\u6237\u7684\u5b9a\u65f6\u4efb\u52a1)<\/h3>\n<p><strong>\u7ed3\u8bba\uff1a\u8fd9\u91cc\u6709\u660e\u663e\u7684\u88ab\u5165\u4fb5\u75d5\u8ff9\u548c\u53ef\u7591\u811a\u672c\u3002<\/strong><\/p>\n<p>\u6211\u4eec\u9700\u8981\u9010\u884c\u5206\u6790 root \u7528\u6237\u7684\u5b9a\u65f6\u4efb\u52a1\uff1a<\/p>\n<h4 class=\"wp-block-heading\">A. \u7528\u6237\u811a\u672c (\u9700\u8981\u786e\u8ba4)<\/h4>\n<pre><code class=\"language-bash\">12      2       *       *       *       cron_unidump backup db newapi\n12      3       *       *       *       \/root\/scripts\/rsyncPush.sh\n<\/code><\/pre>\n<ul>\n<li><strong>\u5206\u6790\uff1a<\/strong> \u8fd9\u770b\u8d77\u6765\u50cf\u662f\u4f60\u81ea\u5df1\u6216\u4e4b\u524d\u7684\u7ba1\u7406\u5458\u8bbe\u7f6e\u7684\u6570\u636e\u5e93\u5907\u4efd\u548c\u540c\u6b65\u811a\u672c\u3002<\/li>\n<li><strong>\u98ce\u9669\uff1a<\/strong> \u867d\u7136\u540d\u5b57\u770b\u8d77\u6765\u6b63\u5e38\uff0c\u4f46\u9ed1\u5ba2\u6709\u65f6\u4f1a\u4fee\u6539\u73b0\u6709\u7684\u5408\u6cd5\u811a\u672c\uff0c\u5728\u91cc\u9762\u63d2\u5165\u4e00\u884c\u4e0b\u8f7d\u75c5\u6bd2\u7684\u547d\u4ee4\u3002<\/li>\n<li><strong>\u5efa\u8bae\uff1a<\/strong> \u4f7f\u7528 <code>cat \/root\/scripts\/rsyncPush.sh<\/code> \u68c0\u67e5\u6587\u4ef6\u5185\u5bb9\uff0c\u786e\u4fdd\u91cc\u9762\u6ca1\u6709 <code>wget<\/code>\u3001<code>curl<\/code> \u4e0b\u8f7d\u5947\u602a IP \u7684\u547d\u4ee4\u3002<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\">B. \u6316\u77ff\u5bf9\u6297\u6307\u4ee4 (\u975e\u5e38\u53ef\u7591)<\/h4>\n<pre><code class=\"language-bash\">*\/1     *       *       *       *       pkill -9 xmrig\n<\/code><\/pre>\n<ul>\n<li><strong>\u610f\u601d\uff1a<\/strong> \u6bcf\u5206\u949f\u5f3a\u5236\u6740\u6b7b\u540d\u4e3a <code>xmrig<\/code> \u7684\u8fdb\u7a0b\u3002<\/li>\n<li><strong>\u5206\u6790\uff1a<\/strong> \u8fd9\u901a\u5e38\u662f<strong>\u9ed1\u5ba2 A \u4e3a\u4e86\u72ec\u5360\u670d\u52a1\u5668\u8d44\u6e90\uff0c\u5199\u811a\u672c\u6740\u6389\u9ed1\u5ba2 B \u7684\u6316\u77ff\u7a0b\u5e8f<\/strong>\uff08xmrig \u662f\u5e38\u89c1\u7684\u6316\u77ff\u8f6f\u4ef6\uff09\u3002\u6216\u8005\u8fd9\u662f\u4f60\u81ea\u5df1\u4e3a\u4e86\u4e34\u65f6\u6b62\u8840\u52a0\u4e0a\u7684\uff1f<\/li>\n<li><strong>\u5efa\u8bae\uff1a<\/strong> \u5982\u679c\u8fd9\u4e0d\u662f\u4f60\u52a0\u7684\uff0c\u8bf4\u660e\u670d\u52a1\u5668\u66fe\u88ab\u591a\u4e2a\u9ed1\u5ba2\u56e2\u4f19\u4e89\u593a\u3002\u6e05\u7406\u5b8c\u75c5\u6bd2\u540e\uff0c\u8fd9\u884c\u5e94\u8be5\u5220\u6389\u3002<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\">C. \u88ab\u6ce8\u91ca\u7684\u540e\u95e8 (\u786e\u51ff\u8bc1\u636e)<\/h4>\n<pre><code class=\"language-bash\"># @reboot \/etc\/sshd\n<\/code><\/pre>\n<ul>\n<li><strong>\u610f\u601d\uff1a<\/strong> \u5f00\u673a\u542f\u52a8 <code>\/etc\/sshd<\/code>\u3002<\/li>\n<li><strong>\u5206\u6790\uff1a<\/strong> \u8fd9\u5c31\u662f\u6211\u4eec\u4e4b\u524d\u53d1\u73b0\u7684\u90a3\u4e2a<strong>\u540e\u95e8\u6587\u4ef6<\/strong>\u3002\u524d\u9762\u7684 <code>#<\/code> \u8bf4\u660e\u5b83\u5df2\u7ecf\u88ab\u6ce8\u91ca\u6389\uff08\u5931\u6548\uff09\u4e86\uff0c\u53ef\u80fd\u662f\u4f60\u4e4b\u524d\u7684\u64cd\u4f5c\u6216\u8005\u67d0\u4e9b\u6e05\u7406\u5de5\u5177\u7981\u7528\u4e86\u5b83\u3002<\/li>\n<li><strong>\u5efa\u8bae\uff1a<\/strong> <strong>\u7acb\u5373\u5220\u9664\u8fd9\u884c\u3002<\/strong> \u5b83\u7684\u5b58\u5728\u8bc1\u660e\u9ed1\u5ba2\u66fe\u7ecf\u4fee\u6539\u8fc7\u8fd9\u4e2a\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3 class=\"wp-block-heading\">\u7efc\u5408\u6e05\u7406\u5efa\u8bae<\/h3>\n<p>\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6e05\u7406 root \u7684\u5b9a\u65f6\u4efb\u52a1\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u7f16\u8f91\u5b9a\u65f6\u4efb\u52a1\uff1a<\/strong><\/p>\n<pre><code class=\"language-bash\">crontab -e\n<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>\u4fee\u6539\u5185\u5bb9\uff1a<\/strong><\/p>\n<ul>\n<li>\u5220\u9664 <code>*\/1 * * * * pkill -9 xmrig<\/code> (\u5982\u679c\u662f\u9ed1\u5ba2\u7559\u7684)\u3002<\/li>\n<li>\u5220\u9664 <code># @reboot \/etc\/sshd<\/code> (\u5f7b\u5e95\u6e05\u9664\u540e\u95e8\u75d5\u8ff9)\u3002<\/li>\n<li>\u4ed4\u7ec6\u68c0\u67e5\u524d\u4e24\u884c\u5907\u4efd\u811a\u672c\u7684\u5185\u5bb9\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u68c0\u67e5 hourly \u76ee\u5f55 (\u975e\u5e38\u91cd\u8981)\uff1a<\/strong><\/p>\n<pre><code class=\"language-bash\"># \u67e5\u770b\u662f\u5426\u6709\u6076\u610f\u811a\u672c\u85cf\u5728\u8fd9\u91cc\nls -la \/etc\/cron.hourly\/\nls -la \/etc\/cron.daily\/\nls -la \/etc\/cron.weekly\/\nls -la \/etc\/cron.monthly\/\n<\/code><\/pre>\n<p>\u5982\u679c\u5728\u8fd9\u4e9b\u76ee\u5f55\u91cc\u53d1\u73b0\u4efb\u4f55\u975e\u7cfb\u7edf\u81ea\u5e26\u7684\u811a\u672c\uff08\u6bd4\u5982\u540d\u5b57\u53eb <code>systemd-daemon<\/code>, <code>update<\/code>, <code>sync<\/code> \u4f46\u4f60\u6ca1\u5370\u8c61\u7684\uff09\uff0c<strong>\u7acb\u5373\u68c0\u67e5\u5185\u5bb9\u5e76\u5220\u9664<\/strong>\u3002<\/p>\n<\/li>\n<\/ol>\n<h2 class=\"wp-block-heading\">\u5206\u6790cron<\/h2>\n<pre><code class=\"language-bash\">root@Server:~# ls -la \/etc\/cron.hourly\/\nls -la \/etc\/cron.daily\/\nls -la \/etc\/cron.weekly\/\nls -la \/etc\/cron.monthly\/\ntotal 12\ndrwxr-xr-x  2 root root 4096 Jun 29  2022 .\ndrwxr-xr-x 99 root root 4096 Dec 11 10:33 ..\n-rw-r--r--  1 root root  102 Feb 23  2021 .placeholder\n... ...\n\n<\/code><\/pre>\n<p>\u7ecf\u8fc7\u9010\u9879\u68c0\u67e5\uff0c\u8fd9\u4e9b\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u7edd\u5927\u591a\u6570\u90fd\u662f Linux (Debian\/Ubuntu) \u7cfb\u7edf\u81ea\u5e26\u7684\u6807\u51c6\u7ef4\u62a4\u811a\u672c\u3002<\/p>\n<h3 class=\"wp-block-heading\">\u8be6\u7ec6\u5206\u6790<\/h3>\n<ol>\n<li>\n<p><strong><code>\/etc\/cron.hourly\/<\/code> (\u6bcf\u5c0f\u65f6\u4efb\u52a1)<\/strong><\/p>\n<ul>\n<li>\u53ea\u6709 <code>.placeholder<\/code>\u3002\u8fd9\u662f\u7cfb\u7edf\u4e3a\u4e86\u5360\u4f4d\u4fdd\u7559\u76ee\u5f55\u800c\u521b\u5efa\u7684\u7a7a\u6587\u4ef6\u3002<\/li>\n<li><strong>\u7ed3\u8bba\uff1a\u5b89\u5168\u3002<\/strong> \u8fd9\u91cc\u6ca1\u6709\u88ab\u690d\u5165\u6bcf\u5c0f\u65f6\u8fd0\u884c\u7684\u75c5\u6bd2\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong><code>\/etc\/cron.daily\/<\/code> (\u6bcf\u5929\u4efb\u52a1)<\/strong><\/p>\n<ul>\n<li><code>apt-compat<\/code>, <code>dpkg<\/code>, <code>logrotate<\/code>, <code>man-db<\/code>, <code>ntp<\/code>, <code>sysstat<\/code>\uff1a\u8fd9\u4e9b\u5168\u90e8\u662f\u6807\u51c6\u7684\u7cfb\u7edf\u7ef4\u62a4\u811a\u672c\uff08\u7528\u4e8e\u66f4\u65b0\u8f6f\u4ef6\u6e90\u3001\u5907\u4efd\u5305\u7ba1\u7406\u6570\u636e\u5e93\u3001\u5207\u5272\u65e5\u5fd7\u3001\u66f4\u65b0\u5e2e\u52a9\u6587\u6863\u3001\u540c\u6b65\u65f6\u95f4\u3001\u7cfb\u7edf\u76d1\u63a7\uff09\u3002<\/li>\n<li><strong><code>apache2<\/code><\/strong>\uff1a\u8fd9\u901a\u5e38\u662f Apache Web \u670d\u52a1\u5668\u7528\u6765\u5207\u5272\u65e5\u5fd7\u7684\u811a\u672c\u3002\n<ul>\n<li><strong>\u6ce8\u610f\uff1a<\/strong> \u867d\u7136\u540d\u5b57\u6b63\u5e38\uff0c\u4f46\u9274\u4e8e\u4f60\u7684\u7cfb\u7edf\u88ab\u6df1\u5ea6\u5165\u4fb5\uff0c\u5efa\u8bae\u786e\u8ba4\u4e00\u4e0b\u5b83\u7684\u5185\u5bb9\uff0c\u9632\u6b62\u9ed1\u5ba2\u628a\u75c5\u6bd2\u85cf\u5728\u8fd9\u4e2a\u6587\u4ef6\u91cc\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u7ed3\u8bba\uff1a\u57fa\u672c\u5b89\u5168\uff0c\u4f46\u5efa\u8bae\u68c0\u67e5\u4e00\u4e0b apache2\u3002<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong><code>\/etc\/cron.weekly\/<\/code> &amp; <code>\/etc\/cron.monthly\/<\/code><\/strong><\/p>\n<ul>\n<li>\u53ea\u6709 <code>man-db<\/code> \u548c <code>.placeholder<\/code>\u3002<\/li>\n<li><strong>\u7ed3\u8bba\uff1a\u5b89\u5168\u3002<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<hr \/>\n<h3 class=\"wp-block-heading\">\u5efa\u8bae\u6267\u884c\u7684\u64cd\u4f5c<\/h3>\n<p>\u867d\u7136\u76ee\u5f55\u770b\u8d77\u6765\u5e72\u51c0\uff0c\u4f46\u4e3a\u4e86 100% \u653e\u5fc3\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u4e24\u6b65\uff1a<\/p>\n<h4 class=\"wp-block-heading\">1. \u5feb\u901f\u68c0\u67e5 <code>\/etc\/cron.daily\/apache2<\/code><\/h4>\n<p>\u9ed1\u5ba2\u6709\u65f6\u4f1a\u4fee\u6539\u73b0\u6709\u7684\u5408\u6cd5\u6587\u4ef6\u3002\u8bf7\u67e5\u770b\u8be5\u6587\u4ef6\u5185\u5bb9\uff1a<\/p>\n<pre><code class=\"language-bash\">cat \/etc\/cron.daily\/apache2\n<\/code><\/pre>\n<ul>\n<li><strong>\u6b63\u5e38\u60c5\u51b5\uff1a<\/strong> \u4f60\u5e94\u8be5\u770b\u5230\u7c7b\u4f3c <code>logrotate<\/code> \u7684\u8c03\u7528\u547d\u4ee4\uff0c\u6216\u8005\u68c0\u67e5 apache \u662f\u5426\u8fd0\u884c\u7684 shell \u811a\u672c\u3002<\/li>\n<li><strong>\u5f02\u5e38\u60c5\u51b5\uff1a<\/strong> \u5982\u679c\u4f60\u5728\u91cc\u9762\u770b\u5230\u4e86 <code>wget<\/code>\u3001<code>curl<\/code>\u3001<code>base64<\/code> \u6216\u8005\u8fde\u63a5\u90a3\u4e2a\u6076\u610f IP (<code>185.196.9.41<\/code>) \u7684\u4ee3\u7801\uff0c<strong>\u7acb\u5373\u5220\u9664\u5b83<\/strong>\u3002<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\">2. \u56de\u5934\u6e05\u7406 <code>root<\/code> \u7528\u6237\u7684 crontab (\u91cd\u8981\uff01)<\/h4>\n<p>\u867d\u7136 <code>\/etc\/cron.*<\/code> \u76ee\u5f55\u662f\u5e72\u51c0\u7684\uff0c\u4f46\u522b\u5fd8\u4e86\u4f60\u4e4b\u524d\u53d1\u7684 <code>crontab -l<\/code> \u8f93\u51fa\u4e2d\uff0c<strong>root \u7528\u6237\u7684\u4e2a\u4eba\u5b9a\u65f6\u4efb\u52a1\u662f\u6709\u95ee\u9898\u7684<\/strong>\u3002<\/p>\n<p>\u9ed1\u5ba2\u4e3b\u8981\u5229\u7528\u7684\u662f <strong>User Crontab<\/strong> \u800c\u4e0d\u662f <strong>System Cron<\/strong>\u3002<\/p>\n<p>\u8bf7\u52a1\u5fc5\u6267\u884c\uff1a<\/p>\n<pre><code class=\"language-bash\">crontab -e\n<\/code><\/pre>\n<p><strong>\u5220\u9664\u6216\u6ce8\u91ca\u6389\u4ee5\u4e0b\u884c\uff1a<\/strong><\/p>\n<ul>\n<li><code>*\/1 * * * * pkill -9 xmrig<\/code> (\u5982\u679c\u662f\u9ed1\u5ba2\u7559\u4e0b\u7684)<\/li>\n<li><code># @reboot \/etc\/sshd<\/code> (\u867d\u7136\u5df2\u6ce8\u91ca\uff0c\u4f46\u5efa\u8bae\u5220\u9664)<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<\/h3>\n<p>\u770b\u6765\u9ed1\u5ba2\u7684\u6301\u4e45\u5316\u624b\u6bb5\u4e3b\u8981\u96c6\u4e2d\u5728\uff1a<\/p>\n<ol>\n<li><strong>Systemd \u670d\u52a1<\/strong> (<code>\/bin\/systemd-daemon<\/code>\uff0c\u5df2\u5904\u7406)<\/li>\n<li><strong>Root \u7528\u6237\u5b9a\u65f6\u4efb\u52a1<\/strong> (<code>crontab -e<\/code>\uff0c<strong>\u5f85\u5904\u7406<\/strong>)<\/li>\n<li><strong>SSH \u540e\u95e8<\/strong> (<code>\/etc\/sshd<\/code>\uff0c\u5df2\u5904\u7406)<\/li>\n<\/ol>\n<p>\u4f60\u7684 <code>\/etc\/cron.*<\/code> \u76ee\u5f55\u76ee\u524d\u662f\u5b88\u4f4f\u7684\uff0c\u6ca1\u6709\u5931\u5b88\u3002\u8bf7\u7ee7\u7eed\u4fdd\u6301\u8b66\u60d5\uff0c\u5b8c\u6210\u5269\u4e0b\u7684\u6e05\u7406\u5de5\u4f5c\u3002<\/p>\n<h2 class=\"wp-block-heading\">\u5206\u6790\/etc\/passwd<\/h2>\n<pre><code class=\"language-bash\">\nvim \/etc\/passwd\n 1 root:x:0:0:root:\/root:\/bin\/bash\n...\n\n<\/code><\/pre>\n<p><strong>\u7ed3\u8bba\uff1a\u8fd9\u4efd\u7528\u6237\u5217\u8868\u770b\u8d77\u6765\u662f\u6b63\u5e38\u7684\uff0c\u6ca1\u6709\u53d1\u73b0\u660e\u663e\u7684\u201c\u5e7d\u7075\u8d26\u6237\u201d\u6216\u201c\u7279\u6743\u540e\u95e8\u201d\u3002<\/strong><\/p>\n<p>\u7ecf\u8fc7\u9010\u884c\u5206\u6790\uff0c\u6240\u6709\u7528\u6237\u7684\u914d\u7f6e\u90fd\u7b26\u5408 Linux (Debian\/Ubuntu) \u7684\u6807\u51c6\u5b89\u5168\u89c4\u8303\u3002<\/p>\n<h3 class=\"wp-block-heading\">\u8be6\u7ec6\u5206\u6790<\/h3>\n<ol>\n<li>\n<p><strong>\u7279\u6743\u7528\u6237\u68c0\u67e5 (UID 0)<\/strong><\/p>\n<ul>\n<li>\u53ea\u6709 <code>root<\/code> (\u7b2c1\u884c) \u7684 UID \u662f <code><\/code>\u3002<\/li>\n<li><strong>\u5224\u5b9a\uff1a\u5b89\u5168\u3002<\/strong> \u5982\u679c\u4f60\u770b\u5230\u9664\u4e86 root \u4ee5\u5916\u8fd8\u6709 UID \u4e3a 0 \u7684\u7528\u6237\uff08\u6bd4\u5982\u53eb <code>toor<\/code>, <code>admin0<\/code>, <code>redis<\/code>\uff09\uff0c\u90a3\u5c31\u662f\u8d85\u7ea7\u7ba1\u7406\u5458\u540e\u95e8\u3002\u8fd9\u91cc\u6ca1\u6709\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u767b\u5f55\u6743\u9650\u68c0\u67e5 (Shell)<\/strong><\/p>\n<ul>\n<li>\u7edd\u5927\u591a\u6570\u7cfb\u7edf\u670d\u52a1\u7528\u6237\uff08\u5982 <code>daemon<\/code>, <code>bin<\/code>, <code>www-data<\/code>, <code>mysql<\/code> \u7b49\uff09\u7684 Shell \u90fd\u662f <code>\/usr\/sbin\/nologin<\/code> \u6216 <code>\/bin\/false<\/code>\u3002<\/li>\n<li><strong>\u5224\u5b9a\uff1a\u5b89\u5168\u3002<\/strong> \u8fd9\u610f\u5473\u7740\u9ed1\u5ba2\u65e0\u6cd5\u76f4\u63a5\u901a\u8fc7\u8fd9\u4e9b\u8d26\u6237\u767b\u5f55\u7cfb\u7edf\u7ec8\u7aef\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u666e\u901a\u7528\u6237\u68c0\u67e5<\/strong><\/p>\n<ul>\n<li><strong><code>admin<\/code> (\u7b2c28\u884c):<\/strong> UID 1000\u3002\u8fd9\u662f\u5f88\u591a\u4e91\u670d\u52a1\u5668\u9ed8\u8ba4\u521b\u5efa\u7684\u7b2c\u4e00\u4e2a\u7528\u6237\u3002\n<ul>\n<li>\u6ce8\u610f\u5b83\u7684 Shell \u662f <code>\/sbin\/nologin<\/code>\u3002\u8fd9\u610f\u5473\u7740\u8fd9\u4e2a\u8d26\u6237\u76ee\u524d\u88ab\u7981\u6b62\u767b\u5f55 Shell\u3002\u8fd9\u901a\u5e38\u662f\u5b89\u5168\u7684\u914d\u7f6e\uff08\u6216\u8005\u4f60\u4e4b\u524d\u7981\u7528\u4e86\u5b83\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong><code>glances<\/code> (\u7b2c30\u884c):<\/strong> \u8fd9\u662f\u4e00\u4e2a\u7cfb\u7edf\u76d1\u63a7\u5de5\u5177\uff08\u7c7b\u4f3c top \u7684\u589e\u5f3a\u7248\uff09\u3002\u5982\u679c\u4f60\u5b89\u88c5\u8fc7 Glances\uff0c\u8fd9\u4e2a\u7528\u6237\u662f\u6b63\u5e38\u7684\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<hr \/>\n<h3 class=\"wp-block-heading\">\u26a0\ufe0f \u5373\u4f7f\u5217\u8868\u6b63\u5e38\uff0c\u4ecd\u9700\u68c0\u67e5\u7684\u9690\u853d\u540e\u95e8<\/h3>\n<p>\u867d\u7136 <code>\/etc\/passwd<\/code> \u770b\u8d77\u6765\u6ca1\u95ee\u9898\uff0c\u4f46\u9ed1\u5ba2\u53ef\u80fd\u901a\u8fc7<strong>\u4fee\u6539\u73b0\u6709\u8d26\u6237\u7684\u5c5e\u6027<\/strong>\u6765\u7559\u540e\u95e8\u3002\u8bf7\u52a1\u5fc5\u68c0\u67e5\u4ee5\u4e0b\u4e24\u70b9\uff1a<\/p>\n<h4 class=\"wp-block-heading\">1. \u68c0\u67e5 <code>\/etc\/shadow<\/code> (\u5bc6\u7801\u5f71\u5b50\u6587\u4ef6)<\/h4>\n<p>\u9ed1\u5ba2\u53ef\u80fd\u4f1a\u7ed9\u672c\u4e0d\u8be5\u6709\u5bc6\u7801\u7684\u7cfb\u7edf\u7528\u6237\uff08\u5982 <code>www-data<\/code> \u6216 <code>mysql<\/code>\uff09\u8bbe\u7f6e\u4e00\u4e2a\u5bc6\u7801\uff0c\u4ece\u800c\u901a\u8fc7 SSH \u767b\u5f55\u3002<\/p>\n<p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u662f\u5426\u6709\u5f02\u5e38\uff1a<\/p>\n<pre><code class=\"language-bash\"># \u67e5\u770b\u6240\u6709\u8bbe\u7f6e\u4e86\u5bc6\u7801\u7684\u7528\u6237\uff08\u7b2c\u4e8c\u5217\u4e0d\u662f * \u6216 ! \u7684\uff09\nawk -F: &#039;($2 != &quot;*&quot; &amp;&amp; $2 != &quot;!&quot;) {print $1}&#039; \/etc\/shadow\n<\/code><\/pre>\n<ul>\n<li><strong>\u6b63\u5e38\u7ed3\u679c\uff1a<\/strong> \u901a\u5e38\u5e94\u8be5\u53ea\u770b\u5230 <code>root<\/code>\uff0c\u6216\u8005\u52a0\u4e0a\u4f60\u81ea\u5df1\u7684\u7528\u6237\u540d\u3002<\/li>\n<li><strong>\u5f02\u5e38\u7ed3\u679c\uff1a<\/strong> \u5982\u679c\u4f60\u770b\u5230\u4e86 <code>www-data<\/code>, <code>mysql<\/code>, <code>nobody<\/code> \u51fa\u73b0\u5728\u5217\u8868\u91cc\uff0c\u8bf4\u660e\u8fd9\u4e9b\u7cfb\u7edf\u8d26\u6237\u88ab\u8bbe\u7f6e\u4e86\u5bc6\u7801\uff0c<strong>\u8fd9\u662f\u7edd\u5bf9\u7684\u540e\u95e8<\/strong>\u3002<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\">2. \u68c0\u67e5 Sudo \u6743\u9650 (<code>\/etc\/sudoers<\/code>)<\/h4>\n<p>\u9ed1\u5ba2\u53ef\u80fd\u4f1a\u8ba9\u4e00\u4e2a\u666e\u901a\u7528\u6237\uff08\u5982 <code>www-data<\/code>\uff09\u62e5\u6709\u514d\u5bc6\u7801\u6267\u884c root \u547d\u4ee4\u7684\u6743\u9650\u3002<\/p>\n<p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-bash\">cat \/etc\/sudoers\nls -la \/etc\/sudoers.d\/\n<\/code><\/pre>\n<ul>\n<li>\u68c0\u67e5\u6587\u4ef6\u4e2d\u662f\u5426\u6709\u7c7b\u4f3c <code>www-data ALL=(ALL) NOPASSWD: ALL<\/code> \u7684\u884c\u3002<\/li>\n<li>\u5982\u679c\u6709\uff0c\u7acb\u5373\u5220\u9664\u3002<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\">3. \u518d\u6b21\u786e\u8ba4 SSH \u5bc6\u94a5<\/h4>\n<p>\u65e2\u7136 <code>root<\/code> \u662f\u552f\u4e00\u80fd\u767b\u5f55\u7684\u7528\u6237\uff0c\u9ed1\u5ba2 100% \u4f1a\u5c1d\u8bd5\u628a\u81ea\u5df1\u7684\u516c\u94a5\u5199\u5165 root \u7684\u8ba4\u8bc1\u6587\u4ef6\u3002<\/p>\n<p><strong>\u518d\u6b21\u6267\u884c\uff08\u786e\u4fdd\u4e07\u65e0\u4e00\u5931\uff09\uff1a<\/strong><\/p>\n<pre><code class=\"language-bash\">cat \/root\/.ssh\/authorized_keys\n<\/code><\/pre>\n<ul>\n<li>\u5982\u679c\u6709\u4f60\u4e0d\u8ba4\u8bc6\u7684 Key\uff0c\u5220\u6389\u3002<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<\/h3>\n<p>\u4f60\u7684 <code>\/etc\/passwd<\/code> \u6587\u4ef6\u672c\u8eab\u662f\u5e72\u51c0\u7684\u3002\u9ed1\u5ba2\u8fd9\u6b21\u6ca1\u6709\u901a\u8fc7\u201c\u65b0\u5efa\u7528\u6237\u201d\u6765\u7559\u540e\u95e8\uff0c\u800c\u662f\u9009\u62e9\u4e86\u66f4\u9690\u853d\u7684\u624b\u6bb5\uff08Systemd \u670d\u52a1\u3001SSH \u5bc6\u94a5\u3001\u6076\u610f\u8fdb\u7a0b\uff09\u3002\u8bf7\u7ee7\u7eed\u6309\u7167\u4e4b\u524d\u7684\u6b65\u9aa4\u6e05\u7406\u6076\u610f\u8fdb\u7a0b\u548c\u9632\u706b\u5899\u89c4\u5219\u3002<\/p>\n<h2 class=\"wp-block-heading\">\u68c0\u67e5systemd-coredump\u8d26\u6237<\/h2>\n<p><code>root@Server:~# awk -F: &#039;($2 != &quot;*&quot; &amp;&amp; $2 != &quot;!&quot;) {print $1}&#039; \/etc\/shadow <\/code>systemd-coredump<\/p>\n<p><strong>\u7ed3\u8bba\uff1a<code>systemd-coredump<\/code> \u8fd9\u4e2a\u8d26\u6237\u88ab\u9ed1\u5ba2\u7be1\u6539\u4e86\uff0c\u5b83\u88ab\u8bbe\u7f6e\u4e86\u5bc6\u7801\uff0c\u6781\u6709\u53ef\u80fd\u662f\u9ed1\u5ba2\u7559\u4e0b\u7684\u9690\u853d\u540e\u95e8\u3002<\/strong><\/p>\n<h3 class=\"wp-block-heading\">\u4e3a\u4ec0\u4e48\u8bf4\u8fd9\u662f\u540e\u95e8\uff1f<\/h3>\n<ol>\n<li><strong>\u7cfb\u7edf\u8d26\u6237\u4e0d\u8be5\u6709\u5bc6\u7801\uff1a<\/strong> <code>systemd-coredump<\/code> \u662f\u7cfb\u7edf\u5185\u7f6e\u8d26\u6237\uff0c\u7528\u4e8e\u5904\u7406\u7a0b\u5e8f\u5d29\u6e83\u65f6\u7684\u6838\u5fc3\u8f6c\u50a8\u3002\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u5b83\u7684\u5bc6\u7801\u5b57\u6bb5\u5e94\u8be5\u662f <code>!<\/code> (\u9501\u5b9a) \u6216 <code>*<\/code> (\u4e0d\u53ef\u767b\u5f55)\u3002<\/li>\n<li><strong>\u539f\u672c\u72b6\u6001\uff1a<\/strong> \u5728\u4f60\u521a\u624d\u53d1\u7684 <code>\/etc\/passwd<\/code> \u5217\u8868\u4e2d\uff0c\u5b83\u7684 Shell \u662f <code>\/usr\/sbin\/nologin<\/code>\u3002<\/li>\n<li><strong>\u77db\u76fe\u70b9\uff1a<\/strong> \u4e00\u4e2a\u88ab\u7981\u6b62\u767b\u5f55 (<code>nologin<\/code>) \u7684\u7cfb\u7edf\u8d26\u6237\uff0c\u5374\u88ab\u4eba\u7279\u610f\u8bbe\u7f6e\u4e86\u4e00\u4e2a\u5bc6\u7801\uff08\u5bfc\u81f4\u5b83\u51fa\u73b0\u5728\u4e86\u4f60\u7684 <code>awk<\/code> \u7b5b\u9009\u7ed3\u679c\u4e2d\uff09\u3002\u8fd9\u5b8c\u5168\u4e0d\u7b26\u5408\u903b\u8f91\uff0c\u9664\u975e\u6709\u4eba\u60f3\u5229\u7528\u5b83\u3002<\/li>\n<\/ol>\n<p>\u867d\u7136\u5b83\u7684 Shell \u662f <code>nologin<\/code>\uff08\u7406\u8bba\u4e0a SSH \u8fde\u4e0d\u4e0a\uff09\uff0c\u4f46\u9ed1\u5ba2\u53ef\u80fd\uff1a<\/p>\n<ul>\n<li>\u914d\u5408\u5176\u4ed6\u6f0f\u6d1e\u63d0\u6743\u3002<\/li>\n<li>\u5229\u7528 <code>su<\/code> \u5207\u6362\uff08\u867d\u7136 <code>nologin<\/code> \u901a\u5e38\u4e5f\u4f1a\u62e6\u622a <code>su<\/code>\uff0c\u4f46\u5982\u679c\u6709 PAM \u914d\u7f6e\u9519\u8bef\u6216\u540e\u95e8\u6a21\u5757\u5219\u4e0d\u4e00\u5b9a\uff09\u3002<\/li>\n<li><strong>\u6700\u91cd\u8981\u7684\u662f\uff1a\u8fd9\u8bc1\u660e\u6709\u4eba\u4fee\u6539\u8fc7 <code>\/etc\/shadow<\/code> \u6587\u4ef6\u3002<\/strong><\/li>\n<\/ul>\n<hr \/>\n<h3 class=\"wp-block-heading\">\u7acb\u5373\u6267\u884c\u7684\u6e05\u7406\u6b65\u9aa4<\/h3>\n<p>\u8bf7\u6309\u987a\u5e8f\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff0c\u5c01\u6b7b\u8fd9\u4e2a\u540e\u95e8\uff1a<\/p>\n<h4 class=\"wp-block-heading\">1. \u9501\u5b9a\u8be5\u8d26\u6237<\/h4>\n<p>\u7acb\u5373\u6e05\u9664\u5b83\u7684\u5bc6\u7801\uff0c\u5c06\u5176\u6062\u590d\u4e3a\u9501\u5b9a\u72b6\u6001\u3002<\/p>\n<pre><code class=\"language-bash\">passwd -l systemd-coredump\n<\/code><\/pre>\n<p>\u6216\u8005\u66f4\u5f7b\u5e95\u5730\uff0c\u76f4\u63a5\u4fee\u6539 shadow \u6587\u4ef6\uff08\u5c06\u5bc6\u7801\u54c8\u5e0c\u66ff\u6362\u4e3a <code>!<\/code>\uff09\uff1a<\/p>\n<pre><code class=\"language-bash\">usermod -p &#039;!&#039; systemd-coredump\n<\/code><\/pre>\n<h4 class=\"wp-block-heading\">2. \u68c0\u67e5\u662f\u5426\u6709\u8fdb\u7a0b\u5728\u4ee5\u8be5\u7528\u6237\u8fd0\u884c<\/h4>\n<p>\u9ed1\u5ba2\u53ef\u80fd\u5df2\u7ecf\u7528\u8fd9\u4e2a\u8eab\u4efd\u8dd1\u8d77\u4e86\u6316\u77ff\u6216\u6728\u9a6c\u8fdb\u7a0b\u3002<\/p>\n<pre><code class=\"language-bash\">ps -u systemd-coredump\n<\/code><\/pre>\n<ul>\n<li><strong>\u6b63\u5e38\u60c5\u51b5\uff1a<\/strong> \u5e94\u8be5\u4e3a\u7a7a\uff0c\u6216\u8005\u53ea\u6709\u6781\u5c11\u6570\u7cfb\u7edf\u8fdb\u7a0b\u3002<\/li>\n<li><strong>\u5f02\u5e38\u60c5\u51b5\uff1a<\/strong> \u5982\u679c\u770b\u5230 <code>wget<\/code>, <code>curl<\/code>, <code>bash<\/code>, <code>sh<\/code> \u6216\u8005\u4e71\u7801\u8fdb\u7a0b\uff0c<strong>\u7acb\u5373\u6740\u6389<\/strong> (<code>kill -9 &lt;PID&gt;<\/code>)\u3002<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\">3. \u68c0\u67e5 Sudo \u6743\u9650 (\u518d\u6b21\u786e\u8ba4)<\/h4>\n<p>\u9ed1\u5ba2\u7ed9\u5b83\u8bbe\u4e86\u5bc6\u7801\uff0c\u5f88\u53ef\u80fd\u540c\u65f6\u4e5f\u7ed9\u4e86\u5b83 Sudo \u6743\u9650\uff0c\u8fd9\u6837\u5373\u4fbf\u4e0d\u662f root \u767b\u5f55\uff0c\u4e5f\u80fd\u53d8\u6210 root\u3002<\/p>\n<pre><code class=\"language-bash\">grep &quot;systemd-coredump&quot; \/etc\/sudoers\ngrep -r &quot;systemd-coredump&quot; \/etc\/sudoers.d\/\n<\/code><\/pre>\n<ul>\n<li><strong>\u5982\u679c\u6709\u8f93\u51fa\uff1a<\/strong> \u7acb\u5373\u5220\u9664\u5bf9\u5e94\u7684\u884c\uff01\u8fd9\u662f\u6781\u5176\u5371\u9669\u7684\u63d0\u6743\u914d\u7f6e\u3002<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\">4. \u68c0\u67e5 SSH \u5bc6\u94a5<\/h4>\n<p>\u867d\u7136\u5b83\u7684 home \u76ee\u5f55\u662f <code>\/<\/code> (\u6839\u76ee\u5f55)\uff0c\u4f46\u6211\u4eec\u8fd8\u662f\u8981\u9632\u4e00\u624b\u3002<\/p>\n<pre><code class=\"language-bash\"># \u68c0\u67e5\u6839\u76ee\u5f55\u4e0b\u662f\u5426\u6709 .ssh \u6587\u4ef6\u5939\uff08\u9664\u4e86 \/root\/.ssh\uff09\nls -la \/.ssh\n<\/code><\/pre>\n<p>\u5982\u679c\u5b58\u5728 <code>\/.ssh<\/code> \u76ee\u5f55\uff0c\u8bf4\u660e\u9ed1\u5ba2\u7ed9\u8fd9\u4e2a\u7528\u6237\uff08Home \u76ee\u5f55\u4e3a <code>\/<\/code>\uff09\u914d\u7f6e\u4e86 SSH \u5bc6\u94a5\uff0c<strong>\u7acb\u5373\u5220\u9664\u6574\u4e2a <code>\/.ssh<\/code> \u76ee\u5f55<\/strong>\u3002<\/p>\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<\/h3>\n<p>\u4f60\u53d1\u73b0\u7684\u8fd9\u4e2a\u70b9\u975e\u5e38\u5173\u952e\u3002<\/p>\n<ul>\n<li><strong>\u6b63\u5e38\uff1a<\/strong> <code>root<\/code> (\u5982\u679c\u5141\u8bb8\u5bc6\u7801\u767b\u5f55)\u3002<\/li>\n<li><strong>\u5f02\u5e38\uff1a<\/strong> <code>systemd-coredump<\/code> \u51fa\u73b0\u5728 <code>shadow<\/code> \u6709\u5bc6\u7801\u7684\u5217\u8868\u4e2d\u3002<\/li>\n<\/ul>\n<p>\u8bf7\u7acb\u5373\u6267\u884c<strong>\u6b65\u9aa4 1<\/strong> \u9501\u5b9a\u8d26\u6237\u3002\u4f60\u7684\u76f4\u89c9\u5f88\u654f\u9510\uff0c\u8fd9\u4e2a\u53d1\u73b0\u53ef\u80fd\u5835\u4f4f\u4e86\u9ed1\u5ba2\u7684\u4e00\u4e2a\u91cd\u8981\u56de\u8fde\u901a\u9053\u3002<\/p>","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\u8fd9\u7bc7\u5206\u6790\u62a5\u544a\uff0c\u91cd\u65b0\u505a\u4e00\u8f6e\u68c0\u67e5\u4fee\u590d <a href=\"https:\/\/www.huntress.com\/blog\/peerbl\">https:\/\/www.huntress.com\/blog\/peerbl<\/a> &hellip; <a href=\"https:\/\/dingxuan.info\/wp\/?p=6533\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u4fee\u590dReact2Shell\u6f0f\u6d1e\u5bfc\u81f4\u670d\u52a1\u5668\u6743\u9650\u6cc4\u9732 \u4e4b\u4e8c<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117],"tags":[],"class_list":["post-6533","post","type-post","status-publish","format-standard","hentry","category-network"],"_links":{"self":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/6533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6533"}],"version-history":[{"count":2,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/6533\/revisions"}],"predecessor-version":[{"id":6535,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/6533\/revisions\/6535"}],"wp:attachment":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}