{"id":2541,"date":"2012-04-12T19:03:39","date_gmt":"2012-04-12T16:03:39","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=2541"},"modified":"2024-10-10T14:50:02","modified_gmt":"2024-10-10T11:50:02","slug":"%d0%bf%d0%be%d0%b2%d1%8b%d1%88%d0%b0%d0%b5%d0%bc-%d0%b1%d0%b5%d0%b7%d0%be%d0%bf%d0%b0%d1%81%d0%bd%d0%be%d1%81%d1%82%d1%8c","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=2541","title":{"rendered":"\u041f\u043e\u0432\u044b\u0448\u0430\u0435\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c"},"content":{"rendered":"<p>\u0427\u0430\u0441\u0442\u0435\u043d\u044c\u043a\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b \u043d\u0435 \u043e\u0442\u0434\u0430\u044e\u0442 \u0434\u043e\u043b\u0436\u043d\u043e\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0430 \u0437\u0440\u044f. \u041f\u0443\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u044d\u0442\u043e \u043d\u0435 \u0432\u0430\u0436\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0437\u043e\u043c\u0431\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0431\u043e\u0442\u043d\u0435\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0433\u043e-\u0442\u043e <strong>DDoS&#8217;<\/strong>\u0438\u0442\u044c \u0438\u043b\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c <strong>malware.<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043c\u0435\u0440\u044b \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e:<\/p>\n<p><!--more--><\/p>\n<p><strong><span style=\"color: #ff0000;\">1) \u041b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u043e ssh<\/span><\/strong><\/p>\n<p>\u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0448\u044c \u0437\u043d\u0430\u0442\u044c \u043a\u0442\u043e \u0438 \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0448\u0451\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0421\u0430\u043c\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043b\u043e\u0433\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 <strong>\/var\/log\/auth.log<\/strong>, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e \u0431\u044b \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043b\u043e\u0433\u0438\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b email \u043d\u0430 \u043f\u043e\u0447\u0442\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0444\u0430\u0439\u043b <strong>\/etc\/ssh\/sshrc<\/strong> \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:<\/p>\n<p><code>echo -e \"Successfuly login via ssh on $(hostname)\\n\\nDate:\\t\\t$(date +%d.%m.%Y\\ %H:%M:%S)\\nRemote connection :\\t$SSH_CONNECTION\\nUser:\\t\\t$USER\\nShell:\\t\\t$SSH_TTY\" | \/usr\/bin\/mail -s \"[SSH] Login on $(hostname)\" root@domain.com<\/code><\/p>\n<p>\u041f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u044f\u0449\u0438\u043a \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439, \u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0449\u0438\u043a\u043e\u0432. \u0412\u043e\u043e\u0431\u0449\u0435 <strong>\/etc\/ssh\/sshrc<\/strong> &#8211; \u044d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <strong>shell<\/strong> \u0441\u043a\u0440\u0438\u043f\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u0435\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 shell&#8217;a<\/p>\n<p><strong><span style=\"color: #ff0000;\">2) \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043f\u0430\u0440\u043e\u043b\u0435\u0439<\/span><\/strong><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u043f\u043e\u0434\u0431\u043e\u0440\u0435 \u043f\u0430\u0440\u043e\u043b\u0435\u0439<strong> ssh<\/strong>, \u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043a \u043f\u043e\u0447\u0442\u0435 \u0438\u043b\u0438 <strong>ftp<\/strong>. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442<strong> fail2ban<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u0422\u0430\u043a \u0436\u0435, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 <strong>fail2ban<\/strong>, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 <strong>ssh: sshit, bruteblock<\/strong><\/p>\n<p><strong><span style=\"color: #ff0000;\">3) \u0417\u0430\u0449\u0438\u0442\u0430 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0444\u0430\u0439\u0435\u0440\u0432\u043e\u043b\u0430<\/span><\/strong><\/p>\n<p>\u0415\u0441\u0442\u044c \u0444\u0430\u0439\u0435\u0440\u0432\u043e\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c \u0432\u0438\u043d\u043e\u0432\u043d\u0438\u043a\u043e\u0432 \u0432 \u0431\u0430\u043d. \u041d\u043e \u043d\u0435 \u0432\u0441\u0435 \u0444\u0430\u0439\u0435\u0440\u0432\u043e\u043b\u044b \u044d\u0442\u043e \u043c\u043e\u0433\u0443\u0442. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f <strong>pf&#8217;a<\/strong>:<\/p>\n<pre>#bruteforce\r\nblock drop in quick on $ext_if from &lt;badhosts&gt; to any label \"ssh bruteforce\"\r\nblock drop out quick on $ext_if from any to &lt;badhosts&gt; label \"ssh bruteforce\"\r\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, overload &lt;badhosts&gt; flush global)<\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u0430\u0449\u0438\u0442\u0443 \u043e\u0442 \u043f\u043e\u0434\u0431\u043e\u0440\u0430: \u0435\u0441\u043b\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 60 \u0441\u0435\u043a\u0443\u043d\u0434 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u043e\u0434\u043d\u0430 \u0441\u0435\u0441\u0441\u0438\u044f \u043f\u043e\u0434\u0431\u043e\u0440\u0430 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432\u0432\u0438\u0434\u0443 \u043e\u0434\u043d\u0430 \u0441\u0435\u0441\u0441\u0438\u044f \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u043e\u043a <strong>MaxAuthTries<\/strong>; \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 6)<\/p>\n<p><strong><span style=\"color: #ff0000;\">4) \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 IDS<\/span><\/strong><\/p>\n<p>\u041d\u0435\u043c\u0430\u043b\u043e\u0432\u0430\u0436\u043d\u044b\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u0441\u044f\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 realtime \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041a \u043d\u0438\u043c \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f\u00a0<strong>rkhunter,\u00a0chkrootkit,\u00a0snort<\/strong><\/p>\n<p><strong><span style=\"color: #ff0000;\">5) \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u0437\u0430\u0449\u0438\u0442\u0435 ssh<\/span><\/strong><\/p>\n<p>&#8211; \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0440\u0442<br \/>\n&#8211; \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u0431\u0435\u0437\u043f\u0430\u0440\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u0445\u043e\u0434, \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u0445\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c<br \/>\n&#8211; \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f <strong>root&#8217;a<\/strong><br \/>\n&#8211; \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c <strong>MaxAuthTries<\/strong><br \/>\n&#8211; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <strong>Protocol 2<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0427\u0430\u0441\u0442\u0435\u043d\u044c\u043a\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b \u043d\u0435 \u043e\u0442\u0434\u0430\u044e\u0442 \u0434\u043e\u043b\u0436\u043d\u043e\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0430 \u0437\u0440\u044f. \u041f\u0443\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u044d\u0442\u043e \u043d\u0435 \u0432\u0430\u0436\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0437\u043e\u043c\u0431\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0431\u043e\u0442\u043d\u0435\u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u0433\u043e-\u0442\u043e DDoS&#8217;\u0438\u0442\u044c \u0438\u043b\u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c malware. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043c\u0435\u0440\u044b \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e:<\/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,25,13],"tags":[],"class_list":["post-2541","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-linux","category-openbsd","category-security"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2541","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=2541"}],"version-history":[{"count":7,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2541\/revisions"}],"predecessor-version":[{"id":6496,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/2541\/revisions\/6496"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}