Vulnerable phpBB : Find and Disable.
Monday, July 18th, 2005Here’s a little script I wrote that attempts to find and disable old phpBB instances that may be vulnerable to the recent phpBB Worm in the wild.
#!/usr/bin/perl
# Name: Augie Schwer
# File: find-vuln.pl
# Date: 18, July 2005
# Purpose: Find vulnerable phpBBs and disable them.
use strict;
my ($line,$location,$user,$this_version,$newest_version);
$newest_version = '2005/06/26';
# where to search.
my $webdir = '/home/WWW_pages/';
# spawn sub shell and find the viewtopic.php and capture its version and location.
my @output = `find $webdir -type f -name viewtopic.php -print | xargs --verbose grep '\$Id: viewtopic.php,v' 2>&1`;
# parse out location and version.
foreach $line (@output)
{
if($line =~ /(.+?): .+ \$Id: viewtopic.php,v .+ (\d{4}\/\d{2}\/\d{2}) .+/)
{
$location = $1;
$this_version = $2;
# old phpBB, disable it.
if($this_version ne $newest_version)
{ print "OLD PHPBB\n" ; `chmod 000 $location`; }
print "Location: $location \n";
print "This V : $this_version \n";
print "New V : $newest_version \n";
}
}














