{"id":972,"date":"2010-10-06T08:03:37","date_gmt":"2010-10-06T06:03:37","guid":{"rendered":"http:\/\/netspider.com.ua\/index.php\/2010\/10\/06\/killing-network-connections\/"},"modified":"2010-10-10T18:28:40","modified_gmt":"2010-10-10T16:28:40","slug":"killing-network-connections","status":"publish","type":"post","link":"https:\/\/netspider.com.ua\/index.php\/2010\/10\/06\/killing-network-connections\/","title":{"rendered":"\u041e\u0442\u043b\u043e\u0432 \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u0435\u043b\u0435\u0439 \u043f\u043e\u0440\u044f\u0434\u043a\u0430"},"content":{"rendered":"<h5>DOS, \u043d\u043e \u043d\u0435 MS<\/h5>  <p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>  <pre class=\"brush: bash; title: ; notranslate\" title=\"\"> netstat -nptcp | egrep -v 'Active|Address' | awk '{print $5}' | cut -d . -f 1-4 | sort | uniq -c | sort -n | tail -n 20 <\/pre>  <p>\u0415\u0441\u043b\u0438 \u0441 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043e\u0442\u043d\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u044d\u0442\u043e \u0443\u0436\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \ud83d\ude42 \u041c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u0422\u041e\u041f-20 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 httpd (Apache):<\/p>  <pre class=\"brush: bash; title: ; notranslate\" title=\"\"> sockstat -4 | awk '\/httpd\/{print $7}' | cut -d : -f1 | sort | uniq -c | sort -n | tail -n 10 <\/pre>  <p>\u0415\u0441\u043b\u0438 \u0442\u043e\u043f\u043e\u0432\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044f \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435, \u0437\u043d\u0430\u0447\u0438\u0442 \u0447\u0442\u043e-\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u043b\u043e\u0445\u043e\u0435, \u0414\u041e\u0421\u0438\u0442, \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u0438 \u0438 \u0442.\u043f., \u043d\u0443\u0436\u043d\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0436\u0435 \u043f\u043e \u043b\u043e\u0433\u0443.<\/p>  <p>\u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043d\u0430 \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u0440\u0442\u044b \u044d\u0442\u043e\u0442 \u0430\u0434\u0440\u0435\u0441 \u043b\u043e\u043c\u0438\u0442\u0441\u044f (4-\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0430):<\/p>  <pre class=\"brush: bash; title: ; notranslate\" title=\"\"> netstat -nptcp | grep IP <\/pre>  <h5>Kill \u2018em all<\/h5>  <p>\u0415\u0441\u043b\u0438 \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043a\u0442\u043e-\u0442\u043e \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442 \u0435\u0440\u0443\u043d\u0434\u043e\u0439, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0440\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u044d\u0442\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u043e\u043c, \u0434\u043b\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432:<\/p>  <pre class=\"brush: bash; title: ; notranslate\" title=\"\"> netstat -nptcp | egrep 'IP' | awk '{print $4&quot; &quot;$5}' | sed 's\/\\.\/ \/4;s\/\\.\/ \/7' | xargs -n 4 tcpdrop <\/pre>  <p>\u0412\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0433\u043e IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044f \u0438\u0445 \u043f\u0430\u0439\u043f\u043e\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>  <pre class=\"brush: bash; title: ; notranslate\" title=\"\"> egrep 'IP1|IP2|IPn' <\/pre>  <p>\u041f\u0435\u0440\u0435\u0434 \u0441\u0431\u0440\u043e\u0441\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, IP-\u0430\u0434\u0440\u0435\u0441 \u0437\u043b\u043e\u0441\u0442\u043d\u043e\u0433\u043e \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u0435\u043b\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0431\u0430\u043d\u0438\u0442\u044c \u0432 \u0444\u0430\u0435\u0440\u0432\u043e\u043b\u0435. \ud83d\ude42<\/p>","protected":false},"excerpt":{"rendered":"DOS, \u043d\u043e \u043d\u0435 MS \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0430\u043d\u043e\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a: netstat -nptcp | egrep -v &#8216;Active|Address&#8217; | awk &#8216;{print $5}&#8217; | cut -d . -f 1-4 | sort | uniq -c | sort -n | tail -n 20 \u0415\u0441\u043b\u0438 \u0441 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043e\u0442\u043d\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u044d\u0442\u043e \u0443\u0436\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \ud83d\ude42 \u041c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u0422\u041e\u041f-20 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439,\u2026 <span class=\"read-more\"><a href=\"https:\/\/netspider.com.ua\/index.php\/2010\/10\/06\/killing-network-connections\/\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 &raquo;<\/a><\/span>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1245,1239,1241,519,1139,585,1240,583,1244,1242,595,1246,1243,1247],"class_list":["post-972","post","type-post","status-publish","format-standard","hentry","category-main","tag-awk","tag-bruteforce","tag-cut","tag-ddos","tag-egrep","tag-grep","tag-netstat","tag-sed","tag-sockstat","tag-sort","tag-tail","tag-tcpdrop","tag-uniq","tag-xargs"],"_links":{"self":[{"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/posts\/972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/comments?post=972"}],"version-history":[{"count":0,"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/posts\/972\/revisions"}],"wp:attachment":[{"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/media?parent=972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/categories?post=972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netspider.com.ua\/index.php\/wp-json\/wp\/v2\/tags?post=972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}