{"id":5264,"date":"2020-05-11T17:55:00","date_gmt":"2020-05-11T09:55:00","guid":{"rendered":"https:\/\/www.ldhost.cn\/jc\/?p=5264"},"modified":"2020-03-18T08:46:16","modified_gmt":"2020-03-18T00:46:16","slug":"%e9%98%b2%e8%8c%83http%e6%b4%aa%e6%b5%81%e5%92%8c%e5%b0%8f%e5%9e%8bddos%e6%94%bb%e5%87%bb","status":"publish","type":"post","link":"https:\/\/www.ldhost.cn\/jc\/ot\/5264.html","title":{"rendered":"\u9632\u8303HTTP\u6d2a\u6d41\u548c\u5c0f\u578bDDoS\u653b\u51fb"},"content":{"rendered":"\n<p>\u9632\u6b62HTTP\u6d2a\u6d41\u548cWEB<a href=\"https:\/\/www.ldhost.cn\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"\u670d\u52a1\u5668\uff08\u5728\u65b0\u7a97\u53e3\u6253\u5f00\uff09\">\u670d\u52a1\u5668<\/a>\u4e0a\u7684\u5c0f\u578bDDoS\u653b\u51fb\u7684\u4e00\u79cd\u5178\u578b\u65b9\u6cd5\u662f\u4f7f\u7528\uff08D\uff09DoS Deflate\u5b9e\u7528\u7a0b\u5e8f\u3002\u8be5\u5b9e\u7528\u7a0b\u5e8f\u7684\u5de5\u4f5c\u539f\u7406\u57fa\u4e8e\u4ece\u4e00\u4e2aIP\u83b7\u5f97\u8fde\u63a5\u6570\u3002\u8fd9\u662f\u4f7f\u7528netstat\u5b9e\u7528\u7a0b\u5e8f\u5b8c\u6210\u7684\uff1a<br> $ netstat -n -p | awk &#8216;{print $5}&#8217;|awk -F: &#8216;{print $1}&#8217; | sort -n | uniq -c | sort -nr | head -n10<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>734 109.120.130.51<br>\n  562 77.221.129.90<br>\n  415 109.206.161.21<br>\n  410 109.86.223.41<br>\n  \u8fd9\u6837\u7684\u4fdd\u62a4\u6709\u4e00\u4e2a\u5f88\u5927\u7684\u7f3a\u70b9-\u65e0\u6cd5\u4ece\u4e00\u4e2aIP\u4e2d\u9009\u62e9\u6700\u4f73\u8fde\u63a5\u6570\uff0c\u8fd9\u88ab\u8ba4\u4e3a\u662f\u4e00\u79cd\u653b\u51fb\u3002<\/p><\/blockquote>\n\n\n\n<p>\u5927\u591a\u6570Internet\u63d0\u4f9b\u5546\u90fd\u4f7f\u7528NAT\uff0c\u56e0\u6b64\u8bb8\u591a\u7528\u6237\u5177\u6709\u76f8\u540c\u7684IP\u3002\u4eceWEB\u670d\u52a1\u5668\u7684\u4fa7\u9762\u65e0\u6cd5\u7406\u89e3-\u6765\u81ea\u4e00\u4e2aIP\u7684\u5927\u91cf\u8fde\u63a5\u662f\u653b\u51fb\uff0c\u6216\u8005\u8fd9\u4e9b\u662f\u5177\u6709\u76f8\u540cIP\u7684\u4e0d\u540c\u7528\u6237\u3002\u540c\u65f6\uff0c\u540c\u4e00\u7ad9\u70b9\u53ef\u4ee5\u4ece\u4e00\u4e2aIP\u751f\u6210\u5b8c\u5168\u4e0d\u540c\u6570\u91cf\u7684\u8bf7\u6c42\uff0c\u4f8b\u5982\u56fe\u50cf\u641c\u7d22\u3002\u4e00\u4e2a\u641c\u7d22\u53ef\u4ee5\u7ed9\u51fa10\u4e2a\u6216100\u4e2a\u7ed3\u679c-\u6bcf\u4e2a\u8d44\u6e90\u90fd\u662fIP\u8bf7\u6c42\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\uff0c\u5728\u7d27\u6025\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff08D\uff09DoS Deflate\u6216netstat\uff0c\u4f46\u662f\uff0c\u6709\u5fc5\u8981\u4e86\u89e3\u963b\u6b62\u662f\u76f8\u5f53\u4e0d\u793c\u8c8c\u7684\uff0c\u5e76\u4e14\u6211\u4eec\u4e0d\u5efa\u8bae\u60a8\u6301\u7eed\u4f7f\u7528\u6b64\u65b9\u6cd5\uff08\u6dfb\u52a0\u5230cron\u4e2d\uff09\u3002<\/p>\n\n\n\n<p>XDDoS-DDoS\u4fdd\u62a4\u7cfb\u7edf<br>\n\u8fd8\u6709\u53e6\u4e00\u79cd\u5904\u7406\u6d2a\u707e\u7684\u65b9\u6cd5-\u4f7f\u7528XDDoS\u89e3\u6790\u8bbf\u95ee\u65e5\u5fd7\u3002<\/p>\n\n\n\n<p>\u5f53\u524d\uff0c\u5df2\u7ecf\u5b9e\u73b0\u4e86nginx\u8bbf\u95ee\u65e5\u5fd7\u89e3\u6790\u5668\uff0c\u4f46\u662f\u5bf9\u4efb\u4f55Web\u670d\u52a1\u5668\u7684\u65e5\u5fd7\u8fdb\u884c\u89e3\u6790\u975e\u5e38\u7b80\u5355\u3002\u8981\u963b\u6b62\uff0c\u60a8\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528Advanced Policy Firewall\u6216iptables\u3002<\/p>\n\n\n\n<p>\u5de5\u4f5c\u539f\u7406<br>\nXDDoS\u89e3\u6790Web\u670d\u52a1\u5668\u65e5\u5fd7\u5e76\u786e\u5b9a\u5bf9\u7279\u5b9aURL\u7684\u8bf7\u6c42\u6570\u3002\u5982\u679c\u8be5\u6570\u5b57\u8d85\u8fc7\u6307\u5b9a\u7684\u9608\u503c\uff08\u53c2\u6570\u2014\u9608\u503c\uff09\uff0c\u5219IP\u88ab\u963b\u6b62\u3002<\/p>\n\n\n\n<p>\u793a\u4f8b\uff1a<br>\n\uff081\uff09http:\/\/attacktarget.com\/main<br>\n\uff082\uff09http:\/\/attacktarget.com\/dfjslkdjf?query=fdksjf<br>\n\uff083\uff09http:\/\/attacktarget.com\/dfjslkdjf?query=3847587<\/p>\n\n\n\n<p>\u4f8b\u5982\uff0c\u5982\u679c\u6765\u81ea\u540c\u4e00IP\u7684URL\uff082\uff09\u5305\u542b35\u4e2a\u4ee5\u4e0a\u7684\u8bf7\u6c42\uff08\u9ed8\u8ba4\u503c\uff09\uff0c\u5219\u8be5IP\u88ab\u963b\u6b62\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528XDDoS\u9632\u5fa1DDoS\u653b\u51fb\u548cHTTP\u6d2a\u6d41\u7684\u793a\u4f8b<\/p>\n\n\n\n<p>nginx\u65e5\u5fd7\u5206\u6790\u548c\u901a\u8fc7APF\u963b\u6b62<\/p>\n\n\n\n<p>tail -n 1000 \/var\/log\/nginx\/access.log | xddos &#8211;dry-run -p \/var\/run\/httpprot.pid -f nginx -b apf &#8211;stdin<\/p>\n\n\n\n<p>Nginx\u65e5\u5fd7\u5206\u6790\u548c\u901a\u8fc7iptables\u963b\u6b62<\/p>\n\n\n\n<p>tail -n 1000 \/var\/log\/nginx\/access.log | xddos &#8211;dry-run -p \/var\/run\/httpprot.pid -f nginx -b iptables &#8211;stdin<br> \u60a8\u9700\u8981\u5728\u542f\u52a8\u6a21\u5f0f\u4e0b\u5220\u9664\u2013dry-run\u952e\u3002<\/p>\n\n\n\n<p>\u8981\u63a7\u5236\u6bcf\u4e2aURL\u7684\u8bf7\u6c42\u6570\uff0c\u8bf7\u4f7f\u7528\u2013threshold\u53c2\u6570\u3002<\/p>\n\n\n\n<p>\u53ef\u4ee5\u4f7f\u7528\u811a\u672c\/usr\/share\/xddos\/tlog.sh \u800c\u4e0d\u662ftail -n 1000\uff0c\u8be5\u811a\u672c\u53ef\u8ba9\u60a8\u5728\u4e24\u6b21\u542f\u52a8\u4e4b\u95f4\u83b7\u53d6WEB\u670d\u52a1\u5668\u65e5\u5fd7\u7684\u9644\u52a0\u90e8\u5206\u3002\u5728\/usr\/share\/xddos\/runner.sh\u4e2d\u4f7f\u7528\u811a\u672c\u7684\u793a\u4f8b\uff08\u6b64\u811a\u672c\u901a\u8fc7\u5177\u6709\u81ea\u52a8\u4fdd\u62a4\u529f\u80fd\u7684cron\u8fd0\u884c\uff09\u3002<\/p>\n\n\n\n<p>\u5b89\u88c5XDDoS<br> wget &#8211;no-check-certificate https:\/\/bootstrap.pypa.io\/get-pip.py<br> python get-pip.py<\/p>\n\n\n\n<p>pip install pip &#8211;upgrade &#8211;no-cache-dir<br>\npip install xddos<\/p>\n\n\n\n<p>\u66f4\u65b0<\/p>\n\n\n\n<p>pip install xddos &#8211;upgrade &#8211;no-cache-dir<\/p>\n\n\n\n<p>\u6587\u6863<\/p>\n\n\n\n<p>xddos -h<br> \u53ef\u4ee5\u5c06XDDoS\u6dfb\u52a0\u5230cron\u4e2d\u4ee5\u8fdb\u884c\u5b9e\u65f6Web<a href=\"https:\/\/www.ldhost.cn\/usaserver.html\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"\u670d\u52a1\u5668\uff08\u5728\u65b0\u7a97\u53e3\u6253\u5f00\uff09\">\u670d\u52a1\u5668<\/a>\u4fdd\u62a4\uff1a<br> cd \/usr\/share\/xddos<br> .\/enable.sh<\/p>\n\n\n\n<p>\u7981\u7528\u5b9e\u65f6\u4fdd\u62a4<\/p>\n\n\n\n<p>cd \/usr\/share\/xddos<br> .\/disable.sh<br>XDDOS\u5728Github\u4e0a\u7684\u6587\u4ef6\u548c\u5b89\u88c5\uff1a<a href=\"https:\/\/github.com\/servancho\/xddos\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"https:\/\/github.com\/servancho\/xddos\uff08\u5728\u65b0\u7a97\u53e3\u6253\u5f00\uff09\">https:\/\/github.com\/servancho\/xddos<\/a><\/p>\n<div><img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/images\/ad-845-3.png\" alt=\"\u56fe\u7247\u63cf\u8ff0\" \/><\/div>","protected":false},"excerpt":{"rendered":"<p>\u9632\u6b62HTTP\u6d2a\u6d41\u548cWEB\u670d\u52a1\u5668\u4e0a\u7684\u5c0f\u578bDDoS\u653b\u51fb\u7684\u4e00\u79cd\u5178\u578b\u65b9\u6cd5\u662f\u4f7f\u7528\uff08D\uff09DoS Deflate\u5b9e\u7528\u7a0b\u5e8f\u3002\u8be5\u5b9e\u7528\u7a0b\u5e8f\u7684\u5de5\u4f5c\u539f\u7406\u57fa\u4e8e\u4ece\u4e00\u4e2aIP\u83b7\u5f97\u8fde\u63a5\u6570\u3002\u8fd9\u662f\u4f7f\u7528netstat\u5b9e\u7528\u7a0b\u5e8f\u5b8c\u6210\u7684\uff1a $ netstat -n -p | awk &#8216;{print $5}&#8217;|awk -F: &#8216;{print $1}&#8217; | sort -n | uniq -c | sort -nr | head -n10 734 109.120.130.51 562 77.221.129.90 415 109.206.161.21 410 109.86.223.41 \u8fd9\u6837\u7684\u4fdd\u62a4\u6709&#8230; <a href=\"https:\/\/www.ldhost.cn\/jc\/ot\/5264.html\" class=\"readmore\">\u9605\u8bfb\u5168\u6587<span class=\"screen-reader-text\">\u9632\u8303HTTP\u6d2a\u6d41\u548c\u5c0f\u578bDDoS\u653b\u51fb<\/span><span class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-5264","post","type-post","status-publish","format-standard","hentry","category-ot","content-layout-excerpt-thumb"],"_links":{"self":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/5264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/comments?post=5264"}],"version-history":[{"count":1,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/5264\/revisions"}],"predecessor-version":[{"id":5265,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/posts\/5264\/revisions\/5265"}],"wp:attachment":[{"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/media?parent=5264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/categories?post=5264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ldhost.cn\/jc\/wp-json\/wp\/v2\/tags?post=5264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}