jwashburn |
10-26-2006 01:49 PM |
How do I clean out a hack
I am running the psitats hack and for whatever reason I lost the two tables that the hack requires to run. So i get this error
Code:
Database error in vBulletin 3.6.2:
Invalid SQL:
REPLACE INTO `psistats_cache` (`cdata`, `ctype`, `csid`)
VALUES ('64.50.53.162', 'country', '64.50.53.162_country'), ('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)', 'useragent', '64.50.53.162_useragent');
MySQL Error : Can't find file: 'psistats_cache.MYI' (errno: 2)
Error Number : 1017
Date : Thursday, October 26th 2006 @ 10:43:51 AM
I also cant get into ADMINCP at all
So I looked at the XML file to see the database mods it made and it looks that it creates a couple of tables.
Here is the code from that
Code:
// DROP OLD TABLES
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_browser`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_country`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_os`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_referrer`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_screendepth`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_screenresolution`");
// CREATE TABLES
$db->query_write("CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "psistats_cache` (
`cdata` varchar(255) NOT NULL default '',
`ctype` varchar(40) NOT NULL default '',
`csid` varchar(255) NOT NULL default '',
UNIQUE KEY `csid` (`csid`)) TYPE=MyISAM
");
$db->query_write("CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "psistats_data` (
`cdata` varchar(100) NOT NULL default '',
`count` int(10) unsigned NOT NULL default '0',
`ctype` varchar(40) NOT NULL default '',
`cmisc` varchar(40) NOT NULL default '',
KEY `ctype` (`ctype`)) TYPE=MyISAM
");
// CREATE CRON ON PRE-3.6.0 VBULLETIN
if (is_newer_version('3.6.0', $vbulletin->options['templateversion']))
{
$db->query_write("DELETE FROM `" . TABLE_PREFIX ."cron` WHERE `filename` LIKE '%psistats_update.php%' LIMIT 1");
$db->query_write("INSERT INTO `" . TABLE_PREFIX . "cron` VALUES (NULL, 1136665500, -1, -1, -1, 'a:1:{i:0;i:25;}', './includes/cron/psistats_update.php', 1, 'psiStats 2006 Update (15-Minute Interval)')");
}
$db->show_errors();]]></installcode>
<uninstallcode><![CDATA[$db->hide_errors();
// DROP TABLES
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_browser`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_country`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_os`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_referrer`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_screendepth`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_screenresolution`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_cache`");
$db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "psistats_data`");
// ERASE CRON
$db->query_write("DELETE FROM `" . TABLE_PREFIX ."cron` WHERE `filename` LIKE '%psistats_update.php%' LIMIT 1");
So I manuall made the two tables psistats_cache and psistats_data
I got no changes. I thought maybe there was a permissions issue so I inserted some data into those tables with phpmyadmin and it worked ok.
So I am at the point of reisntalling vb from scratch and i dont want to do that.
I have tried disabling hooks in my config.php but then I have a problem with a php adsnew integration that I did. IN order to get around that error I have to remove references to that in my templates, the problem is I cant get to my templates.
So if anyone knows how to reset my default template without admincp access, I can start down that road.
My main question is how do I remove this hack manually. Obviously just removing the two tables isnt going to do it, there must me some reference to it somehere else.
We have been down for 2 days now. Any help would be appreciated
|