if i only allow access to certain folders of my site - to only my home ip address - is it possible to still access files in the folder using some kind of exploit? i mean can a php script or some other language bypass the .htaccess rules? appreciate your help
The .htaccess is within the server configuration and is therefore read before any PHP scripts are executed. I would therefore be surprised if you could bypass it via a PHP script. I would consider those folders fairly secure in this instance. Saying that, there probably are many other ways to exploit a server and gain admin priviledges so nothing is 100% secure. Keep your server up-to-date to maintain a high level of security.
someone can discover your home ip and put this ip in a program that simulates a connection with a fake ip
If you are having the userid and the password to the webserver itself, you can put another language-encoded file on the server. That could possibly bypass the protections set up and made available in place by using methods like htaccess.
Hey there, lets say we have: /main_folder/ /main_folder/protected/ /main_folder/protected/imalsoprotected/ If someone can get a script on the main_folder, then they can read the protected folders, even if htaccess is there since the IP isn't coming into play. Thanks Francisco
Not Possible The IP comes from the TCP-IP packet. You can spoof other fields in the packet, but if you spoof the IP, the response gets sent to the spoofed IP! So if I sent a connection that says I am at your IP, the web server will address the response to your computer. What IS possible at that point is to packet sniff the response (which the spoofed IP will just ignore) and parse the message from the packets. If you're concerned with that level of adversary then you need to get off of apache anyhow, lol. Also, as mentioned above, if people have the opportunity to SQL inject or upload code to other sections of your website, they can access the file system and htaccess is useless. At that point, it doesn't even matter whether your files are within the web server accessible areas or not, depending on your local file/folder/webserver user account permissions.