![]() |
|
Thread Tools |
#1
|
||||
|
||||
Protect your Config.php from Hackers
Hello all,
Here is a very easy way to protect your config.php (and thus your valuable database):
Ofcourse you need to replace **username** with your FTP username. Maybe you need to change the path. This example is from cPanel configuartions. That's all. Connection details to your database are now hidden to hackers. Maria PS- I did a search before posting the advice, but I didn't found anything. If a similar article exists, then my apologies, but is well hidden ![]() No members have liked this post.
Last edited by MaryTheG(r)eek; 08 Jul 2011 at 12:46. Reason: Forgot ?> at code |
#2
|
||||
|
||||
![]()
Originally Posted by MaryTheG(r)eek
http://www.vbulletin.org/forum/showthread.php?t=198856![]()
I prefer the above as many simply do not know about this and not to mention your telling a hacker where config.php is within the old config.php when/if they have a copy although they may not think to look for the edit within class_core (if you do not preserve timestamp info when editing or uploading the modified file) ![]() ![]()
__________________
Daddy Does Dios and Figs! https://www.linkedin.com/in/thelastsuperman Search - Use the search feature to find similar issues/answers. Information - Include screenshots, copy/pasted error codes, url etc. Fixed - Please return to your thread/post and let us know how it was fixed! Thanks - For participating! Click the "Like" ♥ on a post if someone helped you! No members have liked this post.
|
#3
|
||||
|
||||
Sorry if I'm missing something, but how does this stop hackers?
Not trying to be negative, but I also don't want people thinking that moving their config.php is going to protect them from hackers. At best it'll just cause some minor problems when they go upgrade.
__________________
Sr Software Developer / Tech Lead The following members like this post: TheLastSuperman
|
#4
|
||||
|
||||
![]()
Originally Posted by Adrian Schneider
Stopped a professional at CrowdGather from moving one of my clients forums after they purchased (lol), so perhaps we should say hide instead of protect and "script kiddies" instead of hackers as many of them don't even know how to do all the above Adrian but valid points you have there.
![]()
__________________
Daddy Does Dios and Figs! https://www.linkedin.com/in/thelastsuperman Search - Use the search feature to find similar issues/answers. Information - Include screenshots, copy/pasted error codes, url etc. Fixed - Please return to your thread/post and let us know how it was fixed! Thanks - For participating! Click the "Like" ♥ on a post if someone helped you! No members have liked this post.
|
#5
|
|||
|
|||
Come on. Be ...serious
![]() ![]() In any case I was talking in general. And is well known from the early days of PHP that configuration files is better to not being stored in the public area. An daily example. There are many site owners who are giving FTP access at the public area to someone to fix something. Why to have the login to database details available to him? Maria --------------- Added 08 Jul 2011 at 19:55 --------------- By the way. Nice to see you back Sir Adrian ![]() Maria No members have liked this post.
|
#6
|
||||
|
||||
If they have FTP access, all they need to do is add var_dump($vbulletin->config) anywhere after global.php to see the password being used. Or they can look in init.php / class_core.php to see where the config.php is located. Even if they can't use FTP to view that directory, they can use file_get_contents() or similar to read the file.
There are lots things you can do to stop hackers, this may slow someone down for 3-4 minutes but I don't' think that 3-4 minutes is worth botching upgrades for. That's not my call, of course, people are free to do what they want. Thanks ![]() Cheers
__________________
Sr Software Developer / Tech Lead The following members like this post: Badshah93
|
#7
|
|||
|
|||
At least for me, you helped me a lot and I'm greatful for it. Even coding since 1984, I'm selfteached. Lots of money for a Greek to study in US 35 years ago
![]() ![]() Again thank you Maria The following members like this post: Adrian Schneider
|
#8
|
|||
|
|||
keep up the good work Adrian. Jeff The following members like this post: Adrian Schneider
|
#9
|
||||
|
||||
And what's the different between this and a simple yet working:
Doesn't require any modification of core files and result is the same. Because moving the file out, still no problem to use LFI to get it because you've to change your open_basedir value to the corresponding path. Moving the file around doesn't add much protection - just a difference for an user getting either a 403 or a 404. Specially - dunno but I don't like the idea adding something in $HOME to open_basedir No members have liked this post.
|
#10
|
|||
|
|||
Originally Posted by Angel-Wings
First of all, and please correct me if I'm wrong you're talking for editing htaccess file right? In this case, just keep in mind that not all users know how to use such files, and most important, not all server configurations can use htaccess (eg win/iis). At least so easy as *nix servers.![]()
Second, but this is just my opinion, I believe that anything outside the public area is "more" secure. Not that is totally secure, but it has a greater security level. Thirda and last. I didn't wrote that my method is the best, or the only one available. I wrote something from my experiance as you did with yours. Sure should be other ways too. Maria No members have liked this post.
|
#11
|
||||
|
||||
if the hacker somehow got the chance to include your precious config.php file, there's something completely wrong nontheless. But then again, this is just fighting against phantoms and has no real security value. A colorful image file reading "please do not hack my server, k?" would have the same effect. But if it makes you sleep better...
![]() No members have liked this post.
|
#13
|
|||
|
|||
This as you said can help you protect from the want to be hackers. The hackers who think they are good. I will use this since my forums will be small and hackers won`t try to hack it unless there desperate.
No members have liked this post.
|
#14
|
||||
|
||||
Originally Posted by MaryTheG(r)eek
Well - doesn't matter if htaccess or not - IIS also supports restrictions. The problem is just that VB (and so PHP) need to read this file so it basically doesn't matter where it's put. By default the config file isn't remotely accessible anyways.![]()
And remembering some VB bugs (like the FAQ one revealing the DB info) - then it doesn't matter where this file is because VB needs it to work at all.
Originally Posted by MaryTheG(r)eek
That depends. Writeable directories like the attachments should be stored outside the webroot, without any doubt.![]()
For readable files like configurations, there's for the webserver absolutely no difference having them placed in the "includes" directory and set that via "Deny from all" to only allow local access or moving them somewhere into a directory that has the same restrictions (like /etc). It's maybe a bit more userfriendly to setup the "includes" directory to disallow access because you don't need to edit VB core files. And - for the worst case - if it happens that VB has some kind of LFI or info revealing bug - then it doesn't matter where this file is. The following members like this post: Disasterpiece
|
![]() |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 15:22.