Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Troll/ip-tracker, detect multiple accounts/trolls [3.6 compatible] Details »»
Troll/ip-tracker, detect multiple accounts/trolls [3.6 compatible]
Version: 2.0.4, by TMM-TT TMM-TT is offline
Developer Last Online: May 2019 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.5.4 Rating:
Released: 06-25-2006 Last Update: Never Installs: 103
DB Changes Uses Plugins
Additional Files  
No support by the author.

Continuosly information about updates can also be found here.

Edit 2007-08-07

Since the script needs to be rebuilt from scratch due to some problems with it, I've decided to temporarily stop the distribution. On larger sites, this script may cause heavy lagging when active. There has also been reports on "duplicate keys", that should be fixed. To prevent more problems cause by this hack, it's removed and cannot be downloaded.


History


In 2005 a forum was founded, for a short period of time that was intended to work as a service for people with a common interest - a reality show. The forum grew big and the traffic was very intensive. Moderators worked day and night to assist the forum. Traffic and events in the show made people show different kind of feelings and some of them showed this in strange ways. They said "I'd better register 10 nicknames, just to secure that noone can ban me". Sometimes, when they got banned, they registered new nicks and sometimes they switched ips but they didn't post anything the same day. Next day, they switched ip again and it suddenly got much harder to trace their nicks back to the start.

In 2006, the forum opened again (new season) and we was prepared for this. A script, specialized to trace trolls, was written and the main purpose was to trace things that vBulletin missed. This plugin was requested at the vBulletin forums.


Now, it's here, as a beta production - a trolltracker that stamps all visitors even if they don't post anything. It also, partially, checks if an ip-address can be traced from anonymous proxies by reading headers that proxies are sending to he server (HTTP_VIA and HTTP_X_FORWARDED_FOR).


Templates to change (Optional): 3


Attached

trolltracker-2.0.3beta.zip - the main archive with the tracker and extras
iptracker.php - A quickfix for the coming version 2.0.4 that changes the SHOW COLUMNS-behaviour-bug in the tracker


The archive

The zip should contain the following files
  • The product, currently named product-trolltracker_beta.xml because of it's beta status
  • iptracker.php, the tool that makes it easier to trace nicknames and ip's
  • iptracker_search.php, htmlcode - the searchform that iptracker.php is using (old code that never used templates)
  • trollpost.php, a quite slow script that imports ip's and usernames from the post-table to make it possible to trace older data. (If you run this over a web-interface, it might not work, because of timeouts --screendump--)

