douke6424 2016-10-20 02:27
浏览 8
已采纳

隐藏HTML和AJAX中的文件夹名称

Is there any security risk in revealing PHP folder names? If yes, is there any way to hide the folder names that exist within my html hyperlinks and in my ajax code?

  • 写回答

1条回答 默认 最新

  • doubi1624 2016-10-20 02:49
    关注

    Is there any security risk in revealing PHP folder names?

    To simply say "no" is a poor answer. The answer should be "it depends". For the most part, revealing folder names is a minimal risk, but depending on the information you're trying to obscure/hide, it may be worthwhile to hide folder names. As @nogad points out, you shouldn't just use obscurity to hide away your potential issues, you should focus on securing the actual application.

    For example:

    • Are directory indexes enabled? If someone knows a folders name, and directory indexes are on, they will be able to view the contents of that folder on your site, which may reveal certain elements of your site that you wish to remain private.
    • Do your folders contain things that could be easily crawled via a robot. There are many scripts out there designed to scrape and look for common things like "admin.php", or "/admin/index.php". Maybe you wish to hide that, to make it harder for hackers to find a script.
    • Let's do a for instance. Let's say you have a folder /secretz428, which contains two files. /secretz428/image.php and /secretz428/admin.php. By exposing /secretz428/image.php to your front end users, they may try to dig into this folder, and may happen upon your admin.php. If there is no security on this script (Or it's prone to hacking), you could open up your site to to an attack. The more you obscure from your users, the harder it is for someone to reverse engineer and find exploits in your application.

    Is there any way to hide the folder names that exist within my html hyperlinks and in my ajax code?

    Sure. One way is to obscure it within a php script. For example:

    index.php:

    switch ( $_GET['id'] )
    {
        case '1':
           include('secret_folder/mysecretscript.php');
           break;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题