激情五月天婷婷,亚洲愉拍一区二区三区,日韩视频一区,a√天堂中文官网8

<ul id="buwfs"><strike id="buwfs"><strong id="buwfs"></strong></strike></ul>
    <output id="buwfs"></output>
  • <dfn id="buwfs"><source id="buwfs"></source></dfn>
      <dfn id="buwfs"><td id="buwfs"></td></dfn>
      <div id="buwfs"><small id="buwfs"></small></div>
      <dfn id="buwfs"><source id="buwfs"></source></dfn>
      1. <dfn id="buwfs"><td id="buwfs"></td></dfn>
        始創(chuàng)于2000年 股票代碼:831685
        咨詢熱線:0371-60135900 注冊有禮 登錄
        • 掛牌上市企業(yè)
        • 60秒人工響應
        • 99.99%連通率
        • 7*24h人工
        • 故障100倍補償
        全部產(chǎn)品
        您的位置: 網(wǎng)站首頁 > 幫助中心>文章內(nèi)容

        如何阻止攻擊,SQL注入,垃圾郵件,用戶代理文件等

        發(fā)布時間:  2012/9/15 17:40:15
        本文介紹了如何可以阻止最常見的漏洞,SQL注入,用戶代理文件,垃圾郵件和黑客使用帶寬粉碎機從后vhosts和一些簡單的配置指令。此配置還遠遠沒有完成,但它是一個很好的起點。你要注意你的日志的企圖嘗試突破,并試圖修改/完整的規(guī)則集。
         
        修改后vhosts
        我在這里使用的規(guī)則已被插入在每個虛擬主機技術(shù)(在后服務器{ }容器),你想使用它。不幸的是,不能用在全球范圍內(nèi)由于集指令是不允許的斷點續(xù)傳{ }容器。
        erver {
        [...]
         
            ## Block SQL injections
            set $block_sql_injections 0;
            if ($query_string ~ "union.*select.*\(") {
                set $block_sql_injections 1;
            }
            if ($query_string ~ "union.*all.*select.*") {
                set $block_sql_injections 1;
            }
            if ($query_string ~ "concat.*\(") {
                set $block_sql_injections 1;
            }
            if ($block_sql_injections = 1) {
                return 403;
            }
         
            ## Block file injections
            set $block_file_injections 0;
            if ($query_string ~ "[a-zA-Z0-9_]=http://") {
                set $block_file_injections 1;
            }
            if ($query_string ~ "[a-zA-Z0-9_]=(\.\.//?)+") {
                set $block_file_injections 1;
            }
            if ($query_string ~ "[a-zA-Z0-9_]=/([a-z0-9_.]//?)+") {
                set $block_file_injections 1;
            }
            if ($block_file_injections = 1) {
                return 403;
            }
         
            ## Block common exploits
            set $block_common_exploits 0;
            if ($query_string ~ "(<|%3C).*script.*(>|%3E)") {
                set $block_common_exploits 1;
            }
            if ($query_string ~ "GLOBALS(=|\[|\%[0-9A-Z]{0,2})") {
                set $block_common_exploits 1;
            }
            if ($query_string ~ "_REQUEST(=|\[|\%[0-9A-Z]{0,2})") {
                set $block_common_exploits 1;
            }
            if ($query_string ~ "proc/self/environ") {
                set $block_common_exploits 1;
            }
            if ($query_string ~ "mosConfig_[a-zA-Z_]{1,21}(=|\%3D)") {
                set $block_common_exploits 1;
            }
            if ($query_string ~ "base64_(en|de)code\(.*\)") {
                set $block_common_exploits 1;
            }
            if ($block_common_exploits = 1) {
                return 403;
            }
         
            ## Block spam
            set $block_spam 0;
            if ($query_string ~ "\b(ultram|unicauca|valium|viagra|vicodin|xanax|ypxaieo)\b") {
                set $block_spam 1;
            }
            if ($query_string ~ "\b(erections|hoodia|huronriveracres|impotence|levitra|libido)\b") {
                set $block_spam 1;
            }
            if ($query_string ~ "\b(ambien|blue\spill|cialis|cocaine|ejaculation|erectile)\b") {
                set $block_spam 1;
            }
            if ($query_string ~ "\b(lipitor|phentermin|pro[sz]ac|sandyauer|tramadol|troyhamby)\b") {
                set $block_spam 1;
            }
            if ($block_spam = 1) {
                return 403;
            }
         
            ## Block user agents
            set $block_user_agents 0;
         
            # Don't disable wget if you need it to run cron jobs!
            #if ($http_user_agent ~ "Wget") {
            #    set $block_user_agents 1;
            #}
         
            # Disable Akeeba Remote Control 2.5 and earlier
            if ($http_user_agent ~ "Indy Library") {
                set $block_user_agents 1;
            }
         
            # Common bandwidth hoggers and hacking tools.
            if ($http_user_agent ~ "libwww-perl") {
                set $block_user_agents 1;
            }
            if ($http_user_agent ~ "GetRight") {
                set $block_user_agents 1;
            }
            if ($http_user_agent ~ "GetWeb!") {
                set $block_user_agents 1;
            }
            if ($http_user_agent ~ "Go!Zilla") {
                set $block_user_agents 1;
            }
            if ($http_user_agent ~ "Download Demon") {
                set $block_user_agents 1;
            }
            if ($http_user_agent ~ "Go-Ahead-Got-It") {
                set $block_user_agents 1;
            }
            if ($http_user_agent ~ "TurnitinBot") {
                set $block_user_agents 1;
            }
            if ($http_user_agent ~ "GrabNet") {
                set $block_user_agents 1;
            }
         
            if ($block_user_agents = 1) {
                return 403;
            }
        [...]
        }
         
         
        每當一個規(guī)則匹配的要求,403個錯誤返回給客戶端。我已經(jīng)評論了wget規(guī)則在這里,因為這也將阻止計劃工作,利用wget是很常見的現(xiàn)代醫(yī)療應用。如果你的應用程序不使用wget,您可以取消,規(guī)則等。
         
         
        別忘了重裝后:
        /etc/init.d/nginx reload

        本文出自:億恩科技【mszdt.com】

        服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]

      2. 您可能在找
      3. 億恩北京公司:
      4. 經(jīng)營性ICP/ISP證:京B2-20150015
      5. 億恩鄭州公司:
      6. 經(jīng)營性ICP/ISP/IDC證:豫B1.B2-20060070
      7. 億恩南昌公司:
      8. 經(jīng)營性ICP/ISP證:贛B2-20080012
      9. 服務器/云主機 24小時售后服務電話:0371-60135900
      10. 虛擬主機/智能建站 24小時售后服務電話:0371-60135900
      11. 專注服務器托管17年
        掃掃關(guān)注-微信公眾號
        0371-60135900
        Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權(quán)所有  地址:鄭州市高新區(qū)翠竹街1號總部企業(yè)基地億恩大廈  法律顧問:河南亞太人律師事務所郝建鋒、杜慧月律師   京公網(wǎng)安備41019702002023號
          0
         
         
         
         

        0371-60135900
        7*24小時客服服務熱線