PDA

View Full Version : [BETA/DEV] MutliUser Detection


PHPGeek2k3
03-01-2006, 10:00 PM
!!!!!!!!!!!!!!!!!!!!!!!! WARNING WARNING THIS IS IN BETA / DEVELOPMENT STAGE STILL WARNING WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!


You ask what does this do?

well it checks the user against a list of usergroups / userids to see if we need to check to see if there is a possible chance of multiple people from different IP's are using the same user login information.

You also Ask how is this different from AE Multiple Login Detection Plugin?

Well the AE Multiple Login Detection Plugin only detects if one person on the same computer has logged in by setting a cookie and every time someone logs in on the computer it checks that cookie for a list of usernames and basis its report off that.

This Plugin is more for detecting password sharing.


Current Feature List

Only check specified users set in vbulletin options
Only check users of specified usergroups set in vbulletin options
after x ammount of events change password to either a set password set in vbulletin options or a random password generated by the system
Prune events after x ammount of seconds set in vbulletin options
Cron job to prune user events & change user passwords that have forgone the event threshold
Admin Interface to do add/edit/list Ips that are being ignored
Admin interface to list events
Send Notification PM of an event to a list of admins set in vbulletin options
Send an Notification email of an alert/event to a list of admins set in vbulletin options
Post a Notificaiton thread upon an alert/event trigger to a specified forum set in vbulletin options
Possibly more that i cant think of off the top of my head


Known bugs that dont effect operation of this hack or performance of your board.

Cant edit Ignore IP's in AdminCP
Cant Prune Events in AdminCP
unable to edit ignore ips in the AdminCP interface


How do i install this?
Download & unpack the zip file
import /includes/xml/product_multiuser.xml from admincp
edit your settings to reflect your installation

Version Informaiton
1.0 - Initial Release
1.0.1 - Install XML Fix - Removed ENGINE from sql query calls in produc xml file

PHPGeek2k3
03-02-2006, 07:03 PM
Post reserverd for future.

Thanks
- James

UK Jimbo
03-02-2006, 07:06 PM
Have you see this plugin?

https://vborg.vbsupport.ru/showthread.php?t=107566&highlight=multiple+accounts

PHPGeek2k3
03-02-2006, 07:09 PM
yes i am very well aware of that plugin as i helped code it.

This hack is completely seperate and has different feature set.

MPDev is aware that i have been working on this current hack as he has forwarded a PM of the request that got me started on this plugin.

This plugin is more geared towards detecting multiple logins across multiple computers / logins not just one computer as the AE Multiple Login Detection Plugin is coded for one computer as it uses cookies. This uses the server backend and database to check against.

Thaks
- James

luroca
03-02-2006, 07:13 PM
First install and testing :)

Thanks a lot

luroca
03-02-2006, 07:34 PM
Well, first bugs :D

In a thread, the same number than posts:
Warning: Division by zero in /includes/class_postbit.php(251) : eval()'d code on line 39


In forum where threads are post:
Warning: Division by zero in /includes/class_postbit.php(251) : eval()'d code on line 39
Database error in vBulletin 3.5.3:

Invalid SQL:
SELECT COUNT(*) AS num FROM post AS post LEFT JOIN thread AS thread on post.threadid=thread.threadid LEFT JOIN forum AS forum on thread.forumid=forum.forumid WHERE ((forum.options&4096))AND(post.userid=45357)AND(post.dateline>=);

MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
Error Number : 1064
Date : Thursday, March 2nd 2006 @ 10:27:52 PM
Script : http://www.myboard.com/foro/showthread.php?t=83448
Referrer : http://www.myboard.com/foro/forumdisplay.php?f=59
IP Address : 83.33.xxx.xxx
Username : Admin
Classname : vb_database

I?ll try in a clean board without others hacks

Regards

luroca
03-02-2006, 07:59 PM
No problem in this moment in a board without hacks.
I continue testing.

