Oct 25

You may (for whatever reason) store particularly sensitive information in your webspace. Passwords, links, and anything else.

You may want to be able to access these files by FTP for example, but do not want someone stumbling across them and being able to read or use them. Here we will deny external access to those files using a .htaccess file.

You will require that your server has the mod_access module installed for these rules to work.

In our example, we have a password file stored in /home/username/www/passwords/my-passwords.psswd

We create a .htaccess file (that is “DOT”htaccess) and within it:

<Files ~ “\.psswd$”>
Order allow,deny
Deny from all
</Files>

Save the file and upload it to the directory holding the files you wish to protect (in our case /home/username/www/passwords/ )

Simple :)

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati
  • BlinkList
  • Live
  • Reddit
  • Slashdot
  • StumbleUpon

Technorati Tags: , , , , , , ,

Oct 25

One of the things which gives a potential attacker some help is them knowing which versions of software you use. This can be very easy to find out, particularly if you have never taken steps to secure this information.

For example: I would like to know what software apache.org are using/have used so I look at netcraft (for example) http://toolbar.netcraft.com/site_report?url=http://www.apache.org

192.87.106.226 Linux Apache/2.2.3 Unix mod_ssl/2.2.3 OpenSSL/0.9.7g 12-Apr-2007

I now know that I should look for exploits relating to linux, apache v2.2.3, mod_ssl 2.2.3 and OpenSSL0.9.7g.

By hiding this information you can either report simply “unknown” or just “apache” and no other info. This doesn’t directly make your box more secure, what it does do is start to make the task more difficult for a would-be attacker and for such a small amount of effort it really does seem silly not to do it. So how?

The first thing is to set the ServerTokens directive. I am using a RH linux box so if you know your OS differs, find the corresponding location of your httpd.conf: Continue reading »

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Technorati
  • BlinkList
  • Live
  • Reddit
  • Slashdot
  • StumbleUpon

Technorati Tags: , , , , , , , , , , , , , , , , , , ,