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 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么