<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上传文件增强安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <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>