luroca
03-02-2006, 08:19 PM
Apparently it has an incompatibility with the hack "Activity Modification v2.51" of WetWired:
https://vborg.vbsupport.ru/showthread.php?t=93831

Daniel
03-02-2006, 08:48 PM
Will keep an eye on this, thanks! :)

luroca
03-02-2006, 09:23 PM
I think a table in database is missing.
When I see Display Events in ACP:

Database error in vBulletin 3.5.3:

Invalid SQL:
SELECT * FROM mu_alert_core ORDER BY alertid DESC;

MySQL Error : Table 'mydatabase.mu_alert_core' doesn't exist
Error Number : 1146
Date : Friday, March 3rd 2006 @ 12:09:51 AM
Script : http://www.myboardcom/foro/admin_cp/admin_multiuser.php?do=showevents
Referrer : http://www.myboard.com/foro/admin_cp/index.php?do=nav
IP Address : 83.33.xxx.xxx
Username : Admin
Classname : vb_database

PHPGeek2k3
03-03-2006, 05:01 AM
The XML Product File should have added that table to the database.

Could you check via phpMyAdmin to see if the table is there?

As in the tests i have done it has worked for me.

Thanks
- James

I think a table in database is missing.
When I see Display Events in ACP:

Database error in vBulletin 3.5.3:

Invalid SQL:
SELECT * FROM mu_alert_core ORDER BY alertid DESC;

MySQL Error : Table 'mydatabase.mu_alert_core' doesn't exist
Error Number : 1146
Date : Friday, March 3rd 2006 @ 12:09:51 AM
Script : http://www.myboardcom/foro/admin_cp/admin_multiuser.php?do=showevents
Referrer : http://www.myboard.com/foro/admin_cp/index.php?do=nav
IP Address : 83.33.xxx.xxx
Username : Admin
Classname : vb_database

luroca
03-03-2006, 07:56 AM
Sorry, there is not such table.
When uninstall:
Invalid SQL:
DROP TABLE mu_alert_core;

MySQL Error : Unknown table 'mu_alert_core'
Error Number : 1051

luroca
03-03-2006, 08:10 AM
I see your code to create the table, but the table is not create :surprised:
I donĀ“t use any table prefix.

luroca
03-03-2006, 09:00 PM
Hello, some feedback:

$vbulletin->db->query_write("DROP TABLE " . TABLE_PREFIX . "mu_ignored_ips");
should be:
$vbulletin->db->query_write("DROP TABLE " . TABLE_PREFIX . "mu_alert_ignored_ips");

And
$vbulletin->db->query_write("ATLER TABLE " . TABLE_PREFIX . "user DROP `main_ip`");
should be:
$vbulletin->db->query_write("ALTER TABLE " . TABLE_PREFIX . "user DROP `main_ip`");

And
$vbulletin->db->query_wrtie("ALTER TABLE " . TABLE_PREFIX . "user DROP `num_alerts`");]]>
should be:
$vbulletin->db->query_write("ALTER TABLE " . TABLE_PREFIX . "user DROP `num_alerts`");]]>

) ENGINE=MyISAM DEFAULT CHARSET=latin1");

does not work for me, my server does not use MySam, it uses MySQL.
If I delete "ENGINE=MyISAM DEFAULT" in the product the tables are created but I get errors in Display Events:

Notice: Undefined index: charset in /home/mydominion/public_html/foro/includes/init.php on line 144

Notice: Undefined index: url in /home/mydominion/public_html/foro/includes/class_core.php on line 1991

Notice: Only variables should be assigned by reference in /home/mydominion/public_html/foro/includes/init.php on line 213

I hope this info helps.

Regards

luroca
03-03-2006, 09:08 PM
By the way, am I the only one with problems? There are 16 installs yet.

PHPGeek2k3
03-03-2006, 09:15 PM
the


" . TABLE_PREFIX . "_table_name


Should not effect you installation as it is taken care of by vbulletin.

go ahead and try changing


