<legend id='M9uVu'><style id='M9uVu'><dir id='M9uVu'><q id='M9uVu'></q></dir></style></legend>

        <small id='M9uVu'></small><noframes id='M9uVu'>

        <tfoot id='M9uVu'></tfoot>
        <i id='M9uVu'><tr id='M9uVu'><dt id='M9uVu'><q id='M9uVu'><span id='M9uVu'><b id='M9uVu'><form id='M9uVu'><ins id='M9uVu'></ins><ul id='M9uVu'></ul><sub id='M9uVu'></sub></form><legend id='M9uVu'></legend><bdo id='M9uVu'><pre id='M9uVu'><center id='M9uVu'></center></pre></bdo></b><th id='M9uVu'></th></span></q></dt></tr></i><div id='M9uVu'><tfoot id='M9uVu'></tfoot><dl id='M9uVu'><fieldset id='M9uVu'></fieldset></dl></div>
          <bdo id='M9uVu'></bdo><ul id='M9uVu'></ul>
      1. PHP上传文件增强安全性

        PHP Upload file enhance security(PHP上传文件增强安全性)
            <i id='0lyHv'><tr id='0lyHv'><dt id='0lyHv'><q id='0lyHv'><span id='0lyHv'><b id='0lyHv'><form id='0lyHv'><ins id='0lyHv'></ins><ul id='0lyHv'></ul><sub id='0lyHv'></sub></form><legend id='0lyHv'></legend><bdo id='0lyHv'><pre id='0lyHv'><center id='0lyHv'></center></pre></bdo></b><th id='0lyHv'></th></span></q></dt></tr></i><div id='0lyHv'><tfoot id='0lyHv'></tfoot><dl id='0lyHv'><fieldset id='0lyHv'></fieldset></dl></div>

              <small id='0lyHv'></small><noframes id='0lyHv'>

              <legend id='0lyHv'><style id='0lyHv'><dir id='0lyHv'><q id='0lyHv'></q></dir></style></legend>
                • <bdo id='0lyHv'></bdo><ul id='0lyHv'></ul>

                  <tfoot id='0lyHv'></tfoot>
                    <tbody id='0lyHv'></tbody>
                • 本文介绍了PHP上传文件增强安全性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  嘿..我的问题是如何防止有人上传病毒或一些带有你假装扩展名的恶意代码,例如我有一个 pdf 文件上传器,任何人都可以上传带有 pdf 伪装的二进制文件,有很多程序可以做到这一点.

                  Hey.. my question is how to prevent someone upload a virus or some malicious code with the extension you pretend for example i have a pdf file uploader, anyone can upload a binary with pdf camouflage there are lots of programs to do that.

                  推荐答案

                  上传文件时会出现许多安全问题.第一个问题是该文件可能不是您想要的文件,在本例中为 pdf.变量 $_FILES['file_name']['type'] 由攻击者控制,永远不可信任.该值通常使用漏洞利用代码或使用篡改数据进行修改.

                  There are a number of secuirty concerns that arise with uploading files. The first problem is that the file might not be the file you want, in this case a pdf. The variable $_FILES['file_name']['type'] is controlled by the attacker can never be trusted. This value is commonly modified using exploit code or using tamperdata.

                  1) 安全系统的第一步是确保文件具有 .pdf 扩展名:

                  1)The first step in your secuirty system is to make sure the file has a .pdf extension:

                  if("pdf"!=substr($fileName, strrpos($fileName, '.') + 1)){
                     die("Invalid File Type");
                  }
                  

                  2)接下来你应该检查它是什么文件类型使用 php filetype() 函数.

                  2)Next you should check what file type it is using the php filetype() function.

                  3)一个严重的问题是这些PDF文件通常可以利用缓冲区溢出等漏洞在 Adobe 制作的软件中找到.这些 PDF 用于在 Drive By Download 攻击中传播病毒.

                  3)A serious problem is that these PDF files can exploit vulnerabilities such as buffer overflows commonly found in software made by Adobe. These PDF's are used to spread viruses in a Drive By Download attack.

                  最好的解决方案是安装网络应用防火墙Mod_Security.这将阻止 sql 注入和 xss 等攻击攻击您的 Web 应用程序.Mod_Secuirty 可以配置为使用 所有上传文件中的病毒special_features.html" rel="noreferrer">modsec-clamscan .

                  The best solution is to install the web application firewall Mod_Security. This will stop attacks like sql injection and xss from hitting your web application. Mod_Secuirty can be configured to scan all upload files for viruses using modsec-clamscan .

                  这篇关于PHP上传文件增强安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)
                  <i id='J5YEa'><tr id='J5YEa'><dt id='J5YEa'><q id='J5YEa'><span id='J5YEa'><b id='J5YEa'><form id='J5YEa'><ins id='J5YEa'></ins><ul id='J5YEa'></ul><sub id='J5YEa'></sub></form><legend id='J5YEa'></legend><bdo id='J5YEa'><pre id='J5YEa'><center id='J5YEa'></center></pre></bdo></b><th id='J5YEa'></th></span></q></dt></tr></i><div id='J5YEa'><tfoot id='J5YEa'></tfoot><dl id='J5YEa'><fieldset id='J5YEa'></fieldset></dl></div>
                      <bdo id='J5YEa'></bdo><ul id='J5YEa'></ul>
                      • <small id='J5YEa'></small><noframes id='J5YEa'>

                          <tbody id='J5YEa'></tbody>

                            <tfoot id='J5YEa'></tfoot>

                          1. <legend id='J5YEa'><style id='J5YEa'><dir id='J5YEa'><q id='J5YEa'></q></dir></style></legend>