MyBB Community Forums

Full Version: Using the Time Online to detect spammers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been running my new board for about a month, and found that I have about 5% spam/bogus users already. They mostly come from 173.234.*.* IPs, but there's something more useful that the have in common:

Their Time Spent Online is 1 second.

It looks like these users just register with the forum, and never come back. I'm not sure yet what to make of them. Their usernames are 7 characters that make no sense.

But here's how to use this Time Spent Online information to detect spammers. Using phpMyAdmin, or your SQL command-line client, connect to your MyBB database and run the following query:

SELECT username, email, FROM_UNIXTIME(regdate), timeonline, regip, lastip  from users WHERE timeonline < 10 ORDER BY timeonline ASC;

This query will get the users with less than 10 seconds spent online. Be careful if you have the Facebook plugin installed, because timeonline can be legitimately 0 for those users, if they have just registered. Other than than, if you see a user registered a while ago and they have been online for only 1 second, and their username looks weird, they're probably a spammer.

If you want to support this option being introduced in ACP, please comment on this thread.
The query should be
SELECT username, email, FROM_UNIXTIME(regdate), timeonline, regip, lastip  from mybb_users WHERE timeonline < 10 ORDER BY timeonline ASC;
(2011-07-20, 06:40 PM)ProVirus Wrote: [ -> ]The query should be
SELECT username, email, FROM_UNIXTIME(regdate), timeonline, regip, lastip  from mybb_users WHERE timeonline < 10 ORDER BY timeonline ASC;

Depends on your table prefix, or if your using one at all.