{"id":2965,"date":"2012-09-28T17:08:10","date_gmt":"2012-09-28T14:08:10","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=2965"},"modified":"2025-05-20T11:41:54","modified_gmt":"2025-05-20T08:41:54","slug":"%d0%b7%d0%b0%d1%89%d0%b8%d1%82%d0%b0-%d0%be%d1%82-fork-%d0%b1%d0%be%d0%bc%d0%b1","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=2965","title":{"rendered":"\u0417\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 fork \u0431\u043e\u043c\u0431"},"content":{"rendered":"<h2><strong><span style=\"color: #0000ff;\">Solaris<\/span><\/strong><\/h2>\n<p>\u0412 <strong>Solaris<\/strong> \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432\/\u043f\u043e\u0442\u043e\u043a\u043e\u0432 &#8211; \u044d\u0442\u043e \u043f\u0440\u043e\u044d\u043a\u0442. \u0427\u0442\u043e \u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 <strong>fork<\/strong>-\u0431\u043e\u043c\u0431\u043e\u0439, \u043d\u0443\u0436\u043d\u043e \u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e <strong>LWP<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0442\u0443\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <strong>testuser<\/strong>:<\/p>\n<p><code>#projadd -U testuser -K 'project.max-lwps=(privileged,2048,deny)' user.testuser<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c <strong>testuser<\/strong> \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 <strong>2048<\/strong> \u043f\u043e\u0442\u043e\u043a\u043e\u0432.<\/p>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0431\u043e\u043c\u0431\u0443:<\/p>\n<p><code>#!\/usr\/bin\/bash<br \/>\n:(){ :|:&amp; };:<\/code><\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0435 for bomb \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c <a href=\"https:\/\/malwiki.org\/index.php?title=Fork_bomb\">\u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<p><!--more--><\/p>\n<h2><strong><span style=\"color: #0000ff;\">Linux<\/span><\/strong><\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 <strong>fork<\/strong>-\u0431\u043e\u043c\u0431\u0443, \u043d\u043e \u0443 \u0432\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u0430\u0441\u044c <strong>ssh<\/strong> \u0441\u0435\u0441\u0441\u0438\u044f, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p><code>#exec busybox\/python<\/code><\/p>\n<p>\u043e\u0442\u043a\u0443\u0434\u0430 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0443\u0431\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u043d\u0435 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u044f \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0442 <strong>fork bomb<\/strong> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>\/etc\/security\/limits.conf<\/strong>:<\/p>\n<p><code>testuser hard nproc 2048<br \/>\ntestuser hard nofile 2048<\/code><\/p>\n<h2><strong><span style=\"color: #0000ff;\">FreeBSD<\/span><\/strong><\/h2>\n<p>\u0414\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 <strong>login class<\/strong> \u0432 <strong>\/etc\/login.conf<\/strong><\/p>\n<pre>limited_profile:\\\n        :maxproc=2048:\\\n        :tc=default:\n<\/pre>\n<p>\u0438 \u043f\u043e\u0442\u043e\u043c \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<br \/>\n<code><br \/>\n# cap_mkdb \/etc\/login.conf<br \/>\n# pw usermod -L limited_profile testuser<br \/>\n# grep clamav \/etc\/master.passwd | cut -f5 -d':'<br \/>\nlimited_profile<br \/>\n<\/code><\/p>\n<p>\u041d\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0434\u043b\u044f <strong>jail&#8217;\u043e\u0432<\/strong>. \u0422\u043e \u0435\u0441\u0442\u044c, \u0432\u043d\u0443\u0442\u0440\u0438 <strong>jail&#8217;a<\/strong> \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c <strong>fork bomb<\/strong> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <strong>root<\/strong> \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0430\u043c\u043e\u0433\u043e <strong>jail&#8217;a<\/strong> \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0438\u043c\u0435\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439) \u0438 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c &#8220;\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c&#8221; \u0432\u0435\u0441\u044c \u0441\u0435\u0440\u0432\u0435\u0440. \u0414\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c <strong>jail&#8217;\u043e\u0432<\/strong>, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c <strong>rctl<\/strong> (\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 FreeBSD 9):<\/p>\n<p><code># rctl -a jail:myJail:maxproc:deny=100<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Solaris \u0412 Solaris \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432\/\u043f\u043e\u0442\u043e\u043a\u043e\u0432 &#8211; \u044d\u0442\u043e \u043f\u0440\u043e\u044d\u043a\u0442. \u0427\u0442\u043e \u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 fork-\u0431\u043e\u043c\u0431\u043e\u0439, \u043d\u0443\u0436\u043d\u043e \u0438\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e LWP. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0442\u0443\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f testuser: #projadd -U testuser -K &#8216;project.max-lwps=(privileged,2048,deny)&#8217; user.testuser \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c testuser \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 2048 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0431\u043e\u043c\u0431\u0443: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5,24],"tags":[],"class_list":["post-2965","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-linux","category-solaris"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2965"}],"version-history":[{"count":7,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2965\/revisions"}],"predecessor-version":[{"id":6027,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2965\/revisions\/6027"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}