How to install
  1. Copy *.php to your forumroot
  2. Install the product code (choose overwrite if you're upgrading)
  3. Check the configuration from your admincp (settings for usergroups that can run the iptracker.php is made from there)
Additional information


Track older ips (2.0.x)


If you want to import older posts, you can do that, but because of timeouts (and bad scripting) trollpost.php may timeout if you run the script from a web-browser. This part is, currently, unsupported, but if someone has any ideas here, feel free to notify me.

OPM Support

The ip-tracker supports RBL Monitor.


How to use it

Use the tracker by calling http://your-forum.com/iptracker.php


Database


The installation creates a table named user_troll for your forum.
The FQDN-support also adds a table called user_trollresolver for the resolver cache (like the one used in the OPM monitor)

Information and issues
  • There is no version 1.x - that version was private (this is not an issue)
  • It's still a beta, so bugs may still annoy us
  • Testing on vBulletin 3.6.0 rc1: Works fine
  • Importing posts with trollpost.php might give strange results if you are using the multiple account detector (AE): reports in forum that are posted with a specific userid makes it look like a troll is using other usernames too
To do

See CHANGELOG for full details


Show the tracker in navbar (v2.0.1+)


To show the tracker in the navbar (only for the admingroups that can be found in the options), edit your template 'navbar' and add this code where you want it to be shown:

HTML Code:
 <if condition="$show['trolltracker']"><td class="vbmenu_control"><a href="iptracker.php">Trolltracker</a></td></if>
I chose to put it in the end of navbar, right after this code:

HTML Code:
        <if condition="$show['member']">
<td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out()">$vbphrase[log_out]</a></td>
        </if>
How to show trolls in the onlinelist

Edit template:
whosonlinebit

Find:
</tr>

Add above:
HTML Code:
    <if condition="$show['trolldata'] AND $userinfo['trolldata'] != ''">
            <td class="alt1">
            $userinfo[trolldata]
            </td>
        </if>
Edit template:
WHOSONLINE

Find:
HTML Code:
</tr>
$onlinebits
Add above:

HTML Code:
    <if condition="$show['trolldata']">
            <td class="thead">
            <b>Trolldata</b>
            </td>
        </if>
Support, help, contact

Any questions, requests and bugreports can be sent to me by PM, mail or via threads at http://vbulletin.tornevall.net/


Don't forget to install this plugin

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #52  
Old 07-31-2006, 01:15 AM
TMM-TT's Avatar
TMM-TT TMM-TT is offline
 
Join Date: Jun 2005
Location: Sweden
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Changes for 2.0.4 that will be released as soon the caches has been tested:
  • Using short-time cache to look for duplicates instead of scanning the whole database (based on cookietimeout)
  • The above cache is used with the whos online-list too
  • Added cache for alerts so reports only will be sent on changes in the usernames
  • 2 phrases fixed
  • Added username exclusions (usernames/userids that won't be blocked)
  • Fixed the SHOW COLUMNS-problem in iptracker.php


If someone thinks that I have forgotten something, please tell me.
Reply With Quote
  #53  
Old 07-31-2006, 01:40 PM
Alfa1's Avatar
Alfa1 Alfa1 is offline
 
Join Date: Dec 2005
Location: Netherlands
Posts: 3,537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TMM-TT
  1. Joe is banned
  2. The tracker see that Joe is banned and blocks him from the forum
  3. Joe try to log out by cleaning up the cookies
  4. The tracker compares the ip to the banlist and see that there is a guest using Joes ip.. He gets blocked as guest also
  5. Three days later, Joes ip is changed and he can log in as a guest again. He knows that hes banned so he use another nickname instead, that he registered after 'Joe'. He logs in as 'Jim'
  6. The tracker checks the database and find that Joe is linked to Jim
  7. The tracker checks with the userban-list and find that Joe is banned
  8. Jim, Joe and the new ip is now locked out


The blacklisting option means that if any guest is matched with a banned user the ip will be blocked from the forum even before login. If 'Jim' is a shared "troll"-account this also means that all users logged in as Jim, will be locked out of the forum because Joe is linked to the same nick - and banned.

The blacklist in options->userbanning only stops specific ip-addresses, which means that if Joe goes to his parents he's able to see the forum as a guest (until he tries to login as Joe again). If you use the built-in blacklist and using parts of the ip the risk is that you ban a bunch of other users that is using the same subnet.
Wouldn't this block out dial up users and users on providers like aol? (banning one AOL IP affects a whole range of AOL IP's, because of the way AOL's network works)
Reply With Quote
  #54  
Old 07-31-2006, 06:13 PM
Alfa1's Avatar
Alfa1 Alfa1 is offline
 
Join Date: Dec 2005
Location: Netherlands
Posts: 3,537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After a month of use, I experienced these errors:
Quote:
Invalid SQL:
SELECT * from vb9_user_troll WHERE userid = '0' AND realip = 'xxx' ORDER BY timestamp DESC LIMIT 1;

MySQL Error : Lost connection to MySQL server during query
Error Number : 2013
Quote:
Invalid SQL:
SELECT COUNT(*) AS trolledlinks FROM vb9_user_troll WHERE userlink = '0';

MySQL Error : Server shutdown in progress
Error Number : 1053
Quote:
Invalid SQL:
UPDATE vb9_user_troll SET userlink = '3423' WHERE idx = '153' LIMIT 1;

MySQL Error : Server shutdown in progress
Error Number : 1053
Quote:
Invalid SQL:
UPDATE vb9_user_troll SET timestamp = 1153908011, date = '%2006-%07-%26', username = 'Unregistered', userid = '0', time = '%11:%Jul:%th', opm = '0' WHERE idx = '37650' LIMIT 1;

MySQL Error : Server shutdown in progress
Error Number : 1053
Quote:
Invalid SQL:
SELECT userid,realip,timestamp from vb9_user_troll WHERE userid > 0 AND realip = 'xxx' ORDER by timestamp DESC, userid ASC LIMIT 1;

MySQL Error : Server shutdown in progress
Error Number : 1053
Quote:
Invalid SQL:
UPDATE vb9_user_troll SET timestamp = 1152565757, date = '%2006-%07-%10', username = 'Jack's Seratonin', userid = '0', time = '%22:%Jul:%th', opm = '0' WHERE idx = '21475' LIMIT 1;

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 's Seratonin', userid = '0', time = '%22:%Jul:%th', opm = '0' WHE
Error Number : 1064
Note that the username was jack's serotonine. This error occurs many times where usernames include this symbol: '

I've got many more, but they are variations on the same.
Reply With Quote
  #55  
Old 08-01-2006, 12:00 PM
TMM-TT's Avatar
TMM-TT TMM-TT is offline
 
Join Date: Jun 2005
Location: Sweden
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Alfa1
Wouldn't this block out dial up users and users on providers like aol? (banning one AOL IP affects a whole range of AOL IP's, because of the way AOL's network works)

Yes, but blocking users is optional and can be turned off. I only block specific usernames myself but the function is there for paranoid admins


Quote:
Originally Posted by Alfa1
Note that the username was jack's serotonine. This error occurs many times where usernames include this symbol: '
Thanks, it should be fixed in next version. Interesting also, is that entry (time = '%22:%Jul:%th'). The time isn't correct there and I use strftime in the plugin. Maybe I should look for some other function for that part (I remember that vbdate didn't work).

(I still cant reproduce the problem you have there with server shutdowns. If someone have a tip there, why the error shows up, I would be very happy.)
Reply With Quote
  #56  
Old 08-26-2006, 08:34 PM
Ski-Whiz's Avatar
Ski-Whiz Ski-Whiz is offline
 
Join Date: May 2003
Posts: 214
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I have found a bug:

Code:
Invalid SQL:
UPDATE user_troll SET timestamp = 1156627674, date = '2006-08-26', username =
'dabear's are #1', userid = '0', time = '17:27:54', opm = '0', imported = 0 WHERE
idx = '9830' AND deleted = 0 AND fqdn = 0 LIMIT 1;

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 's are
#1', userid = '0', time = '17:27:54', opm = '0', imported = 0 WHERE idx = ' at line
1
Error Number : 1064
Date         : Saturday, August 26th 2006 @ 05:27:54 PM
Script       : http://www.xxxxxxx.com/forums/register.php
Now this error is from anyone who uses an apostrophe in their username. The name I tried to register is "dabear's are #1"

This leaves us all open to a SQL attack..
Reply With Quote
  #57  
Old 09-19-2006, 10:00 AM
TMM-TT's Avatar
TMM-TT TMM-TT is offline
 
Join Date: Jun 2005
Location: Sweden
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I apologize for the big delay on this hack. Too much things are happening around me so I've lost a lot of time.. Hopefully I can release 2.0.4 as soon as possible with a bunch of fixes.

As a notice - I've noticed (at least on my own server) that the function for showing trolls in the o Who's Online-listing lags me down a little bit sometimes. Probably that function depends on how many users online and how much the tracker has to look for. Without the extra cache there, I think the online-listing won't survive.


Quote:
Originally Posted by Ski-Whiz
Now this error is from anyone who uses an apostrophe in their username. The name I tried to register is "dabear's are #1"

This leaves us all open to a SQL attack..
That should hopefully be fixed too now.
Reply With Quote
  #58  
Old 09-19-2006, 10:07 AM
TMM-TT's Avatar
TMM-TT TMM-TT is offline
 
Join Date: Jun 2005
Location: Sweden
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Because of the apostrophe-thing, I'll release this one now.. Here's the changelog -

2.0.4 [beta]
  • Using short-time cache to look for duplicates instead of scanning the whole database (based on cookietimeout)
  • The above cache is used with the whos online-list too
  • Added cache for alerts so reports only will be sent on changes in the usernames
  • 2 phrases fixed
  • Added username exclusions (usernames/userids that won't be blocked)
  • Fixed the SHOW COLUMNS-problem in iptracker.php
  • Fixed a serious injection problem
Reply With Quote
  #59  
Old 09-19-2006, 02:44 PM
Alfa1's Avatar
Alfa1 Alfa1 is offline
 
Join Date: Dec 2005
Location: Netherlands
Posts: 3,537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After upgrading this I get an error. I have tried uninstalling trolltracker and reinstalling it, but then I get this:

Database error in vBulletin 3.5.4:

Invalid SQL:

### INSERT QUERY GENERATED BY fetch_query_sql() ###
INSERT INTO vb4_plugin
(`active`, `executionorder`, `title`, `hookname`, `phpcode`, `product`)
VALUES
('1', '5', 'trolltracker_register', 'global_start', '// Note, this code has no version 1.0.0 released. The first version was private\r\n// and this one is the conversion.\r\n\r\n$dosavetroll = 1;\r\n\r\n// admincp settings\r\n// v1.0->2.0 and some addons\r\n$trollenabled = $vbulletin->options[\'trollenabled\'];\r\n\r\n// Something went wrong!\r\nif (!$_SERVER[\'REMOTE_ADDR\']) {$trollenabled = 0;}\r\n\r\nif ($trollenabled == 1) {\r\n$followtroll = $vbulletin->options[\'followtroll\'];\r\n$trolluseridlookup = $vbulletin->options[\'trolluserid\'];\r\n$trollunreg = $vbulletin->options[\'trollunreg\'];\r\n$trollignoreopm = $vbulletin->options[\'trollignoreopm\'];\r\n$trollwarnopm = $vbulletin->options[\'trollwarnopm\'];\r\n$trollsession = $vbulletin->options[\'trollsession\'];\r\n$trollblock = $vbulletin->options[\'trollblock\'];\r\n$trollblockuser = strtolower($vbulletin->options[\'trollblockuser\']);\r\n$trollexcludeuser = strtolower($vbulletin->options[\'trollexcludeuser\']);\r\n$trollblockusertrig = $vbulletin->options[\'trollblockusertrig\'];\r\n$trolladmin = $vbulletin->options[\'trolladmin\'];\r\n$trollcandelete = $vbulletin->options[\'trollcandelete\'];\r\n$trolluniqueheaders = $vbulletin->options[\'trolluniqueheaders\'];\r\n$trollalertuser = $vbulletin->options[\'trollalertuser\'];\r\n$trollalertforum = $vbulletin->options[\'trollalertforum\'];\r\n$trollalertafter = $vbulletin->options[\'trollalertafter\'];\r\n$trollonlineusers = $vbulletin->options[\'trollonlineusers\'];\r\n$trolldifftime = $vbulletin->options[\'trolldifftime\']*60*60;\r\n$trollalertfrom = $vbulletin->options[\'trollalertfrom\'];\r\n$trollFQDN = $vbulletin->options[\'trollFQDN\'];\r\n$trolluseFQDN = $vbulletin->options[\'trolluseFQDN\'];\r\n$trollautoblockBans = $vbulletin->options[\'trollautoblockBans\'];\r\n\r\n// Clean cacheResolver\r\n$cleanTrollResolver = TIMENOW - 21600;\r\n$vbulletin->db->query(\"DELETE FROM \" . TABLE_PREFIX . \"user_trollresolver WHERE dateline < $cleanTrollResolver\");\r\n\r\n// Who can use tracker...?\r\nglobal $istrolladmin, $istrolldelete, $vbulletin, $db, $vbphrase, $stylevar, $style;\r\n\r\n$trollgroups = explode(\',\',$vbulletin->options[trolladmin]); \r\nif (is_member_of($vbulletin->userinfo, $trollgroups)) $istrolladmin = true;\r\n\r\n// Who can manipulate the tracker?\r\n$trollcandeletegroups = explode(\',\',$vbulletin->options[trollcandelete]); \r\nif (is_member_of($vbulletin->userinfo, $trollcandeletegroups)) $istrolldelete = true;\r\n\r\nif ($istrolladmin == 1) {\r\n $show[\'trolltracker\'] = 1;\r\n if ($trollonlineusers) {$show[\'trolldata\'] = 1;}\r\n }\r\n\r\n/**** Userdata and browser stuff ****/\r\n// Reliable data to register\r\n// Note, addslashes is only needed on ONE $trollusername if we don\'t want a whole lot of dupes!\r\n$trollusername = addslashes($vbulletin->userinfo[\'username\']);\r\n$trolluserid = $vbulletin->userinfo[\'userid\'];\r\n$trollremote = $_SERVER[\'REMOTE_ADDR\'];\r\n$timestamp = TIMENOW;\r\n$trolldate = strftime(\'%Y-%m-%d\');\r\n$trolltime = strftime(\'%H:%M:%S\');\r\n\r\n\r\n// Unreliable data to save, but sometimes, still effective when trolls are using half-anonymous proxies\r\n$forwarded = $_SERVER[\'HTTP_X_FORWARDED_FOR\'];\r\n$via = $_SERVER[\'HTTP_VIA\'];\r\n\r\n// Don\'t overload the server with extra processes if not needed...\r\nif ($trollalertuser OR $trollalertforum OR $trollonlineusers == 1) {\r\n\r\n/**** COUNTING OF USER\'S NICKNAMES BEGIN (IF SELECTED FROM OPTIONS) ****/\r\n// Should only be enabled on request (alerting, blocking and \"self-notifying\")\r\n\r\n/** Check the cache for nicknames, so we don\'t have to query the big one **/\r\n// Clear old entries...\r\n$clearcachetime = TIMENOW - $vbulletin->options[cookietimeout];\r\n$vbulletin->db->query_write(\"DELETE FROM \" . TABLE_PREFIX . \"user_trollcache WHERE timestamp < \" . $clearcachetime);\r\n$trollcache = $vbulletin->db->query_first(\"SELECT * from \" . TABLE_PREFIX . \"user_trollcache WHERE realip = \'$trollremote\'\");\r\nif ($trollcache[nicks]) {\r\n $trollcachenicks = explode(\"\\n\", $trollcache[nicks]);\r\n foreach ($trollcachenicks as $nicks => $trollcachevalue) {\r\n // Must not be empty!\r\n if ($trollcachevalue) {\r\n $trollnicksUID[$vbulletin->userinfo[userid]] = $vbulletin->userinfo[userid];\r\n $trollnicksNAME[strtolower($trollcachevalue)] = strtolower($trollcachevalue);\r\n $trollnicksIP[$trollremote] = $trollremote;\r\n $trolls .= $trollcachevalue . \"\\n\";\r\n $linked++;\r\n }\r\n }\r\n}\r\n\r\n\r\n/** Check the cache for nicknames, so we don\'t have to query the big one --- DONE HERE **/\r\n// If this var is empty, we don\'t have anything cached.\r\n// Start caching only if this is no guest...\r\nif (!$trolls) {\r\n\r\n// This is a special thing that has to do with the guest vs logged when reporting.\r\n$getusernamedata = \"user.username = \'\" . addslashes($vbulletin->userinfo[username]) . \"\' OR \";\r\n// We don\'t want to include not logged in users in this report (because of the unregistered-name).\r\n// So we\'re removing it here instead of looking for unregged usernames in the database.\r\nif ($vbulletin->userinfo[userid] == 0) {$getusernamedata = \"\";}\r\n\r\n$lcountsql = \"SELECT DISTINCT users.userid,users.username,users.userlink,users.r ealip,users.timestamp,users.fo rwarded_for,users.http_via,user.userid\r\nFROM \" . TABLE_PREFIX . \"user_troll AS users\r\nINNER JOIN \" . TABLE_PREFIX . \"user_troll as user\r\nON (users.username = user.username)\r\nOR (users.userlink = user.userid AND users.userlink > 0)\r\nOR (users.realip = user.realip)\r\nOR (users.forwarded_for LIKE \'%$trollremote%\' AND users.forwarded_for != \'\')\r\nOR (users.http_via LIKE \'%$trollremote%\' AND users.http_via != \'\')\r\nWHERE user.userid > 0 AND users.userid > 0\r\nAND (\r\n $getusernamedata user.realip = \'$trollremote\'\r\n )\r\nAND user.deleted = 0\r\nAND users.deleted = 0\r\nAND user.fqdn = 0\r\nAND users.fqdn = 0\r\nGROUP by username\r\nORDER by timestamp DESC\r\n\";\r\n\r\n// Do not include FQDN-names into this listing - FQDN-names are not duplicate usernames, just identifiers\r\n$lcount = $vbulletin->db->query($lcountsql);\r\n\r\n// Collect nicknames to the dupechecker\r\n while ($trollArray = $vbulletin->db->fetch_array($lcount)) {\r\n\r\n // Must not be empty\r\n if ($trollArray[username]) {\r\n $trollnicksUID[$trollArray[userid]] = $trollArray[userid];\r\n $trollnicksNAME[strtolower($trollArray[username])] = strtolower($trollArray[username]);\r\n $trollnicksIP[$trollArray[realip]] = $trollArray[realip];\r\n\r\n if ($trollArray[userid] > 0) {$trolls .= $trollArray[username] . \"\\n\";}\r\n $linked++;\r\n }\r\n }\r\n\r\n\r\n// Fixes ontheirway! (060919)\r\n$trolls = addslashes($trolls);\r\n\r\n// If the own nick is missing, add it.\r\nif (!$trollnicksNAME[strtolower($trollusername)] AND $vbulletin->userinfo[userid] > 0) {$trolls .= $vbulletin->userinfo[username] . \"\\n\";}\r\n\r\n$vbulletin->db->query_write(\"INSERT INTO \" . TABLE_PREFIX . \"user_trollcache (userid, realip, nicks, timestamp) VALUES (\'\" . $vbulletin->userinfo[userid] . \"\', \'$trollremote\', \'$trolls\', \" . TIMENOW . \")\");\r\n\r\n} // End if cachevar\r\n\r\n}\r\n\r\n/**** COUNTING OF USER\'S NICKNAMES FINISH ****/\r\n\r\n\r\n/**** ALERT SECTION BEGIN ****/\r\n if (($trollalertuser OR $trollalertforum) AND $linked >= $trollalertafter AND $trollalertfrom > 0 AND $vbulletin->userinfo[userid] > 0) {\r\n // Used vars: $trollalertuser, $trollalertforum (Update database)\r\n\r\n $trolldupechanges = $vbulletin->db->query_first(\"SELECT * FROM \" . TABLE_PREFIX . \"user_trolldupes WHERE userid = \'\" . $vbulletin->userinfo[userid] . \"\' AND userid > 0\");\r\n\r\n if (!$trolldupechanges[nicklist]) {\r\n // Do not write guests into this list, that will cause trouble on reporting...\r\n if ($vbulletin->userinfo[userid] > 0) {\r\n $vbulletin->db->query_write(\"INSERT INTO \" . TABLE_PREFIX . \"user_trolldupes (userid, nicklist) VALUES (\'\" . $vbulletin->userinfo[userid] . \"\', \'\" . $trolls . \"\')\");\r\n }\r\n }\r\n\r\n // Report on changes...\r\n if ($trolls != $trolldupechanges[nicklist] AND $trolls) {\r\n $doreporttrolls = 1;\r\n\r\n // If there\'s an old nicklist, it\'s time to update here...\r\n if ($trolldupechanges[userid] == $vbulletin->userinfo[userid] AND $vbulletin->userinfo[userid] > 0 AND $trolldupechanges[userid] > 0) {\r\n $vbulletin->db->query_write(\"UPDATE \" . TABLE_PREFIX . \"user_trolldupes SET nicklist = \'$trolls\' WHERE userid = \'\" . $vbulletin->userinfo[userid] . \"\'\");\r\n }\r\n\r\n }\r\n\r\n$blockstatus = \"\";\r\n\r\n// Report normal blockings\r\nif ($linked >= $trollblock AND $trollblock > 0 AND $istrolladmin != 1 AND THIS_SCRIPT != \'iptracker.php\') {$blockstatus = $vbphrase[troll_report_blocked];}\r\n\r\n// Report bans\r\nif ($trollautoblockBans == 1 AND $forcetrollban == 1 AND $istrolladmin != 1 AND THIS_SCRIPT != \'iptracker.php\') {$blockstatus = $vbphrase[troll_report_banned];}\r\n\r\n if ($doreporttrolls == 1 AND $linked >= $trollalertafter) {\r\n $trollqueryuser = fetch_userinfo($trollalertfrom);\r\n\r\n $trollpm =& datamanager_init(\'PM\', $vbulletin, ERRTYPE_SILENT);\r\n // Send PM if options are set for PM\r\n if ($trollalertuser) {\r\n $trollpm->set(\'fromuserid\', $trollqueryuser[userid]);\r\n $trollpm->set(\'fromusername\', $trollqueryuser[username]);\r\n $trollpm->set_info(\'reciept\', false);\r\n $trollpm->set_info(\'savecopy\', false);\r\n $trollpm->set(\'title\', construct_phrase($vbphrase[troll_alertsubject], $vbulletin->userinfo[username]));\r\n $trollpm->set(\'message\', construct_phrase($vbphrase[troll_alertmessage], $vbulletin->userinfo[username], $trolls, $blockstatus));\r\n $trollpm->set_recipients($trollalertuser, $trollqueryuser[permissions]);\r\n $trollpm->set(\'dateline\', TIMENOW);\r\n $trollpm->save();\r\n }\r\n\r\n if ($trollalertforum) {\r\n $t_smilies = 1;\r\n $t_visible = 1;\r\n require_once(DIR . \'/includes/class_dm_threadpost.php\');\r\n $trollreport = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);\r\n $trollreport->do_set(\'forumid\', $trollalertforum);\r\n $trollreport->do_set(\'userid\', $trollqueryuser[\'userid\']);\r\n $trollreport->do_set(\'username\', $trollqueryuser[\'username\']);\r\n $trollreport->do_set(\'title\', construct_phrase($vbphrase[troll_alertsubject], $vbulletin->userinfo[username]));\r\n $trollreport->do_set(\'pagetext\', construct_phrase($vbphrase[troll_alertmessage], $vbulletin->userinfo[username], $trolls, $blockstatus));\r\n $trollreport->do_set(\'allowsmilie\', $t_smilies);\r\n $trollreport->do_set(\'visible\', $t_visible);\r\n $sendtrollreport = $trollreport->save();\r\n \r\n require_once(DIR . \'/includes/functions_databuild.php\');\r\n build_forum_counters($trollalertforum);\r\n }\r\n }\r\n\r\n // Update database, so we won\'t get repeating in the forum and PM\'s\r\n $vbulletin->db->query_write(\"UPDATE user_troll SET alert = \" . TIMENOW . \" WHERE userid = \'\" . $vbulletin->userinfo[userid] . \"\' AND deleted = 0 ORDER by alert DESC LIMIT 1\");\r\n\r\n }\r\n/**** ALERT SECTION FINISH ****/\r\n\r\n\r\n/**** BLOCK TROLLS ON REQUEST BEGIN ****/\r\n// Check for special blocks start\r\n$trollblocknames = explode(\"\\n\", preg_replace(\"[\\r]\", \"\", strtolower($vbulletin->options[\'trollblockuser\'])));\r\n$trollexcludenames = explode(\"\\n\", preg_replace(\"[\\r]\", \"\", strtolower($vbulletin->options[\'trollexcludeuser\'])));\r\n\r\n foreach ($trollexcludenames as $texclude => $excludenames) {$exclude[strtolower($excludenames)] = strtolower($excludenames);}\r\n\r\n// Want to block banned users from forum? Array it here...\r\nif ($trollautoblockBans == 1) {\r\n $trollbans = $vbulletin->db->query(\"SELECT * from \" . TABLE_PREFIX . \"userban\");\r\n\r\n while ($trollban = $vbulletin->db->fetch_array($trollbans)) {\r\n $realuserBAN = fetch_userinfo($trollban[userid]);\r\n if ($trollautoblockBans == 1) {\r\n // Force ban if any matches, but only if user is not admin...\r\n if (strtolower($trollnicksUID[$trollban[userid]]) == strtolower($trollban[userid]) AND $istrolladmin != 1) {\r\n $trollbanreason = $trollban[\'reason\'];\r\n if ($trollban[\'liftdate\']) {\r\n $trollbandate = vbdate($vbulletin->options[\'dateformat\'] . \', \' . $vbulletin->options[\'timeformat\'], $trollban[\'liftdate\']);\r\n } else {\r\n $trollbandate = $vbphrase[\'never\'];\r\n }\r\n $forcetrollban = 1;\r\n }\r\n if (strtolower($trollnicksNAME[$realuserBAN[username]]) == strtolower($realuserBAN[username]) AND $istrolladmin != 1) {\r\n $trollbanreason = $trollban[\'reason\'];\r\n if ($trollban[\'liftdate\']) {\r\n $trollbandate = vbdate($vbulletin->options[\'dateformat\'] . \', \' . $vbulletin->options[\'timeformat\'], $trollban[\'liftdate\']);\r\n } else {\r\n $trollbandate = $vbphrase[\'never\'];\r\n }\r\n $forcetrollban = 1;\r\n }\r\n }\r\n\r\n }\r\n if (!$trollbanreason) {$vbphrase[\'none\'];}\r\n}\r\n// End banblock array\r\n\r\nforeach ($trollblocknames as $trollers) {\r\n $counttrollblock++;\r\n if ($trollers > 0 && $vbulletin->userinfo[\'userid\'] == $trollers) {$dotrollblock = 1;}\r\n if ($trollers < 1 && strtolower($vbulletin->userinfo[\'username\']) == strtolower($trollers)) {$dotrollblock = 1;}\r\n\r\n // Linkmatching - Block the current logged in user if there\'s a match with the userlist in options.\r\n // This includes IP from v2.0.2 and up\r\n if (strtolower($trollers) == strtolower($trollnicksUID[$trollers])) {$dotrollblock = 1;}\r\n if (strtolower($trollers) == strtolower($trollnicksNAME[$trollers])) {$dotrollblock = 1;}\r\n if (strtolower($trollers) == strtolower($trollnicksIP[$trollers])) {$dotrollblock = 1;}\r\n}\r\n\r\n// If there is a count in the userlist, the blocklist is active. Of there\'s matches on the current\r\n// logged in userid/username, check how many userlinks we find. Then block if everything is ok\r\nif ($counttrollblock > 0 AND $dotrollblock == 1 AND $linked >= $trollblockusertrig) {\r\n $trollblock = $trollblockusertrig;\r\n }\r\n// Check for special blocks end\r\n\r\nif (strtolower($trollusername) == strtolower($exclude[$trollusername]) OR $vbulletin->userinfo[userid] == $exclude[$trolluserid]) {\r\n $forcetrollban = 0;\r\n $linked = 0;\r\n }\r\n\r\n/** BLOCKING AND BANNING BEGIN **/\r\n// Protect admins from being blocked\r\nif ($trollautoblockBans == 1 AND $forcetrollban == 1 AND $istrolladmin != 1 AND THIS_SCRIPT != \'iptracker.php\') {\r\n eval(\'$headinclude = \"\' . fetch_template(\'headinclude\') . \'\";\');\r\n eval(standard_error(fetch_error(\'nopermission_ban ned\', $trollbanreason, $trollbandate)));\r\n }\r\n\r\nif ($linked >= $trollblock AND $trollblock > 0 AND $istrolladmin != 1 AND THIS_SCRIPT != \'iptracker.php\') {\r\n $vbulletin->userinfo[\'badlocation\'] =1;\r\n $errormessage = construct_phrase($vbphrase[\'trollerror_toomanynicks\'], $linked);\r\n eval(\'$headinclude = \"\' . fetch_template(\'headinclude\') . \'\";\');\r\n eval(\'$header = \"\' . fetch_template(\'header\') . \'\";\');\r\n eval(\'$footer = \"\' . fetch_template(\'footer\') . \'\";\');\r\n eval(\'print_output(\"\' . fetch_template(\'STANDARD_ERROR\') . \'\");\');\r\n}\r\n/** BLOCKING AND BANNING FINISH **/\r\n\r\n\r\n/**** BLOCK TROLLS ON REQUEST FINISH ****/\r\n\r\n\r\n\r\n/******** CONTINUE IF THE USER ISN\'T BLOCKED ********/\r\n\r\n\r\n\r\n/**** RBL MONITORING BEGIN ****/\r\n// Is the rbl monitor installed?\r\nif ($rblInstalled) {\r\n // Are we allowed to look for proxies?\r\n if ($trollignoreopm == 1 OR $trollwarnopm == 1) {\r\n // Just return the value returned from the monitor\r\n $trollIsOPM = rbl_livecheck(1, $trollremote);\r\n }\r\n } else {\r\n // If nothing is correct, just say 0\r\n $trollIsOPM = 0;\r\n }\r\n/**** RBL MONITORING FINISH ****/\r\n\r\n\r\n\r\n\r\n\r\n/**** FQDN RESOLVE BEGIN ****/\r\n if ($trollFQDN AND $trolluseFQDN == 1) {\r\n // First, grab the names and split up with userid\r\n $trollFQnames = explode(\"\\n\", preg_replace(\"[\\r]\", \"\", $trollFQDN));\r\n foreach ($trollFQnames as $t_FQ => $trollresolve) {\r\n $trollrescache = $vbulletin->db->query(\"SELECT * from \" . TABLE_PREFIX . \"user_trollresolver WHERE host = \'$trollresolve\'\");\r\n $trollhost = array();\r\n $countcache = -1;\r\n // Can this host be found in the cache?\r\n while ($rescache = $vbulletin->db->fetch_array($trollrescache)) {$trollhost[$countcache++] = $rescache[ip];}\r\n\r\n // If nothing found in cache, start resolve the host\r\n $docache = 0;\r\n if ($countcache < 1) {\r\n $trollhost = gethostbynamel($trollresolve); // Array for full resolving\r\n $docache = 1; // Also remember the host as register-in-cache\r\n }\r\n\r\n // Now start looking up all resolved ips (yes, we support multiple ips under one FQDN)\r\n foreach ($trollhost as $trollip) {\r\n // If we have a match, save it with the userid where it belong\r\n if ($trollremote == $trollip) {$FQDNresolved[$trollresolve] = true;}\r\n // Don\'t forget to cache this host so we don\'t have to resolve it the next time\r\n if ($docache == 1) {\r\n $vbulletin->db->query_write(\"INSERT INTO \" . TABLE_PREFIX . \"user_trollresolver (host, ip, dateline) VALUES (\'$trollresolve\', \'$trollip\', \" . TIMENOW . \")\");\r\n }\r\n }\r\n\r\n }\r\n\r\n // Start fixing with the trolldb...\r\n foreach ($FQDNresolved as $FQDN => $Fvalue) {\r\n // IP ($trollremote), user ($Fvalue), FQDN ($FQDN)\r\n\r\n $realuserFQDN = fetch_userinfo($Fvalue);\r\n $findhost = $vbulletin->db->query_first(\"SELECT * FROM \" . TABLE_PREFIX . \"user_troll WHERE realip = \'$trollremote\' AND username = \'\" . $FQDN . \"\'\");\r\n\r\n // If this host isn\'t registered to the tracker, it\'s time to register (or update) it now, but do not interfere with the regular data (that\'s why we use the fqdn-field here!)\r\n\r\n if (!$findhost[idx]) {\r\n $vbulletin->db->query_write(\"INSERT INTO \" . TABLE_PREFIX . \"user_troll (userid, realip, forwarded_for, username, timestamp, http_via, date, time, opm, fqdn) VALUES (\'$trolluserid\', \'$trollremote\', \'$forwarded\', \'$FQDN\', \'$timestamp\' , \'$via\', \'$trolldate\', \'$trolltime\', \'$trollIsOPM\', \'1\')\");\r\n } else {\r\n $vbulletin->db->query_write(\"UPDATE \" . TABLE_PREFIX . \"user_troll SET timestamp = $timestamp, date = \'$trolldate\', time = \'$trolltime\', opm = \'$trollIsOPM\', imported = 0 WHERE idx = \'\" . $findhost[idx] . \"\' AND deleted = 0 AND fqdn = 1 LIMIT 1\"); }\r\n\r\n }\r\n }\r\n/**** FQDN RESOLVE FINISH ****/\r\n\r\n\r\n\r\n\r\n\r\n/**** STORAGE PREPARE BEGIN ****/\r\n// How to check the database when inserting new entries\r\nif ($followtroll == 1) \r\n {\r\n $trollquery = \"WHERE realip = \'$trollremote\' AND deleted = 0 AND fqdn = 0 ORDER BY timestamp DESC\";\r\n } else {\r\n $trollquery = \"WHERE userid = \'$trolluserid\' AND realip = \'$trollremote\' AND deleted = 0 AND fqdn = 0 ORDER BY timestamp DESC\";\r\n // Switch lookup type, by request\r\n if ($trolluseridlookup == 0) {\r\n $trollquery = \"WHERE username = \'\" . $trollusername . \"\' AND realip = \'$trollremote\' AND deleted = 0 AND fqdn = 0 ORDER BY timestamp DESC\";\r\n }\r\n }\r\n/**** STORAGE PREPARE FINISH ****/\r\n\r\n\r\n\r\n/**** STORAGE DATA COLLECTING BEGIN ****/\r\n$ftroll = $vbulletin->db->query_first(\"SELECT * from \" . TABLE_PREFIX . \"user_troll $trollquery LIMIT 1\");\r\n\r\n$usedtroll = $ftroll[\'realip\'];\r\n$trollid = $ftroll[\'idx\'];\r\n$trolluser = $ftroll[\'userid\'];\r\n\r\n$trollVIA = $ftroll[\'http_via\'];\r\n$trollFOR = $ftroll[\'forwarded_for\'];\r\n\r\nif ($forwarded != $trollFOR OR $via != $trollVIA) {$trollheadermismatch = 1;}\r\n\r\n// If there is any userid found in database, we should check the first nick used by looking up the host and the userlink data\r\nif ($trolluser > 0 AND $trollremote != \'\') {\r\n $firsttroll = $vbulletin->db->query_first(\"SELECT userid,realip,timestamp from \" . TABLE_PREFIX . \"user_troll WHERE userid > 0 AND realip = \'$trollremote\' AND deleted = 0 AND fqdn = 0 ORDER by timestamp DESC, userid ASC LIMIT 1\");\r\n $firsttrollid = $firsttroll[\'userid\'];\r\n\r\n $followlink = $vbulletin->db->query_first(\"SELECT userid,userlink from \" . TABLE_PREFIX . \"user_troll WHERE userid = \'$trolluserid\' AND userlink > 0 AND deleted = 0 AND fqdn = 0 ORDER by userlink ASC LIMIT 1\");\r\n\r\n // Did it? Then replace this id with the first found in db\r\n if ($followlink[\'userlink\'] != $firsttrollid) {$firsttrollid = $followlink[\'userlink\'];}\r\n\r\n // Save data about any user who possibly used this ip first\r\n if ($firsttrollid > 0) {\r\n $vbulletin->db->query_write(\"UPDATE \" . TABLE_PREFIX . \"user_troll SET userlink = \'$firsttrollid\' WHERE idx = \'$trollid\' AND deleted = 0 AND fqdn = 0 LIMIT 1\");\r\n }\r\n}\r\n/**** STORAGE DATA COLLECTING FINISH ****/\r\n\r\n\r\n\r\n/**** SESSION STORAGE BEGIN ****/\r\n// Force updating of the session-table on request (this is stupid!)\r\nif ($trollsession == 1 AND $trollremote != \'\') {\r\n\r\n // Lookup latest used username from specific IP\r\n $lasttroll = $vbulletin->db->query_first(\"SELECT * from \" . TABLE_PREFIX . \"user_troll WHERE userid > 0 AND realip = \'$trollremote\' AND deleted = 0 ORDER BY timestamp DESC LIMIT 1\");\r\n $trolluser = $lasttroll[\'userid\'];\r\n\r\n if ($trolluser) {\r\n $vbulletin->db->query_write(\"UPDATE \" . TABLE_PREFIX . \"session SET userid = \'$trolluser\', lastactivity = $timestamp WHERE host = \'$trollremote\'\");\r\n // If this is true, troller is already found and forced into sessions...\r\n $dosavetroll = 0;\r\n }\r\n\r\n}\r\n/**** SESSION STORAGE FINISH ****/\r\n\r\n\r\n// Do not register not logged in users on request\r\nif ($trollunreg == 0 AND $trolluserid < 1) {$dosavetroll = 0;}\r\n\r\n// Do not save RBL\'s on request\r\nif ($trollignoreopm == 1 AND $trollIsOPM == 1) {$dosavetroll = 0;}\r\n\r\n// Changes in headers?\r\nif ($trollheadermismatch == 1 AND $trolluniqueheaders == 1) {$dosavetroll = 1;}\r\n\r\n\r\n\r\n/**** TROLLDB STORAGE BEGIN ****/\r\nif ($dosavetroll == 1) {\r\n\r\n if (!$usedtroll) {\r\n // If the user wasn\'t found in the database, we will add it...\r\n $vbulletin->db->query_write(\"INSERT INTO \" . TABLE_PREFIX . \"user_troll (userid, realip, forwarded_for, username, timestamp, http_via, date, time, opm) VALUES (\'$trolluserid\', \'$trollremote\', \'$forwarded\', \'\" . $trollusername . \"\', $timestamp, \'$via\', \'$trolldate\', \'$trolltime\', \'$trollIsOPM\')\");\r\n } else {\r\n // Changes will make the database change selected entry to not imported\r\n // If the user was found in the database, we won\'t duplicate it - instead, we\'re updating the latest login\r\n $vbulletin->db->query_write(\"UPDATE \" . TABLE_PREFIX . \"user_troll SET timestamp = $timestamp, date = \'$trolldate\', username = \'\" . $trollusername . \"\', userid = \'$trolluserid\', time = \'$trolltime\', opm = \'$trollIsOPM\', imported = 0 WHERE idx = \'$trollid\' AND deleted = 0 AND fqdn = 0 LIMIT 1\");\r\n }\r\n}\r\n/**** TROLLDB STORAGE FINISH ****/\r\n\r\n\r\n\r\n} // End of enable check... Turns this plugin completely off or on...', 'trolltracker');

MySQL Error : Unknown column 'executionorder' in 'field list'
Error Number : 1054
Date : Tuesday, September 19th 2006 @ 05:42:28 PM

What now?
Reply With Quote
  #60  
Old 09-19-2006, 02:54 PM
TMM-TT's Avatar
TMM-TT TMM-TT is offline
 
Join Date: Jun 2005
Location: Sweden
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry. I exported the hack from vB 3.6 so "executionorder" is an unkown database-field for 3.5. I had the same problem when I forgot to remove that field. Fixed now
Reply With Quote
  #61  
Old 09-19-2006, 03:04 PM
Alfa1's Avatar
Alfa1 Alfa1 is offline
 
Join Date: Dec 2005
Location: Netherlands
Posts: 3,537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Many thanks.

Can you please add a small explanation of the functions. I am confused with this:
When I enter a username, select resolve IP address, the tracker finds an amount of entries, but does not display them.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:05 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.04937 seconds
  • Memory Usage 2,393KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (5)bbcode_html
  • (10)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete