|
phpBB < 2.0.10 quick patch script
|
|
|
|
|
Written by wunk
|
|
|
|
Sunday, 17 April 2005
There is a bug in all phpBB versions prior to 2.0.10.., this bug allows execution of code/commands.
This turned out (and still is) to be a major pita, within a week there
were hundreds of compromised high bandwith webserver acting as DDoS
zombies. For shared webservers this can be even a bigger pain in the
rear, since you'll have to upgrade all the sites hosting an old phpBB
version to the latest one. With some help from the psoft forums, I was able to create a small script that 'patches' the highly exploitable part in phpBB.
Note that this script ONLY patches that bug on all forums that exist on
the server, it's still advised to upgrade asap. You'll need root
privileges to execute this script, and you'll need the slocate
application for the script too (run updatedb prior to executing this so
you'll catch ALL sites vulnerable)
# phpBB Patching Script
# Applies patch described in:
# http://www.phpbb.com/phpBB/viewtopic.php?f=14&t=240513
#
# Applies patch to any files found that contain the name 'viewtopic.php'
# This includes backups that phpnuke aparently makes.
#
# Though this script has been run across 50 servers without any problems,
# this script comes without warranty for fitness of any application.
#
# This code is hereby released into the public domain.
#!/bin/bash
STORE=/root/tmp_phpbb_fixes
function securephpbbfile() {
cat $1 | sed "s/urldecode//" > $STORE/tmpfile
cp -f $STORE/tmpfile $1
rm $STORE/tmpfile
}
function checkfilenow() {
FOUND=`grep "\$words = explode" $1 | grep trim | grep urldecode`
if [ ! "$FOUND" = "" ]
then
echo INSECURE $1
securephpbbfile $1
fi
}
mkdir $STORE
CHECK=`locate viewtopic.php`
for file in $CHECK
do
checkfilenow $file
done
rm -rf $STORE
|
| Last Updated (
Sunday, 17 April 2005 ) |