{"id":294948,"date":"2024-12-13T12:17:23","date_gmt":"2024-12-13T04:17:23","guid":{"rendered":"https:\/\/lrxjmw.cn\/rhzlzsycmlwi.html"},"modified":"2024-12-13T12:17:23","modified_gmt":"2024-12-13T04:17:23","slug":"rhzlzsycmlwi","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/rhzlzsycmlwi.html","title":{"rendered":"\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528chmod\u547d\u4ee4\u4e3aifconfig\u6dfb\u52a0setuid\u6743\u9650\u5e76\u4fee\u6539\u5bc6\u7801"},"content":{"rendered":"
linux\u66f4\u6539\u547d\u4ee4<\/a>\uff1f<\/p>\n chmod<\/p>\n u+s<\/p>\n ifconfig<\/p>\n \u7ed9\u547d\u4ee4\u6dfb\u52a0\u4e00\u4e2asetuid\u6743\u9650\u5c31\u53ef\u4ee5\uff0c\u8fd9\u6837\u6267\u884c\u547d\u4ee4\u65f6\uff0c\u666e\u901a\u7528\u6237\u5c31\u6210\u4e86root\u3002<\/p>\n \u5728linux\u4e2d\uff0c\u4e0d\u7ba1\u662froot\u7528\u6237\u8fd8\u662f\u666e\u901a\u7528\u6237\uff0c\u90fd\u53ef\u4ee5\u4f7f\u7528\u201cpassword\u201d\u547d\u4ee4\u6765\u4fee\u6539\u81ea\u8eab\u7684\u5bc6\u7801\u3002\u5e76\u4e14\uff0clinux\u4e2d\u7684\u5bc6\u7801\u4e00\u822c\u662f\u4fdd\u5b58\u5728\u201c\/etc\/paswd\u201d\u548c\u201c\/etc\/shadow\u201d\u6587\u4ef6\u4e2d\uff0c\u8fd9\u4e24\u4e2a\u6587\u4ef6\u5bf9\u7cfb\u7edf\u5b89\u5168\u81f3\u5173\u91cd\u8981\uff0c\u56e0\u800c\u53ea\u6709root\u7528\u6237\u80fd\u591f\u5bf9\u5176\u6267\u884c\u8bfb\u5199\u64cd\u4f5c\u3002\u4ee5\u7ba1\u7406\u5458\u7684\u8eab\u5206\u767b\u5165\u7cfb\u7edf\uff0c\u5728linxu\u63d0\u793a\u7b26\u4e0b\u6267\u884c\u201cls<\/p>\n \/etc\/passwd<\/p>\n \/etc\/shadow\u201d\u547d\u4ee4\uff0c\u5728\u8fd4\u56de\u4fe1\u606f\u4e2d\u53ef\u4ee5\u770b\u89c1\u666e\u901a\u7528\u6237\u5bf9\u4e0a\u8ff0\u8fd9\u4e24\u4e2a\u6587\u4ef6\u5e76\u6ca1\u6709\u5199\u6743\u9650\uff0c\u56e0\u800c\u4ece\u6587\u4ef6\u5c5e\u6027\u7684\u89d2\u5ea6\u770b\uff0c\u666e\u901a\u7528\u6237\u5728\u4fee\u6539\u81ea\u8eab\u5bc6\u7801\u65f6\uff0c\u662f\u96be\u4ee5\u5c06\u5bc6\u7801\u4fe1\u606f\u5199\u5165\u5230\u4e0a\u8ff0\u6587\u4ef6\u4e2d\u7684\uff0c\u54ea\u4e48\u7528\u6237\u662f\u5982\u4f55\u6210\u529f\u7684\u4fee\u6539\u5bc6\u7801\u7684\u5462\uff1f\u5b9e\u9645\u4e0a\uff0c\u95ee\u9898\u7684\u5173\u952e\u4e0d\u5728\u4e8e\u5bc6\u7801\u6587\u4ef6\u672c\u8eab\uff0c\u800c\u5728\u4e8e\u5bc6\u7801\u4fee\u6539\u547d\u4ee4\u201cpasswd\u201d\u3002\u5728\u63d0\u793a\u7b26\u4e0b\u6267\u884c\u547d\u4ee4\u201cls<\/p>\n \/usr\/bin\/passwd\u201d,\u5728\u8fd4\u56de\u4fe1\u606f\u4e2d\u7684\u6587\u4ef6\u6240\u6709\u8005\u6267\u884c\u6743\u9650\u4f4d\u4e0a\u663e\u793a\u201cs\u201d\u5b57\u6837\uff0c\u8868\u793a\u201cpasswd\u201d\u547d\u4ee4\u5177\u6709setuid\u6743\u9650\uff0c\u5176\u6240\u6709\u8005\u4e3aroot\uff0c\u8fd9\u6837\u666e\u901a\u7528\u6237\u5728\u6267\u884c\u201cpasswd\u201d\u547d\u4ee4\u65f6\uff0c\u5b9e\u9645\u4e0a\u4ee5\u6709\u6548\u7528\u6237root\u7684\u8eab\u5206\u6765\u6267\u884c\u7684\uff0c\u5e76\u5177\u6709\u4e86\u76f8\u5e94\u7684\u6743\u9650\uff0c\u56e0\u800c\u5c06\u65b0\u7684\u5bc6\u7801\u5199\u5165\u5230\u201c\/etc\/passwd\u201d\u548c\u201c\/etc\/shadow\u201d\u6587\u4ef6\u4e2d\uff0c\u5f53\u547d\u4ee4\u6267\u884c\u5b8c\u6bd5\uff0c\u8be5\u7528\u6237\u7684\u8eab\u5206\u7acb\u523b\u6d88\u5931\u3002\u600e\u4e48\u8bbe\u7f6esetuid\u6743\u9650\u5462\uff1f\u4f7f\u7528\u201cchmod\u201d\u547d\u4ee4\u5373\u53ef\u4e3a\u6307\u5b9a\u6587\u4ef6\u8bbe\u7f6esetuid\u6743\u9650\uff0c\u6bd4\u5982\u201cchmod<\/p>\n 4xxx<\/p>\n filename\u201d\u547d\u4ee4linux\u7cfb\u7edf\u65e5\u5fd7\uff0c\u53d6\u6d88setuid\u6743\u9650\u7684\u547d\u4ee4\u4e3a\u201cchmod<\/p>\n xxx<\/p>\n <\/p>\n filename\u201d\u3002\u7c7b\u4f3c\u7684\uff0c\u6267\u884c\u201cchmod<\/p>\n 2xxx<\/p>\n filename\u201d\u547d\u4ee4\u53ef\u4ee5\u8bbe\u7f6esetuid\u6743\u9650\uff0c\u4f7f\u7528\u201cchmod<\/p>\n xxx<\/p>\n filename\u201d\u547d\u4ee4\u5373\u53ef\u53d6\u6d88setgid\u6743\u9650\uff0c\u5018\u82e5\u6267\u884c\u201cchmod<\/p>\n 6xxx<\/p>\n filename\u201d\u547d\u4ee4\uff0c\u5373\u53ef\u540c\u65f6\u4e3a\u6307\u5b9a\u6587\u4ef6\u8bbe\u7f6esetuid\u548csetgid\uff0c\u6267\u884c\u547d\u4ee4\u201cchmod<\/p>\n 0xxx<\/p>\n filename\u201d\uff0c\u5373\u53ef\u540c\u65f6\u53d6\u6d88\u6307\u5b9a\u6587\u4ef6\u7684setuid\u548csetgid\u6743\u9650\u3002\u8bf8\u5982\u4ee5root\u7528\u6237\u767b\u5f55\u7cfb\u7edf\uff0c\u6267\u884c\u201cchmod<\/p>\n 0511<\/p>\n <\/p>\n \/usr\/bin\/passwd\u201d\u547d\u4ee4\uff0c\u5c31\u53ef\u4ee5\u53d6\u6d88\u201cpasswd\u201d\u547d\u4ee4\u7684setuid\u6743\u9650\uff0c\u8fd9\u6837\u666e\u901a\u7528\u6237\u5c31\u96be\u4ee5\u66f4\u6539\u81ea\u5df1\u7684\u5bc6\u7801\u4e86\u3002<\/p>\n linux\u542f\u52a8\u547d\u4ee4\uff1f<\/p>\n \u4e00\uff1a\u542f\u52a8Nginx\u670d\u52a1--\u5728sbin\u76ee\u5f55\u4e0b<\/p>\n \u542f\u52a8\u547d\u4ee4:.\/nginx<\/p>\n \u5173\u6389\u547d\u4ee4:.\/nginx-sstop\u548c.\/nginx-squit<\/p>\n \u5237\u65b0\u914d\u7f6e\u6587\u4ef6:.\/nginx-sreload(\u6bcf\u6b21\u5bf9Nginx\u7684\u914d\u7f6e\u6587\u4ef6nginx.conf\u66f4\u6539\u540elinux\u542f\u52a8nginx\u547d\u4ee4<\/strong>\uff0c\u90fd\u8981\u8fdb\u884c\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6)<\/p>\n \u4e8c\uff1a\u8fdb\u7a0b<\/p>\n \u67e5\u770b\u8fdb\u7a0bps-ef|grep-ixxxx-i\u5927\u7ea6\u662fignore\u662f\u5ffd\u89c6\u7684\u610f\u601d\u8fd9\u513f\u662f\u5ffd\u89c6\u5927\u5c0f\u5199\u3002<\/p>\n \u6740\u5bb3\u8fdb\u7a0bkill-9xxxx<\/p>\n \u4e09\uff1a\u9632\u706b\u5899<\/p>\n \u5f00\u542f\u9632\u706b\u5899serviceiptablesstart<\/p>\n \u5173\u6389\u9632\u706b\u5899serviceiptablesstop<\/p>\n \u67e5\u770b\u9632\u706b\u5899\u7684\u72b6\u6001serviceiptablesstatus<\/p>\n \u6c38\u4e45\u5173\u6389\u9632\u706b\u5899chkconfigiptablesoff<\/p>\n \u56db\uff1a\u542f\u52a8zookeeper\u670d\u52a1--\u5728zookeeper\u7684bin\u76ee\u5f55\u4e0b<\/p>\n \u5f00\u542fzookeeper\u670d\u52a1\uff1a.\/zkServer.shstart<\/p>\n \u67e5\u770bzookeeper\u72b6\u6001.\/zkServer.shstatus<\/p>\n \u4e94\uff1a\u542f\u52a8Redis\u670d\u52a1--\u5728redis\u7684bin\u76ee\u5f55\u4e0b<\/p>\n \u4ee5\u540e\u53f0\u7684\u65b9\u6cd5\u542f\u52a8\uff1a.\/redis-server..\/redis.conf(\u65c1\u8fb9\u7684\u7684redis.conf\u8def\u5f84\u8981\u6309\u7167\u6bcf\u4f4d\u4eba\u914d\u7f6e\u6587\u4ef6\u50a8\u5b58\u7684\u4f4d\u7f6e\u6765\u5199)<\/p>\n \u6b65\u5165redis\u547d\u4ee4\u670d\u52a1\uff1a.\/redis-cli<\/p>\n \u8f93\u5165\uff1aping\u5047\u5982\u8fd4\u56depong\u5219\u8868\u793a\u8054\u63a5\u6210\u529f\uff01<\/p>\n \u516d.\u542f\u52a8tomcat\u670d\u52a1<\/p>\n <\/p>\n