hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Hosting Security and Technology Tutorials : Fix phpBB
Reply

Hosting Security and Technology Tutorials Tutorials related to server security or the like.
Forum Jump

Fix phpBB

Reply Post New Thread In Hosting Security and Technology Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-08-2005, 10:32 PM
Scott.Mc Scott.Mc is offline
Engineer
 
Join Date: Jan 2005
Location: Scotland, UK
Posts: 2,379

Fix phpBB


Fix phpBB

Since it is now become a common problem for shared hosts having to "deal" with phpBB exploits I thought I could create a simple how-to find and fix any out-dated phpBB forums located on your server. Please understand before starting though, that it is really down to the client to resolve these issues, not yourself.

Attached at the bottom I thought I should add a few of the older scripts I created/used which where used to fix the exploits at that time.

How to find outdated installs:

While people may find this hard its the easiest part of the whole process. Firstly go find out the latest version of phpBB from phpbb.com, then proceede to the phpbb forums and into the announcements area - Direct link can be located here http://www.phpbb.com/phpBB/viewforum.php?f=14

Find the post that matches the latest version being released at the time of writing this would be 2.0.17 - http://www.phpbb.com/phpBB/viewtopic.php?t=308490

In here it announces the quick fix, which is what we will use to search. What you have to do is find a piece of the fix that will only exist in old installations. In this case I used "t<]*)#is" which will only be in versions below 2.0.17. Now we have what we are going to search for we have to think of how we are going to search best way would be to use the find command in linux. You can research more about this by executing `man find`

The file the "exploit" exists in on this case was bbcode.php so all we have to do is build a command to search.

find /home/ -name "bbcode.php" -exec grep 't<]\*)#is' {} \; -print

Would be the command, where

/home/ = the directory to start searching.
bbcode.php = the file we want to search in.
't<]\*)#is' = What we want to search for, note the \ before the * so it searches properly.

All you have to do is run this command and it will show all vulnrable install paths.


How to "fix" outdated installs:

This is all dependant on yourself, my personal recommendation is that you temporarily disable the vulnrable forum and notify your customer to update it immediately. It may indeed be harsh but you have other users to think about when it comes down too it.

OR

You can update it for them, also remember they may have mods installed which is going to cause real problems while updating, hence why they should do it. The easiest way is to go to www.phpbb.com and then get the patch files only from the downloads page.

Inside the patch will have multiple files to update from lots of versions to the latest. You can find out the version the user is running by either looking threw there files or by getting it from the database, under phpbb_config or whatever the users prefix is.

I strongly advise you let your customer upgrade themself to prevent any loss of files.

-----

This is not much good anymore but here is what I used for older versions.

find /home/ -name "viewtopic.php" -exec grep "highlight_match) . " {} \; -print

This was for 2.0.16

---

#!/bin/bash
EXSED=/bin/sed
EXDIFF=/usr/bin/diff
EXRM=/bin/rm
EXMV=/bin/mv
EXSEND=/bin/mail
MAILTOUSR=no-spam@hostgeekz.com
MAILSUB="Security warning from $0"
DATE=$(date)

FILES=(`find /home -name viewtopic.php`)

for a in ${FILES[*]}
do
$EXSED "s/urldecode(\$HTTP_GET_VARS\['highlight'])/\$HTTP_GET_VARS['highlight']/g" $a > $a.tmp
CHKDIFF=$($EXDIFF -u $a $a.tmp)

if [ -z $CHKDIFF ]; then
$EXRM -rf $a.tmp
else
$EXRM -rf $a
$EXMV $a.tmp $a

echo "$0 scanned file: $a which was bogus and replaced on $HOSTNAME at $DATE" | $EXSEND -s "$MAILSUB" $MAILTOUSR

fi

done

---

Was a bash script I created which fixes the old exploit, I could not even begin to tell you the version number because it was so long ago, infact I belive this may have been during the perl sanity worm "outbreak"

Anyway thats enough of my quick guide, hope it helps. I suggest you install mod_security asap if you have not already done so.

Written by HostGeekZ.com
Updated version can be found Here

Reply With Quote


Sponsored Links
  #2  
Old 11-14-2005, 04:35 AM
reese reese is offline
Newbie
 
Join Date: Jul 2003
Location: Houston
Posts: 5
i was playing with mod_sec and adding a few filters to it and keeping it up to date with new xploits i believe and hope this will keep my clients phpBB forums safe..

Reply With Quote
  #3  
Old 11-14-2005, 02:23 PM
ThinkSupport ThinkSupport is offline
Support? Think About us !
 
Join Date: Feb 2005
Location: India
Posts: 910
Good tutorial there Scott .. I am sure this will help everyone to patch their outdated phpBB installations and thus prevent the server from getting exploited.

Reply With Quote
Sponsored Links
  #4  
Old 11-14-2005, 03:42 PM
zsuatt zsuatt is offline
Junior Guru
 
Join Date: Nov 2005
Location: Denmark
Posts: 188
what i did was, i disabled all the php system(), exec() etc function, which could be used to get a nobody shell and run some nasty stuff.
But it doesnt really protect the forum itself from file overwritings, sql injection etc, but it does protect the server to some extent

Reply With Quote
  #5  
Old 02-10-2006, 03:31 PM
Abdu Abdu is offline
Newbie
 
Join Date: Jan 2004
Posts: 16
php functions

Can you kindly tell me which php functions you disabled ?

thanks

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Softaculous Releases Auto Installer Version 4.1.7 Web Hosting News 2012-12-19 16:45:21
Web Host A Small Orange Provides Customers with One-Click App Install via Softaculous Web Hosting News 2012-04-03 14:53:05
Softaculous Launches AMPPS Installer Version 1.5 Web Hosting News 2012-01-26 16:52:40
Hosting Software Firm Softaculous Releases Version 4.0 Web Hosting News 2012-01-23 13:54:44
Web Host HostingZoom Adds Softaculous Auto-Installer to Hosting Plans Web Hosting News 2011-08-17 17:52:34


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?