<uninstallcode><![CDATA[
$vbulletin->db->query_write("DROP TABLE " . TABLE_PREFIX . "mu_alert_core");
$vbulletin->db->query_write("DROP TABLE " . TABLE_PREFIX . "mu_alert_events");
$vbulletin->db->query_write("DROP TABLE " . TABLE_PREFIX . "mu_ignored_ips");
$vbulletin->db->query_write("ALTER TABLE " . TABLE_PREFIX . "user DROP `has_alerts`");
$vbulletin->db->query_write("ALTER TABLE " . TABLE_PREFIX . "user DROP `alert_id`");
$vbulletin->db->query_write("ATLER TABLE " . TABLE_PREFIX . "user DROP `main_ip`");
$vbulletin->db->query_wrtie("ALTER TABLE " . TABLE_PREFIX . "user DROP `num_alerts`");]]>
</uninstallcode>


to

<uninstallcode><![CDATA[
$vbulletin->db->query_write("DROP TABLE mu_alert_core");
$vbulletin->db->query_write("DROP TABLE mu_alert_events");
$vbulletin->db->query_write("DROP TABLE mu_ignored_ips");
$vbulletin->db->query_write("ALTER TABLE user DROP `has_alerts`");
$vbulletin->db->query_write("ALTER TABLE user DROP `alert_id`");
$vbulletin->db->query_write("ATLER TABLE user DROP `main_ip`");
$vbulletin->db->query_wrtie("ALTER TABLE user DROP `num_alerts`");]]>
</uninstallcode>


and try replacing

<installcode><![CDATA[$db->hide_errors();
$db->query_write("CREATE TABLE `" . TABLE_PREFIX . "mu_alert_core` (
`alertid` int(11) NOT NULL auto_increment,
`alert_userid` int(11) NOT NULL default '0',
`alert_threadid` int(11) default NULL,
PRIMARY KEY (`alertid`),
KEY `alert_userid` (`alert_userid`)
));

$db->query_write("CREATE TABLE `" . TABLE_PREFIX . "mu_alert_events` (
`event_id` int(10) NOT NULL default '0',
`alert_id` int(10) NOT NULL default '0',
`event_dateline` int(10) default NULL,
`event_userip` varchar(15) default NULL,
PRIMARY KEY (`event_id`),
KEY `alert_id` (`alert_id`),
KEY `event_userip` (`event_userip`)
));

$db->query_write("CREATE TABLE `" . TABLE_PREFIX . "mu_alert_ignored_ips` (
`id` int(11) NOT NULL auto_increment,
`ip` varchar(32) NOT NULL default '',
PRIMARY KEY (`id`)
));

$db->query_write("ALTER TABLE " .TABLE_PREFIX . "user ADD `has_alerts` INT(1) NOT NULL DEFAULT '0',
ADD `alert_id` INT(11) NOT NULL DEFAULT '0',
ADD `main_ip` VARCHAR(32) NOT NULL DEFAULT '0',
ADD `num_alerts` INT(10) NOT NULL DEFAULT '0'");
$db->show_errors();]]>
</installcode>


with


<installcode><![CDATA[$db->hide_errors();
$db->query_write("CREATE TABLE `mu_alert_core` (
`alertid` int(11) NOT NULL auto_increment,
`alert_userid` int(11) NOT NULL default '0',
`alert_threadid` int(11) default NULL,
PRIMARY KEY (`alertid`),
KEY `alert_userid` (`alert_userid`)
));

$db->query_write("CREATE TABLE `mu_alert_events` (
`event_id` int(10) NOT NULL default '0',
`alert_id` int(10) NOT NULL default '0',
`event_dateline` int(10) default NULL,
`event_userip` varchar(15) default NULL,
PRIMARY KEY (`event_id`),
KEY `alert_id` (`alert_id`),
KEY `event_userip` (`event_userip`)
));

$db->query_write("CREATE TABLE `mu_alert_ignored_ips` (
`id` int(11) NOT NULL auto_increment,
`ip` varchar(32) NOT NULL default '',
PRIMARY KEY (`id`)
));

