My site was hacked for the second time.

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
canadagoose
Registered User
Posts: 6
Joined: Sun Jan 07, 2007 8:56 am

My site was hacked for the second time.

Post by canadagoose »

My site was hacked for the second time by some Turkish group if i remember right, the first time i was able to figure out what the hackers did. This time i can't. I've restored a backup of the database but i get the error message:




Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/tjlewis1/public_html/forum/db/mysql4.php on line 330

Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /home/tjlewis1/public_html/forum/db/mysql4.php on line 331
phpBB : Critical Error

Could not connect to the database

The version of phpbb that i was using is 2.0.8
Any help much appreciated, i don't want to loose the posts that were posted.
Last edited by canadagoose on Sun Jan 07, 2007 10:32 pm, edited 1 time in total.
gansert
Registered User
Posts: 581
Joined: Wed Mar 08, 2006 8:48 pm
Location: KÖLN, GERMANY
Contact:

Re: My site was hacked for the second time.

Post by gansert »

canadagoose wrote: The version of phpbb that i was using is 2.0.8


Hi, sorry to hear that you got hacked

every child can hack ur site if u use 2.0.8. You find that everywhere in web. Update and you wonT get hacked that easy.
hc2995
Registered User
Posts: 229
Joined: Tue Jun 20, 2006 1:25 am
Contact:

Post by hc2995 »

You are EXTREAMLY OUT OF DATE (12 version to be exact) Before continuing update to the latest version (2.0.22) using this guide:
Update

Before starting with updating, you should first disable your board to prevent problems while updating. To do so you'll have to go to your board's admin panel, click Configuration in the navigation panel, and set 'Disable board' to True. Then click OK to confirm the changes.


If you have MODs installed
There are two ways of updating your board in case you have MODs installed (or modified the script files of your board in any other way)

.patch files

Unix users: to use this way of upgrading you will need command line access to a standard UNIX type patch application

Windows users: there also is a Win32 version of the patch tool available, which allows you to run patch files on Windows. You can download it here. Two topics at phpBB.com describe some minor problems which users encountered while using the patch tool: How to apply a patch on windows?, and [RESOLVED] Patching Problem.

Step 1
Download the “Patch file only” package from the phpBB.com download page, and extract it to a folder somewhere at your hard drive

Step 2
Select the correct patch, e.g. if your current version is 2.0.15 you need the phpBB-2.0.15_to_2.0.20.patch. Place the correct patch in the parent directory of your board (the one containing the phpBB core files like index.php, viewforum.php, etc.)

Step 3
Upload the update_to_latest.php file to the /install directory of your board. If the directory doesn't exist you'll have to create it

Step 4
Run the following command using the command line:
Code:
patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME]
where PHPBB DIRECTORY is the directory name your phpBB board resides in and where PATCH NAME is the filename of the patch file which you would like to execute.
Note: When executing, don't type in the brackets
This should complete quickly, hopefully without any HUNK FAILED comments.

If you do get failures you'll have to try the next update method described in this article. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source

Step 5
Delete the patch file (or files)

Step 6
Run install/update_to_latest.php trough your browser (using http://www.domain.com/phpBB2/install/up ... latest.php, for example)
This will update your database schema and data (if appropriate) and increment the version number

Step 7
Delete the /install directory from your board's root directory

Code Changes MODs
The code changes are also available in MOD-format, here: http://www.phpbb.com/phpBB/catdb.php?cat=48. This is particularly useful if you don't have command line access to your host, and if you have EasyMOD installed. Of course you can apply the changes by hand, but EasyMOD will do it in less then a minute Wink

When using the MOD files you'll have to upgrade version after version, e.g. if you're currently running phpBB 2.0.16 and you want to upgrade to phpBB 2.0.20, you'll have to execute the 2.0.16 to 2.0.17 MOD, then the 2.0.17 to 2.0.18 MOD, then the 2.0.18 to 2.0.19 MOD, and finally the 2.0.20 MOD.

Okay, let's get to the actual updating (I assume that you're using EasyMOD for this):

Step 1
Download the zip file containing the Code Changes of the version from which you're upgrading, and unzip it to a folder at your hard drive.

Step 2
You'll see a bunch of files; the ones we need to concentrate on are phpbb_2.0.xx_to_2.0.xx.txt and update_to_latest.php (replace the xx with the version number you're upgrading to/from).

