{"id":272,"date":"2013-08-10T18:27:28","date_gmt":"2013-08-10T10:27:28","guid":{"rendered":"http:\/\/www.cyups.com\/?p=268"},"modified":"2013-08-10T18:27:28","modified_gmt":"2013-08-10T10:27:28","slug":"%e5%88%a9%e7%94%a8ddos-deflate%e9%98%b2%e8%8c%83%e5%b0%8f%e9%87%8fddcc%e6%94%bb%e5%87%bb","status":"publish","type":"post","link":"http:\/\/www.cyups.com\/?p=272","title":{"rendered":"\u5229\u7528DDoS Deflate\u9632\u8303\u5c0f\u91cfDDCC\u653b\u51fb"},"content":{"rendered":"<p>DDoS Deflate\u8fd9\u6b3e\u8f6f\u4ef6\u53ef\u4ee5\u9632\u8303\u5c0f\u91cfDDoS\u548cCC\u653b\u51fb\uff0c\u800c\u4e14\u5b83\u5360\u7528\u7684\u65f6\u95f4\u4e0d\u591a\uff0c\u63a8\u8350\u5404\u4f4d\u4f7f\u7528 \u3002<br \/>\n<!--more--><br \/>\n&nbsp;<\/p>\n<h2>\u4e00\u3001\u68c0\u67e5iptables\u662f\u5426\u5728\u8fd0\u884c<\/h2>\n<p>&nbsp;<\/p>\n<pre lang=\"bash\">service iptables status<\/pre>\n<p>&nbsp;<br \/>\nSSH\u6267\u884c\u4ee5\u4e0a\u547d\u4ee4\uff0c\u82e5\u63d0\u793a\u201ciptables: Firewall is not running.\u201d\u8868\u793aiptables\u672a\u8fd0\u884c\uff0c\u9700\u8981\u6267\u884c\u201cservice iptables start\u201d\u8fd0\u884ciptables\u3002\u8be6\u60c5\u53ef\u53c2\u8003\uff1a\u300a<a href=\"http:\/\/www.kwx.gd\/CentOSApp\/iptables-use.html\" target=\"_self\" rel=\"noopener noreferrer\" target=\"_blank\"  rel=\"nofollow\" >iptables\u9632\u706b\u5899\u7684\u57fa\u672c\u5e94\u7528<\/a>\u300b\u3002<br \/>\n&nbsp;<\/p>\n<h2>\u4e8c\u3001\u5b89\u88c5DDoS Deflate<\/h2>\n<p>&nbsp;<\/p>\n<h3>1\u3001\u4e0b\u8f7d<\/h3>\n<p>&nbsp;<\/p>\n<pre lang=\"bash\">wget  http:\/\/soft.kwx.gd\/security\/ddos-Deflat.sh<\/pre>\n<p>&nbsp;<\/p>\n<h3>2\u3001\u8bbe\u7f6e\u6743\u9650\u5e76\u8fd0\u884c\u811a\u672c<\/h3>\n<p>&nbsp;<\/p>\n<pre lang=\"bash\">chmod +x ddos-Deflat.sh    #\u8bbe\u7f6e\u4e3a755\u6743\u9650\n.\/ddos-Deflat.sh<\/pre>\n<p>&nbsp;<br \/>\n\u8fd9\u65f6\u811a\u672c\u4f1a\u81ea\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5\u3002\u82e5\u63d0\u793a\u7c7b\u4f3c\u4e8e\u201c\u514d\u8d23\u58f0\u660e\u201d\u7b49\u82f1\u6587\u5b57\u6837\uff0c\u6309\u201cq\u201d\u952e\u6216\u4efb\u610f\u952e\u5373\u53ef\u9000\u51fa\u3002<br \/>\n\u00a0<img decoding=\"async\" alt=\"ddos-f.jpg\" src=\"http:\/\/www.kwx.gd\/usr\/uploads\/2012\/03\/1349563263.jpg\" \/><br \/>\n&nbsp;<\/p>\n<h2>\u4e09\u3001\u8bbe\u7f6eDDoS Deflate<\/h2>\n<p>&nbsp;<\/p>\n<h3>1\u3001\u4fee\u6539\u6307\u5b9a\u6587\u4ef6<\/h3>\n<p>&nbsp;<\/p>\n<pre lang=\"bash\">vi \/usr\/local\/ddos\/ddos.conf<\/pre>\n<p>&nbsp;<\/p>\n<h3>2\u3001\u6839\u636e\u4ee5\u4e0b\u76f8\u5173\u8bf4\u660e\u8bbe\u7f6e<\/h3>\n<p>&nbsp;<\/p>\n<pre lang=\"bash\">##### Paths of the script and other files\nPROGDIR=\"\/usr\/local\/ddos\"\nPROG=\"\/usr\/local\/ddos\/ddos.sh\"\nIGNORE_IP_LIST=\"\/usr\/local\/ddos\/ignore.ip.list\"  \/\/IP\u767d\u540d\u5355\u6587\u4ef6\nCRON=\"\/etc\/cron.d\/ddos.cron\"    \/\/\u5b9a\u65f6\u6267\u884c\nAPF=\"\/etc\/apf\/apf\"\nIPT=\"\/sbin\/iptables\"\n##### frequency in minutes for running the script\n##### Caution: Every time this setting is changed, run the\nscript with --cron\n#####          option so that the new frequency takes effect\nFREQ=1   \/\/\u68c0\u67e5\u7f51\u7edc\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\u4e3a\u5206\u949f\n##### How many connections define a bad IP? Indicate that below.\nNO_OF_CONNECTIONS=150     \/\/\u5355\u4e2aIP\u6700\u5927\u8fde\u63a5\u6570\uff0c\u82e5\u8d85\u8fc7\u5219\u6267\u884c\u89c4\u5219\uff0c\u9ed8\u8ba4\u5373\u53ef\n##### APF_BAN=1 (Make sure your APF version is atleast 0.96)\n##### APF_BAN=0 (Uses iptables for banning ips instead of APF)\nAPF_BAN=1\n\/\/\u4f7f\u7528APF\u8fd8\u662fiptables\u3002\u63a8\u8350\u4f7f\u7528iptables\uff0c\u5c06APF_BAN\u7684\u503c\u6539\u4e3a0\u5373\u53ef\u3002\n##### KILL=0 (Bad IPs are'nt banned, good for interactive execution\n of script)\n##### KILL=1 (Recommended setting)\nKILL=1   \/\/\u662f\u5426\u5c4f\u853dIP\uff0c\u9ed8\u8ba4\u5373\u53ef\n##### An email is sent to the following address when an IP is banned.\n##### Blank would suppress sending of mails\nEMAIL_TO=\"root\"   \/\/\u5f53IP\u88ab\u5c4f\u853d\u65f6\u7ed9\u6307\u5b9a\u90ae\u7bb1\u53d1\u9001\u90ae\u4ef6\uff0c\u82e5\u4e0d\u4f7f\u7528\u5219\u5728\u524d\u9762\u52a0\u201c#\u201d\u5c4f\u853d\n##### Number of seconds the banned ip should remain in blacklist.\nBAN_PERIOD=600    \/\/\u7981\u7528IP\u65f6\u95f4\uff0c\u9ed8\u8ba4600\u79d2<\/pre>\n<p>&nbsp;<\/p>\n<h3>3\u3001\u4fdd\u5b58\u6587\u4ef6\u5373\u53ef\u751f\u6548<\/h3>\n<p>\u6807\u7b7e: <a href=\"http:\/\/www.kwx.gd\/tag\/iptables\/\" target=\"_blank\"  rel=\"nofollow\" >iptables<\/a>, <a href=\"http:\/\/www.kwx.gd\/tag\/ddos\/\" target=\"_blank\"  rel=\"nofollow\" >ddos<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DDoS Deflate\u8fd9\u6b3e\u8f6f\u4ef6\u53ef\u4ee5\u9632\u8303\u5c0f\u91cfDDoS\u548cCC\u653b\u51fb\uff0c\u800c\u4e14\u5b83\u5360\u7528\u7684\u65f6\u95f4\u4e0d\u591a\uff0c\u63a8\u8350\u5404\u4f4d\u4f7f\u7528 \u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[8],"tags":[77,123],"class_list":["post-272","post","type-post","status-publish","format-standard","hentry","category-8","tag-ddos","tag-iptables"],"_links":{"self":[{"href":"http:\/\/www.cyups.com\/index.php?rest_route=\/wp\/v2\/posts\/272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.cyups.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.cyups.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.cyups.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.cyups.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=272"}],"version-history":[{"count":0,"href":"http:\/\/www.cyups.com\/index.php?rest_route=\/wp\/v2\/posts\/272\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.cyups.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.cyups.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=272"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.cyups.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}