PDA

View Full Version : Force Hack Removal


LCN2007
02-21-2009, 04:19 AM
I am trying to remove an obsolete mod on my site but a while back i deleted the SQL Database that was attached to the hack so now when i try to remove it i get the following error:

Database error in vBulletin 3.7.2:

Invalid SQL:
SELECT COUNT(*) AS users
FROM user AS user, userfield AS userfield

WHERE userfield.field55>0
AND user.userid = userfield.userid;

MySQL Error : Unknown column 'userfield.field55' in 'where clause'
Error Number : 1054
Request Date : Saturday, February 21st 2009 @ 12:17:02 AM
Error Date : Saturday, February 21st 2009 @ 12:17:02 AM
Script : http://www.sitename.net/forum/timeslips.php
Referrer :
IP Address : 68.229.86.93
Username : *******
Classname : vB_Database
MySQL Version : 5.1.30


I thought a while ago i saw such a hack to force remove mods when such things happen.

any help is appreciated,

Thanks

TigerC10
02-21-2009, 04:42 AM
Same thing happened with me and a mod I was testing out. In your product manager, you have drop down options next to each mod... Edit the mod and remove the conflicting SQL query from the uninstall code. In this case it'll be this code:


SELECT COUNT(*) AS users
FROM user AS user, userfield AS userfield


Once you yank that out of there, remove it normally - you may have to repeat the process for removing other conflicting SQL queries, though.

vbplusme
02-21-2009, 07:40 AM
Unfortunately, deleting the database references puts the hack in an unknown state so you may have multiple instances where you will need to follow the suggestion provided until the uninstall completes successfully. You may have some other residue that pops up as well. Hope it works out for you. If all else fails you might want to consider the alternative which is to reinstall the hack in upgrade / overwrite mode then do the uninstall. That should clean up any residual stuff that might be hiding out on your system.:D

LCN2007
02-23-2009, 12:52 PM
i cant seem to find that snip of code here is the uninstall code.


$db->query_write("DROP TABLE " . TABLE_PREFIX . "customfile");
$db->query_write("ALTER TABLE `" . TABLE_PREFIX . "user` DROP `tdban` ");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '50' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '51' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '52' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '53' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '54' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '55' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '56' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '57' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '58' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '59' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '60' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '61' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '62' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '63' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '64' LIMIT 1");
$db->query_write("DELETE FROM `" . TABLE_PREFIX . "profilefield` WHERE `profilefieldid` = '65' LIMIT 1");
$db->query_write("ALTER TABLE `" . TABLE_PREFIX . "userfield` DROP `field50` ,
DROP `field51` ,
DROP `field52` ,
DROP `field53` ,
DROP `field54` ,
DROP `field55` ,
DROP `field56` ,
DROP `field57` ,
DROP `field58` ,
DROP `field59` ,
DROP `field60` ,
DROP `field61` ,
DROP `field62` ,
DROP `field63` ,
DROP `field64` ,
DROP `field65`");
$db->query_write("OPTIMIZE TABLE " . TABLE_PREFIX . "userfield");

Dismounted
02-24-2009, 04:44 AM
Remove this line:
DROP `field55` ,

LCN2007
02-24-2009, 01:00 PM
Thanks Dismounted

This worked i just kept removing the errored lines untill success.

I took out:

$db->query_write("DROP TABLE " . TABLE_PREFIX . "customfile");
$db->query_write("ALTER TABLE `" . TABLE_PREFIX . "user` DROP `tdban` ");

"userfield`
DROP `field50` ,
DROP `field51` ,

Thanks again.