Securing PHP web app directories

Securing PHP web app directories

Sometimes when we access https://cool-domain.com/images/ you will see bunch of images of your website. What's wrong with that? If your website has been compromised specially you are using shared server. It's easy for an attacker to run https://cool-domain.com/images/attacker.php.jpg in your browser. So, let's apply obscurity technique. It's a simple PHP script actually.

Obscurity for security

In your directory that you want to protect, create an index.php and write the code below. Open your browser and see it for yourself.

<?php

header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found!');

I prefer this one compare of using .htaccess of Apache. Instead of throwing a message like "Forbidden" which is too obvious that you have something there, just use obscurity technique.

Reference: https://jakepucan.blogspot.com/2019/05/securing-web-app-directory.html

要查看或添加评论,请登录

Lemwell Jake P.的更多文章

  • The basics of creating a website using Hacklang+HHVM

    The basics of creating a website using Hacklang+HHVM

    Disclaimer: For educational purposes only. Not intended to “boo!” Hacklang or PHP.

  • Why I use SeasLog for my PHP projects

    Why I use SeasLog for my PHP projects

    In PHP world, we encountered a lot of frameworks. The problem is they have different implementation in solving the same…

  • Measure your website

    Measure your website

    Without too much talking. I want to share my tools in measuring website.

  • Use Yii framework now!

    Use Yii framework now!

    First of all, I respect all PHP frameworks but it depends on your requirements. I'll give you a scenario.

  • Running Dart for Web in Windows

    Running Dart for Web in Windows

    I know the documentation was already exist on Dart website but most of the documentations "assumed" that you know…

  • Developing "Offline First" Web App

    Developing "Offline First" Web App

    Very disappointing when you see the welcoming message "Offline" on the ATM machine right? or "Out of Order" written in…

社区洞察

其他会员也浏览了