vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Force Hack Removal (https://vborg.vbsupport.ru/showthread.php?t=206085)

LCN2007 02-21-2009 04:19 AM

Force Hack Removal
 
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:

Quote:

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:

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:
Code:

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:

Code:

$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.


All times are GMT. The time now is 08:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00976 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete