In light of the recent round of attacks against vBSEO customers, I thought it would be nice to share some easy to implement security tweaks. 99% of hacking something is knowing that it exists and where it exists. By simply renaming something from the normal expected name, you are far more likely to never be a part of an exploit.
These instructions focus on apache webservers. These may be possible in other webserver platforms, but you will need to convert the rules to match your system.
Renaming vbseocp.php
Note: This is for version 3.5.x and higher only.
- open your ftp client to your forum root and find vbseocp.php
- rename this file to something you and only you can remember what it is. In this example, I used 'myvbseocp.php'. You shouldn't use this. Use something like vb3242er42f2342seof23r234f423cp.php (and don't use that exact string either).
- Next, we need to edit the left nav in adminCP to reflect this new name. Open (download) includes/xml/cpnav_vbseo.xml in your favorite editor (or notepad)
- Note the highlight link above... we need to change that to our new file name.
- re-ftp that file back up to your site and it will work. To test, visit your vB admin panel, and click on the left nav link for vbseoCP. It should load correctly in the frame.
Renaming the vb admin directory
vB comes with an easy way to rename the adminCP and modCP folders. These are configured in the /includes/config.php file from vb.
find:
Replace the string with your folder names. Remember, linux is case sensitive.Code:$config['Misc']['admincpdir'] = 'admincp'; $config['Misc']['modcpdir'] = 'modcp';
Then, of course, you physically re-name the folders on your site with your ftp client.
Hint - remember, vb and vbseo upgrades assume STOCK folder names. When performing future upgrades, always re-name the LOCAL folders to match your SERVER folder names before upgrading.
Securing the vb admin directory
Using htacces files and htpasswd files, it is fairly straight forward to add another login level of security. In this case, even if your vb account is compromised, the hacker would still not be able to login to your admin panel and deface your site.
The key point here is to place the htpasswd outside of the web directory.
ie, if your site is
/home/sitename/public_html/
you want this password file to be in a new folder of the site ABOVE the public web accessible folder, such as
/home/sitename/mypassvault/
- The first thing to do is to make a 401.shtml file in your site root (site.com/401.shtml is the access path, regardless of where your forum is). The contents of this file doesn't really matter-- it simply needs to exist. A 'pretty' template can be used if desired:
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>401 - Authentication Failed</title> </head> <body> <h1>401 - Authentication Failed</h1> <p> Your request requires authentication. (Login and password) You may repeat the request with a suitable Authorization header field. Your browser will likely do this for you. </p> <p><!--#if expr="\"$HTTP_REFERER\" != \"\"" --> You were referred from <a href="<!--#echo var="HTTP_REFERER" -->"><!--#echo var="HTTP_REFERER" --></a>. <!--#else --> Please check your request for typing errors and retry. <!--#endif --> </p> <address> If the indicated error looks like a misconfiguration, please inform <a href="mailto:<!--#echo var="SERVER_ADMIN" -->" SUBJECT="Feedback about Error message [<!--#echo var="REDIRECT_STATUS" -->] <!--#echo var="title" -->, req=<!--#echo var="REQUEST_URI" -->"> <!--#echo var="SERVER_NAME" -->'s WebMaster</A>. </address> </body> </html>- Next, create the htaccess file in /admincp/.htaccess. If you already have a file in this folder, the next set of rules should come at the very top of anything else you have in there. Otherwise, make a new file called .htaccess with the following contents. Note, you will need to replace mypassvault with your actual PATH and file name to where you will be storing your passwd file (to be made in the next step):
Again, this must be your exact path to your passwd file (that we will make next). Consult your phpinfo script if you need help finding and creating paths. If your host doesn't allow you to make folders above public_html, ask them for advice.Code:AuthUserFile /home/sitename/mypassvault/passwd AuthName "AdminCP" AuthType Basic Require valid-user- Create the passwd file. These are simply flat files with no extension that use a username:hash(password) format. Go here: .htpasswd Content Generator (or any other md5 generator site you can google) and enter your password to receive the hash back. Remember your password, as there is no lookup tool/etc.
is all that this file should have in it. Save it as "passwd" with no extension and place it in the correct path as outlined in the step above.Code:username:md5passwordstring- Now, when you visit your admincp, you should get a new popup box that asks for this login. If you can't login, you did something wrong. Retrace your steps 1 by 1.
- You can extend this to the modcp as well. Simply copy the htaccess file to the modcp/ folder as well.
- Be sure to alert your staff of these changes! They (and anyone) trying to access the admincp and modCP areas if configured will need this password. It is easiest to use a generic username and password for all staff, but you can find more advanced tutorials about making individual user accounts in the same manner.
Lock down all writable folders
Stop any rogue code from running code directly. See:
Security issue for details.
If anyone else has a tip to share, please feel free to add it to this thread!![]()



8Likes
LinkBack URL
About LinkBacks











Reply With Quote