Step 3
Upload the phpbb_2.0.xx_to_2.0.xx.txt file and any other .php files except for update_to_20xx.php to /admin/mods/phpbb_20xx_to_20xx (replace the xx with the version number you're upgrading to/from).

Step 4
Go to the EasyMOD control panel in your ACP, and install the MOD. If everything works well you should get no error messages at all. If you do get error messages you'll have two options: ask in the support topic of the Code Changes MOD which you're trying to execute for help, or reinstall – but you'll have to keep in mind that you'll have to add all MODs again. How to reinstall phpBB without loosing your data is explained in the next section in this article.

Step 5
Upload the update_to_latest.php file to the /install directory of your board. If the directory doesn't exist you'll have to create it

Step 6
Run install/update_to_latest.php trough your browser (using http://www.domain.com/phpBB2/install/up ... latest.php, for example)
This will update your database schema and data (if appropriate) and increment the version number

Step 7
Delete the /install directory from your board's root directory

If you have no MODs installed
Step 1
Download the “Changed Files Only” from the download page at phpBB.com, and unzip it to a directory at your hard drive

Step 2
Inside of this zip you'll see several more zip files. Unzip the one that refers to the version you're updating

Step 3
Upload all those files, while overwriting all old ones. You should also upload the /install and /contrib directory which can be found in the main zip file (phpBB-2.0.xx-files.zip)

Step 4
Run /install/update_to_latest.php trough your browser, using www.domain.com/phpBB/install/update_to_latest.php, for example

Step 5
Delete the /contrib and /install directories from your server


The database wosent changed (it dosent appear) It looks like they just changed the config file.

Before asking for more support UPDATE!
canadagoose
Registered User
Posts: 6
Joined: Sun Jan 07, 2007 8:56 am

Post by canadagoose »

OK i realize that i definitely have to update, i did the update manually from 2.0.8 to 2.0.10. I have to do it manually because nothing in the admin panel works like Easymod, i just get the same critical error messages.
Can i use the database for a completely new install of the latest phpbb board, iguess i would have to mod it the same? I have a couple mods done to the old one like attach_mod, etc.
User avatar
Jim_UK
Former Team Member
Posts: 18479
Joined: Tue Oct 12, 2004 5:36 pm
Location: Darwen N.West UK

Post by Jim_UK »

You are in fact 14 versions out of date. Some of the mods you have may not even work on the latest version.

Your problem may well lie in the database and it is that you need to clean or you will just carry the hack with you to the latest version.
Your error quite likely means that the file config.php does not contain the correct database connection details.
Check that out and if necessary correct
Now with phpmyadmin check these tables and remove any added scripts
phpbb_config > field site_desc
phpbb_forums > the forum description fields
phpbb_categories descriptions again
Check on the server for any suspicious files

When you have gained access use the Starfoxtj Admin Toolkit (you could use it also to scan for those previously mentioned scripts) to check for and remove any rogue admin accounts.

Now download and keep safe config.php
Replace all the files with those of a fresh download
replace config.php
Run the install/update_to_latest.php file and then delete the install and contrib directory.

Replace any mods you want.

Jim
The truth is out there.
Unfortunately they will not let you anywhere near it!
canadagoose
Registered User
Posts: 6
Joined: Sun Jan 07, 2007 8:56 am

Post by canadagoose »

All right i got the forum index back,now i get these messages:



Warning: Cannot modify header information - headers already sent by (output started at /home/tjlewis1/public_html/forum/common.php:233) in /home/tjlewis1/public_html/forum/includes/sessions.php on line 302

Warning: Cannot modify header information - headers already sent by (output started at /home/tjlewis1/public_html/forum/common.php:233) in /home/tjlewis1/public_html/forum/includes/sessions.php on line 303

Warning: Cannot modify header information - headers already sent by (output started at /home/tjlewis1/public_html/forum/common.php:233) in /home/tjlewis1/public_html/forum/includes/page_header.php on line 475

Warning: Cannot modify header information - headers already sent by (output started at /home/tjlewis1/public_html/forum/common.php:233) in /home/tjlewis1/public_html/forum/includes/page_header.php on line 477

Warning: Cannot modify header information - headers already sent by (output started at /home/tjlewis1/public_html/forum/common.php:233) in /home/tjlewis1/public_html/forum/includes/page_header.php on line 478

Thanks for the help so far, once i get it working right i'm going to backup and update this forum completely.
abusedemailaddress
Registered User
Posts: 161
Joined: Fri Mar 24, 2006 7:18 am

Post by abusedemailaddress »

This error means you have problems with common.php being edited, and leaving text at the end, after the "?>" that is supposed to end the file. You can not have any spaces, blank lines, helpful HTML, or anything else after the "?>".
The abuse will continue until morale improves!
canadagoose
Registered User
Posts: 6
Joined: Sun Jan 07, 2007 8:56 am

Post by canadagoose »

All right, thank you all very much, everything seems to be a working again with attachments. :D :D :D :D
canadagoose
Registered User
Posts: 6
Joined: Sun Jan 07, 2007 8:56 am

Post by canadagoose »

So far i've updated my forums manually to 2.0.11, how's that version for security?
cybrid23
Former Team Member
Posts: 9877
Joined: Wed Jun 29, 2005 5:55 am
Location: Somewhere in the Midwest...
Contact:

Post by cybrid23 »

canadagoose wrote: So far i've updated my forums manually to 2.0.11, how's that version for security?


Still way out and not very secure at all. All versions prior to 2.0.21 have known exploits that can/will be used against you at some point in time.
---Never leave home without a towel and your peril sensitive sunglasses.
---Do Not PM Me For Support. It will go unanswered.
Thanks.
canadagoose
Registered User
Posts: 6
Joined: Sun Jan 07, 2007 8:56 am

Post by canadagoose »

I've completely installed a new 2.0.22 board along with the attachment mod updated to current version and have all the old posts and attachments working in the updated to latest database. Now i'm real happy! :mrgreen: :mrgreen: :mrgreen:
I hope it's safe now for the time being from these nuisances.
I found out my old phpbb board was 2.0.6 and not 2.0.8 :?
Talk about out of date!
Locked

Return to “2.0.x Support Forum”