{"id":89903,"date":"2020-05-13T03:53:20","date_gmt":"2020-05-12T19:53:20","guid":{"rendered":"http:\/\/4563.org\/?p=89903"},"modified":"2020-05-13T03:53:20","modified_gmt":"2020-05-12T19:53:20","slug":"%e8%af%b7%e6%95%99%e4%b8%aa-nginx-%e7%ab%af%e5%8f%a3%e8%bd%ac%e5%8f%91%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=89903","title":{"rendered":"\u8bf7\u6559\u4e2a nginx \u7aef\u53e3\u8f6c\u53d1\u7684\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8bf7\u6559\u4e2a nginx \u7aef\u53e3\u8f6c\u53d1\u7684\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Raul7 <\/span>  <span><i><\/i> 11<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u673a\u5668 A \u5728\u5f02\u5730\uff0c\u6211\u672c\u5730\u65e0\u6cd5\u76f4\u63a5\u8fde\u63a5\uff0c\u673a\u5668 A \u4e0a\u90e8\u7f72\u4e86\u4e2a\u670d\u52a1\uff0c64297 \u7aef\u53e3\u4e86 nginx \u4ee3\u7406\uff0c\u5f00\u542f\u4e86 ssl \u3001auth \u7b49\u3002\u76f8\u5173\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n<pre><code>server {      #########################     ### Basic server settings     #########################     listen 64297 ssl http2;     index tpotweb.html;     ssl_protocols TLSv1.3;     server_name example.com;     error_page 300 301 302 400 401 402 403 404 500 501 502 503 504 \/error.html;       ##############################################     ### Remove version number add different header     ##############################################     server_tokens off;     more_set_headers 'Server: apache';       ##############################################     ### SSL settings and Cipher Suites     ##############################################     ssl_certificate \/etc\/nginx\/cert\/nginx.crt;     ssl_certificate_key \/etc\/nginx\/cert\/nginx.key;          ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!DHE:!SHA:!SHA256';     ssl_ecdh_curve secp384r1;     ssl_dhparam \/etc\/nginx\/ssl\/dhparam4096.pem;      ssl_prefer_server_ciphers on;     ssl_session_cache shared:SSL:10m;       ####################################     ### OWASP recommendations \/ settings     ####################################      ### Size Limits &amp; Buffer Overflows      ### the size may be configured based on the needs.      client_body_buffer_size  128k;     client_header_buffer_size 1k;     client_max_body_size 256k;     large_client_header_buffers 2 1k;      ### Mitigate Slow HHTP DoS Attack     ### Timeouts definition ##     client_body_timeout   10;     client_header_timeout 10;     keepalive_timeout     5 5;     send_timeout          10;      ### X-Frame-Options is to prevent from clickJacking attack     add_header X-Frame-Options SAMEORIGIN;      ### disable content-type sniffing on some browsers.     add_header X-Content-Type-Options nosniff;      ### This header enables the Cross-site scripting (XSS) filter     add_header X-XSS-Protection \"1; mode=block\";      ### This will enforce HTTP browsing into HTTPS and avoid ssl stripping attack     add_header Strict-Transport-Security \"max-age=31536000; includeSubdomains;\";       ##################################     ### Restrict access and basic auth     ##################################      # satisfy all;     satisfy any;      allow 127.0.0.1;     allow ::1;     deny  all;      auth_basic           \"closed site\";     auth_basic_user_file \/etc\/nginx\/nginxpasswd;       #################     ### Proxied sites     #################      ### Kibana     location \/kibana\/ {         proxy_pass http:\/\/127.0.0.1:64296;         rewrite \/kibana\/(.*)$ \/$1 break;     }      ### ES      location \/es\/ {         proxy_pass http:\/\/127.0.0.1:64298\/;         rewrite \/es\/(.*)$ \/$1 break;     }      ### head standalone      location \/myhead\/ {         proxy_pass http:\/\/127.0.0.1:64302\/;         rewrite \/myhead\/(.*)$ \/$1 break;     }      ### CyberChef     location \/cyberchef {         proxy_pass http:\/\/127.0.0.1:64299;         rewrite ^\/cyberchef(.*)$ \/$1 break;     }      ### spiderfoot     location \/spiderfoot {         proxy_pass http:\/\/127.0.0.1:64303;     }          location \/static {             proxy_pass http:\/\/127.0.0.1:64303\/spiderfoot\/static;         }          location \/scanviz {             proxy_pass http:\/\/127.0.0.1:64303\/spiderfoot\/scanviz;         }                  location \/scandelete {             proxy_pass http:\/\/127.0.0.1:64303\/spiderfoot\/scandelete;         }  } <\/code><\/pre>\n<p>\u6211\u8fd9\u8fb9\u6709\u53f0\u53ef\u4ee5\u8fde\u63a5\u7684 B \u673a\u5668\uff0c\u53ef\u4ee5\u901a\u8fd9\u4e2a A \u673a\u5668\u3002 \u6211\u60f3\u8bbf\u95ee A \u673a\u5668\u7684 64297 \u7aef\u53e3\uff0c\u6545\u60f3\u901a\u8fc7 B \u673a\u5668\u505a\u4e2d\u8f6c\uff0c\u5c06 A \u673a\u5668\u7684 64297 \u7aef\u53e3\u4ee3\u7406\u5230 B \u673a\u5668\u4e0a\uff0cB \u673a\u5668 nginx \u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n<pre><code>     server {         listen 64297;                          location \/ {             # x.x.x.x \u4e3a A \u673a\u5668 ip             proxy_pass https:\/\/x.x.x.x:64297\/;         }      }  <\/code><\/pre>\n<p>\u4f46\u662f\u8bbf\u95ee B \u673a\u5668\u7684 64297 \u7aef\u53e3\uff0c\u4e00\u76f4\u62a5 502 \u3002<\/p>\n<p>\u8bf7\u6559\u4e0b\u5927\u5bb6\uff0c\u8be5\u5982\u4f55\u89e3\u51b3\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>7<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1327668\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jmyz0455 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5149\u662f\u8bf4 502 \u8303\u56f4\u633a\u5e7f\u7684\uff0c\u53ea\u80fd\u591f\u53eb\u4f60\u6d4b\u8bd5\u6e05\u695a B \u662f\u4e0d\u662f\u771f\u7684\u80fd\u8fde\u63a5 A \u3002<br \/>\u5982\u679c\u6709\u65e5\u5fd7\u4f1a\u597d\u5224\u65ad\u4e00\u4e9b\uff0c\u5efa\u8bae\u4f60 A B \u7684\u914d\u7f6e\u90fd\u8bb0\u5f55\u4e00\u4e0b log\uff0c\u770b\u770b\u662f\u54ea\u8fb9\u7684\u95ee\u9898\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1327669\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : MonoLogueChi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60 A \u673a\u5668\u4e0a\u5f00\u4e86 ssl\uff0c\u4ece B \u673a\u5668\u53cd\u4ee3\u8bbf\u95ee A \u673a\u5668\u7684\u65f6\u5019\uff0c\u5c31\u8981\u8bbe\u7f6e host \u5934\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1327670\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : silencexxx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3a\u5565\u975e\u7528 NGINX \u505a\u4e2d\u8f6c\u6d41\u91cf\uff1f iptables \u5b9e\u73b0\u7aef\u53e3\u6620\u5c04\u4e0d\u597d\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1327671\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : PriestTomb <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u60f3\u8d77\u524d\u4e0d\u4e45 V \u7ad9\u770b\u5230\u7684\u5e16\u5b50\uff0c\u8bd5\u8bd5 B \u673a\u5668 Nginx \u7684 proxy_pass \u91cc ip:port \u540e\u9762\u7684\u659c\u6760\u53bb\u6389\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1327672\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qwerthhusn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             proxy_pass https:\/\/x.x.x.x:64297\/;<br \/>\u4e0d\u77e5\u9053\u8ddf\u4fe1\u4efb\u8bc1\u4e66\u6709\u6ca1\u6709\u5173\u7cfb\uff0cip \u7684\u8bdd\u80af\u5b9a\u662f\u4e0d\u4fe1\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1327673\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cnleon <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 stream \u5427\uff0c\u4f60\u8fd9\u4e2a https \u5c31\u8fc7\u4e0d\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1327674\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : uxff <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8f6c\u7ed9 A\uff0cA \u662f ssl \u5fc5\u987b\u8bbe\u7f6e host \u5934<br \/>proxy_set_header Host $http_host;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u6559\u4e2a nginx \u7aef\u53e3\u8f6c\u53d1\u7684\u95ee\u9898&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/89903"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=89903"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/89903\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=89903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=89903"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=89903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}