$db->query_write("ALTER TABLE user ADD `has_alerts` INT(1) NOT NULL DEFAULT '0',
ADD `alert_id` INT(11) NOT NULL DEFAULT '0',
ADD `main_ip` VARCHAR(32) NOT NULL DEFAULT '0',
ADD `num_alerts` INT(10) NOT NULL DEFAULT '0'");
$db->show_errors();]]>
</installcode>


thanks
- james

luroca
03-03-2006, 09:38 PM
Hello James, you are right, the TABLE_PREFIX is not the problem.

The tables are now created (without the ENGINE=MyISAM DEFAULT CHARSET=latin1 and the ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1) but the error is still in Display Events:
Notice: Undefined index: charset in /home/mydominion/public_html/foro/includes/init.php on line 144
Notice: Undefined index: url in /home/mydominion/public_html/foro/includes/class_core.php on line 1991
Notice: Only variables should be assigned by reference in /home/mydominion/public_html/foro/includes/init.php on line 213

All other hacks are disabled to test this one.

Thanks to you.

P.D. I see in database that created tables are of type "MySAM", yes, as the other tables of database.

PHPGeek2k3
03-04-2006, 04:11 AM
just to let every one know i have updated the download to fix the problem with the tables not getting added to the database.

Thanks
- James

VBUsers
03-04-2006, 04:44 AM
will this work with the ae detector installed? can i have both?

luroca
03-04-2006, 02:12 PM
Upgrade to vb3.5.4, all original files without modifications, all products and plugins disabled, the same problems :(

ZippySLC
03-05-2006, 12:05 PM
Same problems here. DB table not created. :(

Can you give a .sql file or the appropriate queries to run so I can use this?

pantec
03-06-2006, 01:29 AM
I can not even unistall it.... keeps giving me sql errors.... and freezes in 3.54.

Same problems here. DB table not created. :(

Can you give a .sql file or the appropriate queries to run so I can use this?

MThornback
03-06-2006, 12:13 PM
I can not even unistall it.... keeps giving me sql errors.... and freezes in 3.54.


This will work for the time being....Go into phpmyadmin, get rid of the tables (add a table prefix as needed...and backup first!):


DROP TABLE IF EXISTS `mu_alert_core`;
DROP TABLE IF EXISTS `mu_alert_events`;
DROP TABLE IF EXISTS `mu_alert_ignored_ips`;


Then for the user table:


ALTER TABLE `user` DROP `has_alerts`;
ALTER TABLE `user` DROP `alert_id`;
ALTER TABLE `user` DROP `main_ip`;
ALTER TABLE `user` DROP `num_alerts`;


Then go into your settinggroup table and find "multiuser" and you should be able to delete the whole thing...

Go into your setting table, and search for all entries with "_mu_"


The rest is templates and such, and they are no problem to delete through the ACP without errors...and this should atleast get you past the SQL errors your running into...

OWNAGE TIME
03-06-2006, 03:05 PM
This looks to be a great plug-in since I have this issue on my board. However I'm afraid to install it on a board with thousands of members. Is it stable enough is my question?

~Ownage

PHPGeek2k3
03-06-2006, 10:26 PM
This should work fine with AE detector hack as these perform check for multiple user via two different methods.

new xml file should have fixed the install/uninstall issue.

thanks
- James

AraServ
03-17-2006, 10:04 AM
when you well release the hack ?

vampireus
04-04-2006, 01:13 AM
Still got DB error and unable to uninstall :(

kofoid
09-03-2006, 05:41 PM
Can someone let me know exactly where to upload the stuff in the zip? I am not getting table errors, but everything is blank in the admin CP - this is something I NEEEEEED so if someone could help, I would appreciate it

geppeto
11-16-2006, 10:17 PM
I intereset in this Hack to vB 3.6.x it is possible? In my case don't work on 3.5.4.

Thx very much