dousidan1279 2015-10-27 07:55
浏览 26

从Windows Server上的脚本执行中保护drupal文件夹的最佳方法是什么?

Drupal 7 comes with built-in .htaccess files to protect the files, tmp and private directories from script execution like malicious php, but doesn't provide a similar web.config file for Windows servers. I have looked around and couldn't find a proper solution yet.

I did came across a solution for Wordpress which suggested to upload this simple web.config file to the wp-content/uploads folder:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <handlers accessPolicy="Read"/>
  </system.webServer>
</configuration>

The author stated:

This tells IIS that handlers (such as PHP) may only read, and not execute.

Could it work in the same way for Drupal? I did uploaded this file in my Drupals files folders and at least it didn't break anything. I was still able to upload files and the the styles were still properly applied.

Does anyone knows a beeter, more secure solution?

Update: I forgot to mention - if I try to access a php file from one of these directories I get a 403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied. error, so it works at some level.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器