{"id":2456,"date":"2012-03-16T13:54:39","date_gmt":"2012-03-16T11:54:39","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=2456"},"modified":"2026-02-20T10:12:28","modified_gmt":"2026-02-20T08:12:28","slug":"%d0%b1%d0%bb%d0%be%d0%ba%d0%b8%d1%80%d1%83%d0%b5%d0%bc-%d0%bf%d0%be%d0%b4%d0%b1%d0%be%d1%80-%d0%bf%d0%b0%d1%80%d0%be%d0%bb%d0%b5%d0%b9-%d0%b2-pf-%d1%81%d1%82%d0%b0%d0%bd%d0%b4%d0%b0%d1%80%d1%82%d0%bd","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=2456","title":{"rendered":"\u0411\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0434\u0431\u043e\u0440 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0432 pf \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438"},"content":{"rendered":"<p><strong>PF<\/strong> &#8211; \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438 \u0432 \u0435\u0433\u043e \u0430\u0440\u0441\u0435\u043d\u0430\u043b\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0448\u0442\u0430\u0442\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u0439. \u0418 \u0442\u0430\u043a \u043d\u0443\u0436\u043d\u0430 \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f:<\/p>\n<p><code>table &lt;badhosts&gt; persist<br \/>\n...<br \/>\nblock drop in quick on $ext_if from to any label \"ssh bruteforce\"<br \/>\nblock drop out quick on $ext_if from any to label \"ssh bruteforce\"<br \/>\n...<br \/>\npass in quick on $ext_if proto tcp from any to ($ext_if) port 22 flags S\/SA keep state (max-src-conn-rate 1\/60, overloadflush global)<\/code><\/p>\n<p><!--more--><\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0445, \u043a\u0442\u043e \u0437\u0430 60 \u0441\u0435\u043a\u0443\u043d\u0434 \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 1 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u0438. \u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u044b\u0442\u043e\u043a &#8211; \u044d\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u044b\u0442\u043e\u043a, \u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439. \u0422\u043e \u0435\u0441\u0442\u044c \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043f\u0440\u0438 \u043e\u0434\u043d\u043e\u043c \u043e\u0434\u043d\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043f\u0440\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u0435\u043c\u043e\u043d\u0430 <strong>sshd<\/strong> \u0432\u044b \u0438\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c 3 \u0440\u0430\u0437\u0430 \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u0430\u0440\u043e\u043b\u044c. \u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u0430\u0448 \u0440\u0430\u0437\u044a\u0435\u0434\u0435\u043d\u044f\u0435\u0442 \u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u043f\u044f\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0438 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u043f\u044f\u0442\u044c 3 \u0440\u0430\u0437\u0430 \u043f\u0430\u0440\u043e\u043b\u044c. \u0422\u0430\u043a \u0432\u043e\u0442, \u0437\u0434\u0435\u0441\u044c \u043a\u0430\u043a \u0440\u0430\u0437 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043f\u043e\u0434\u0431\u043e\u0440\u043e\u0432 (\u0438\u0445 \u0431\u0443\u0434\u0435\u0442 3 \u0440\u0430\u0437\u0430 \u0431\u043e\u043b\u044c\u0448\u0435) \u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439.<br \/>\n\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435 \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u0435\u043b\u0438 \u0437\u0430\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 <strong>badhosts<\/strong>\u00a0\u0438 \u0438\u0445 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043e\u0431\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f. \u041e\u0447\u0438\u0449\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u043a\u0440\u043e\u043d\u0443: \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<p><code>0 0 * * * \/sbin\/pfctl -t badhosts -T flush<\/code><\/p>\n<p>\u0422\u0430\u043a \u043c\u044b \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u0440\u043e\u0432\u043d\u043e \u0432 \u043f\u043e\u043b\u043d\u043e\u0447\u044c \u0432\u0441\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435\u0433\u043e\u0434\u044f\u0435\u0432 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p><code># pfctl -t badhosts -T show<br \/>\n24.156.222.5<\/code><\/p>\n<p><span style=\"color: #ff6600;\"><em><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/strong><\/em><\/span><\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 <strong>FreeBSD<\/strong> 11.0 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/people.freebsd.org\/~lidl\/blacklistd.html\">blacklistd<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u043a\u043e\u0447\u0435\u0432\u0430\u043b \u0438\u0437 <strong>NetBSD<\/strong><\/p>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <strong>sysctl<\/strong>:<\/p>\n<pre><code>net.pf.request_maxcount=500000<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>PF &#8211; \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438 \u0432 \u0435\u0433\u043e \u0430\u0440\u0441\u0435\u043d\u0430\u043b\u0435 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0448\u0442\u0430\u0442\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u0439. \u0418 \u0442\u0430\u043a \u043d\u0443\u0436\u043d\u0430 \u0442\u0430\u043a\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f: table &lt;badhosts&gt; persist &#8230; block drop in quick on $ext_if from to any label &#8220;ssh bruteforce&#8221; block drop out quick on $ext_if from any to label &#8220;ssh bruteforce&#8221; &#8230; pass in quick on $ext_if proto [&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,25,13],"tags":[],"class_list":["post-2456","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-openbsd","category-security"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2456","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=2456"}],"version-history":[{"count":6,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2456\/revisions"}],"predecessor-version":[{"id":6683,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2456\/revisions\/6683"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}