{"id":323020,"date":"2021-02-05T21:19:24","date_gmt":"2021-02-05T13:19:24","guid":{"rendered":"http:\/\/4563.org\/?p=323020"},"modified":"2021-02-05T21:19:24","modified_gmt":"2021-02-05T13:19:24","slug":"linux-%e4%b8%8b%e9%9a%94%e7%a6%bb%e9%83%a8%e5%88%86%e8%bd%af%e4%bb%b6%e7%9a%84%e6%96%87%e4%bb%b6%e8%ae%bf%e9%97%ae%e6%9d%83%e9%99%90","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=323020","title":{"rendered":"Linux \u4e0b\u9694\u79bb\u90e8\u5206\u8f6f\u4ef6\u7684\u6587\u4ef6\u8bbf\u95ee\u6743\u9650"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  Linux \u4e0b\u9694\u79bb\u90e8\u5206\u8f6f\u4ef6\u7684\u6587\u4ef6\u8bbf\u95ee\u6743\u9650               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : whenov <\/span>  <span><i><\/i> 9<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>Windows \u4e0b\u7684 QQ \u4f1a\u626b\u63cf\u6d4f\u89c8\u5668\u5386\u53f2\u8bb0\u5f55\uff0cAndroid \u4e0b\u7684\u90e8\u5206\u8f6f\u4ef6\u4f1a\u5728\u6839\u76ee\u5f55\u4e71\u5efa\u6587\u4ef6\u3002Linux \u4e0b\u867d\u7136\u6682\u65f6\u5c11\u6709\u7c7b\u4f3c\u7684\u60c5\u51b5\uff0c\u4f46\u968f\u7740\u56fd\u5185\u5927\u5382\u8f6f\u4ef6\u6570\u91cf\u7684\u589e\u591a\uff0c\u4e5f\u8981\u672a\u96e8\u7ef8\u7f2a\u3002\u8fd9\u91cc\u5206\u4eab\u4e00\u79cd\u6bd4 docker \u66f4\u8f7b\u91cf\u7684\u9694\u79bb\u8f6f\u4ef6\u6587\u4ef6\u6743\u9650\u7684\u7b80\u6613\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\u4fee\u6b63\u5bb6\u76ee\u5f55\u4e0b\u73b0\u6709\u7684\u6743\u9650\uff1a<\/li>\n<\/ol>\n<pre><code>chmod o-rwx ~  # even g-rwx to be more strict  <\/code><\/pre>\n<ol>\n<li>\u4fee\u590d\u672a\u6765\u7684\u6743\u9650\uff0c\u5728<code>.bash_profile<\/code>\u4e2d\u52a0\u5165\uff1a<\/li>\n<\/ol>\n<pre><code>umask 007  # or even 077 <\/code><\/pre>\n<ol>\n<li>\u65b0\u589e\u4e13\u95e8\u7528\u4e8e\u4e0d\u53ef\u4fe1\u7a0b\u5e8f\u7684\u7528\u6237\uff0c\u5982<code>untrusted<\/code>\uff1a<\/li>\n<\/ol>\n<pre><code>useradd -m -d \/var\/lib\/untrusted -U untrusted <\/code><\/pre>\n<ol>\n<li>\u4e3a\u907f\u514d\u9891\u7e41\u8f93\u5165\u5bc6\u7801\uff0c\u6267\u884c<code>visudo<\/code>\u5e76\u5728\u672b\u5c3e\u52a0\u5165\uff1a<\/li>\n<\/ol>\n<pre><code>my_user ALL=(untrusted) NOPASSWD: ALL <\/code><\/pre>\n<ol>\n<li>\u4e3a\u4e86\u80fd\u5728\u4e0d\u540c\u7528\u6237\u4e0b\u6267\u884c GUI \u7a0b\u5e8f\uff0c\u5728<code>.xinitrc<\/code>\u7b49\u7c7b\u4f3c\u6587\u4ef6\u4e2d\u52a0\u5165\uff1a<\/li>\n<\/ol>\n<pre><code>xhost si:localuser:untrusted <\/code><\/pre>\n<ol>\n<li>\u5c1d\u8bd5\u6267\u884c\u4e0d\u53ef\u4fe1\u7a0b\u5e8f\uff1a<\/li>\n<\/ol>\n<pre><code>sudo -i -u untrusted program <\/code><\/pre>\n<p>\u6ce8\u610f\u6b64\u65b9\u6cd5\u5e76\u4e0d\u80fd\u5efa\u7acb\u771f\u6b63\u5b89\u5168\u7684\u6c99\u76d2\uff0c\u4f46\u53ef\u4ee5\u4ee5\u6210\u672c\u8f83\u4f4e\u7684\u65b9\u5f0f\u6765\u9632\u6b62\u90e8\u5206\u8f6f\u4ef6\u626b\u63cf\u7528\u6237\u6587\u4ef6\u53ca\u5728\u5bb6\u76ee\u5f55\u4e0b\u4e71\u5efa\u6587\u4ef6\u7684\u884c\u4e3a\u3002\u6c99\u76d2\u7684\u5b9e\u73b0\u65b9\u5f0f\u53ef\u53c2\u8003 seccomp \u3002<\/p>\n<p>P. S. \u5982\u679c\u4f60\u6700\u8fd1\u5728\u5bb6\u76ee\u5f55\u4e0b\u53d1\u73b0\u4e86<code>.sys1og.conf<\/code>\u6587\u4ef6\uff0c\u90a3\u662f wechat-uos \u521b\u5efa\u7684\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>13<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4995659\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wevsty <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u76f4\u63a5 chroot \u4e0d\u884c\u4e48\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995660\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : whenov <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wevsty \u4e5f\u884c\uff0c\u4f46\u662f\u4e5f\u9700\u8981 mount &#8211;bind                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995661\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : MicroBotter <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u603b\u611f\u89c9\u7528 SElinux \u6216 Apparomor \u66f4\u597d\u4e00\u4e9b\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995662\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : whenov <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @MicroBotter \u7684\u786e\u66f4\u5b89\u5168\uff0c\u4f46\u5bf9\u6211\u6765\u8bf4\u592a\u91cd\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995663\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : whenov <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6de6\uff0c\u624d\u53d1\u73b0\u5e8f\u53f7\u5168\u4e71\u6389\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995664\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : grazie <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @whenov @MicroBotter firejail \u611f\u89c9\u9002\u4e2d\u5509\uff0c\u8fd8\u80fd\u7528 apparmor \u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995665\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : whenov <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @grazie \u8fd9\u4e2a\u770b\u8d77\u6765\u4e0d\u9519                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995666\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hanguofu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bf7\u95ee\u7528\u4ec0\u4e48\u65b9\u6cd5 \uff08 SElinux \u6216 Apparomor \u6216\u8005 \u4e3b\u4ecb\u7ecd\u7684\u65b9\u6cd5 \u6216\u8005 \u5176\u4ed6 \uff09\u53ef\u4ee5\u5bf9\u5916\u63a5\u7684 \u79fb\u52a8\u786c\u76d8 \/U \u76d8 (\u5047\u8bbe\u662f ntfs \u683c\u5f0f )\u8bbe\u7f6e\u7981\u6b62\u6267\u884c\u7684\u6743\u9650 \uff1aunmask \u79fb\u52a8\u786c\u76d8 \/U \u76d8 111 \uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995667\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : whenov <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @hanguofu mount \u65f6\u52a0\u4e0a noexec flag \u5c31\u884c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995668\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : whenov <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @grazie firejail \u7684 blacklist\/noblacklist\/whitelist\/nowhitelist \u611f\u89c9\u96be\u4ee5\u7406\u89e3\uff0c\u6700\u7ec8\u8fd8\u662f\u7528\u56de\u4e86\u81ea\u5df1\u7684\u65b9\u6cd5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995669\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hanguofu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8c22\u8c22 whenov \u600e\u6837\u624d\u80fd\u77e5\u9053\u54ea\u4e9b\u7528\u6237\u7ec4\u624d\u6709\u6267\u884c mount \u8fd9\u4e2a\u547d\u4ee4\u7684\u6743\u9650\u554a\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995670\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : whenov <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @hanguofu \u9664\u975e\u4fee\u6539 fstab\uff0c\u5426\u5219\u53ea\u80fd\u7528 root \u6765 mount                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4995671\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : EIJAM <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             flatpak \u6216 snap \u5e94\u8be5\u53ef\u4ee5\u63a7\u5236\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>Linux \u4e0b\u9694\u79bb\u90e8\u5206\u8f6f\u4ef6\u7684\u6587\u4ef6\u8bbf&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/323020"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=323020"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/323020\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323020"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}