WHT Hacked/Attacked + How to force users to reset passwords

Learn about Security for code and servers. Learn how to secure your site and your code. Learn about hacking prevention, finding and identifying exploits, and recognising vulnerabilities. Plus, Weekly Security tips and Tutorials.
Forum rules
Post questions related to security, analyse and learn about vulnerabilities and exploits within code to protect yourself against hackers.

WHT Hacked/Attacked + How to force users to reset passwords

Postby Highway of Life » 24 Mar 2009, 10:31

With the recent hacking attack on WebHostingTalk, it brings back to mind how serious such an attack is, and that phpBB.com had one in the not too distant past. -- Although the attack on WHT was far more serious than what we at phpBB.com experienced. We lost several hours worth of posts, but they lost about 6 months worth of posts.

I noticed that they forced everybody to reset their passwords. That was an excellent idea because the way vB works with password hashes is really not complex at all. vB uses a 3 character salted hash, you can easily gain access to ALL passwords less than 8 characters long using a 10-letter rainbow table. Additionally, they store password hash and salt for login cookies, so it would be relitively simple to login as any user if they had access to the DB or a Database Dump.
phpBB3 stores a unique session key in your cookie, and the stores the hashed version in the database, so when you have autologin set, it checks the hashed version of your cookie key with the hashed login keys in the database, making it impossible for a hacker to login as another user using the same method on phpBB3.

So what do you do to protect yourself if someone gains access to your vB Database or a database dump? you require all users to reset their passwords by causing the password to expire.
Did you know that you can do this in phpBB3 as well?
It?s true, and a very simple process. Although phpBB3 uses a much stronger algorithm and hash for storing passwords, it?s still a good idea to have your users reset their passwords if you have experienced an attack or comprimise, you can use the following method.

Run the following two queries in your database using phpMyAdmin or similar tool:
Code: Select all
UPDATE community_config SET config_value = 90 WHERE config_name = 'chg_passforce';
UPDATE community_users SET user_passchg = 1230829560 WHERE user_type <> 2;
This changes ALL users password reset times to a little over 90 days ago, and sets the "force password change" to 90 days, so as soon as a user attempts to login, it will ask them to reset their password.

But you don?t want users resetting their password every 90 days, what should you do to prevent this?
Simple, you set your password to reset in about 85 days using the following query:
Code: Select all
UPDATE community_users SET user_passchg = 1237532400 WHERE user_type = 3;

This will show you the reset password screen again in 85 days, and reminds you to set the "Force password change" back to 0 in the ACP. (ACP -> General (tab) -> Server Configuration :: Security Settings) before it asks anybody else to reset their password 5 days later.
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: WHT Hacked/Attacked + How to force users to reset passwords

Postby UnknownTBeast » 05 Sep 2011, 15:02

This is an epic post, BUT it is 2 1/2 years old! I need to know if it will work on 3.0.9. If not can you please update the queries? Also you say...

Highway of Life wrote:Run the following two queries in your database using phpMyAdmin or similar tool

Code: Select all
Select allUPDATE community_config SET config_value = 90 WHERE config_name = 'chg_passforce';
UPDATE community_users SET user_passchg = 1230829560 WHERE user_type <> 2;



Do you mean separately or together? Or does it matter?
UnknownTBeast    
Crewman
Crewman
 
Posts: 3
Joined: 26 May 2011, 01:13
Gender: Male
phpBB Knowledge: 5

Re: WHT Hacked/Attacked + How to force users to reset passwords

Postby Peetra » 06 Sep 2011, 01:49

Run them at once if you can, it doesn't matter.
User avatar
Peetra    
Crewman
Crewman
 
Posts: 9
Joined: 27 Feb 2008, 10:21
Location: Finland
Favorite Team: GBK
Gender: Female
phpBB Knowledge: 7

Re: WHT Hacked/Attacked + How to force users to reset passwords

Postby Erik Frèrejean » 07 Sep 2011, 04:13

UnknownTBeast wrote:This is an epic post, BUT it is 2 1/2 years old! I need to know if it will work on 3.0.9.

They'll run
Image Proud member of the phpBB support team
Image STG Support team member | Image STG Moderator team member
Image
User avatar
Erik Frèrejean    
phpBB Team Member
phpBB Team Member
 
Posts: 1114
Joined: 03 Dec 2007, 00:49
Location: USERS_TABLE
Favorite Team: New Orleans Saints
Gender: Male
phpBB Knowledge: 10


Return to Security Class

Who is online

Users browsing this forum: No registered users and 2 guests