Extension:CheckUser


 * This page is about the extension. For the Wikimedia Foundation checkuser policy, click here.

CheckUser is an extension that allows a user (with the checkuser permission) to check which IPs are used by a given username and which usernames are used by a given IP, without having to run queries directly against the database by hand. The extension is running live on all Wikimedia wikis.

Installation
The extension is released under the GNU General Public License 2.0 or later. The software is provided as-is. Updates will be made according to the needs of Wikimedia wikis; or where critical vulnerabilities are discovered.

Note for users of $wgDBprefix
The SQL scripts that are run during installation assume $wgDBprefix is an empty string. If in LocalSettings.php you have set it to anything other than an empty string, you must modify cu_changes.sql and cu_log.sql to include the prefix. For example, if your prefix is "XYZ_", you need to replace "/*$wgDBprefix*/" in those files with "XYZ_" before running them.

Basic

 * 1) Download the files (using snapshot, or directly from SVN) to the extensions directory, e.g. put the unzipped CheckUser folder in YourWikiSite/wiki/extensions.
 * 2) * If you are using MW 1.5–1.9, you need an older version.
 * 3) * If you are using MW 1.10-1.13, you need a slightly newer version.
 * 4) Using a telnet/ssh client program such as PuTTY, navigate to the extensions/CheckUser folder.
 * 5) Read the $wgDBprefix note above, and if necessary, edit cu_changes.sql</tt> and cu_log.sql</tt>.
 * 6) Run php install.php</tt>
 * 7) *If you are running a version of Mediawiki prior to 1.16, AdminSettings.php</tt> (in your root MediaWiki directory) will need to have a valid username and password set for access to the database.
 * 8) Add   somewhere in LocalSettings.php.

Installing without command prompt access
Many hosting providers don't allow direct shell access, but allow creation of cron jobs (e.g. via cPanel web interface). For those hosting providers a temporary cron job can be used to run php /path/to/install.php</tt> (naturally /path/to</tt> should be replaced with real full path to install.php).

If you are using a remote server and do not have command prompt access (nor cron job solution is suitable for you), but do have access through phpMyAdmin, substitute these steps for step #2–#4 above:


 * 1) Download cu_changes.sql and cu_log.sql
 * 2) Read the $wgDBprefix note above, and if necessary, edit cu_changes.sql</tt> and cu_log.sql</tt>.
 * 3) In phpMyAdmin, click the database you're using for mediawiki along the left side
 * 4) On the next screen, click the "Import" tab at the top.
 * 5) At "Location of the text file", choose one of the files, select compression "None", and click the bottom "Go" button.
 * If your phpMyAdmin screen has only a text field and no text file chooser, click the "SQL" button in the left-side column, under the phpMyAdmin logo, and click the "import files" tab in the new window that opens.
 * 1) Repeat for the second file

Configuration
This tool migrates recent changes data to a separate  table, and adds to that when new entries are added. If $wgPutIPinRC</tt> was previously set to false, there will be no initial data to search but new edits will fill in as soon as the extension is set up.

After you run the queries, you can reduce $wgRCMaxAge</tt> to make recentchanges shorter, without affecting checkuser. Use $wgCUDMaxAge</tt> to set how far back checkuser data can go.

CheckUsers using FireFox can add this JS script to their .js file. It makes retrieving IP WHOIS data easier. It requires  support (about:config) enabled. (This can be  in FireFox 3)

Granting Right to Use Check User
To grant the right to use the Check User function, a user with User rights management must go to Special:UserRights and enter the user's name in the box, then select the option "Check User." Once this is done, the Check User option will show up on the Special pages page for that user. To turn on User Rights Management for sysops, put $wgGroupPermissions['sysop']['userrights'] = true; into LocalSettings.php.

Basic interface

 * 1) Go to Special:CheckUser.
 * 2) In the user field, type in the username (without the 'user:' prefix), IP address, or CIDR range.
 * 3) * IP: any IPv4 or IPv6 address.
 * 4) * CIDR: you can check a range of IP addresses by appending the CIDR prefix (up to /16 for IPv4 or /64 for IPv6, or 65,536 addresses). For notation, see Range blocks.
 * 5) * XFF: you can check a client IP address provided by X-Forwarded-For headers by appending /xff (for example, 127.0.0.1/xff).
 * 6) Select the information you want to retrieve.
 * 7) * Get IPs: returns IP addresses used by a registered user.
 * 8) * Get edits from IP: returns all edits made by a user (registered or anonymous) from an IP address or range.
 * 9) * Get users: returns user accounts that have edited from an IP or range.
 * 10) In the reason field, type in the reason you are accessing the confidential data. Try to succinctly summarise the situation (for example, "cross-wiki spam"); this will be logged.

Information returned
A typical entry in the checkuser results for a user summary ("get users") is as follows:
 * Example (Talk | contribs) (20:11, -- 20:12, ) [5]
 * 127.0.0.37 XFF: 127.0.0.1, 127.0.0.5

This is formatted to fit a lot of information into a format that can very easily be listed and skimmed, but is difficult to read unless you know what the information provided is. The information is laid out as follows:
 * username (user links) (time period when they edited from the given IP or range) [number of edits from the IP or range]
 * IP address edited from XFF: XFF information provided (can be spoofed)

Each IP/XFF combination used to edit is listed, in order of use.

The last ten user agents (browser, operating system, system language, and versions) for each user for edits made in the IP or range are listed afterwards.

XFF Format
XFF (X-Forwarded-For) headers indicate the series of IP addresses used from the user's computer (first) to the server hosting MediaWiki (last).

In this example: aaa.aaa.aaa.aaa       XFF: 10.4.46.42, 127.0.0.1, aaa.aaa.aaa.aaa, 208.80.152.46


 * the first two addresses (10.4.46.42, 127.0.0.1) are private to the originating network and can't be reached directly from the public Internet,
 * the third address (aaa.aaa.aaa.aaa) is the "public face" of the editor, usually a broadband or dialup ISP, a company gateway, (but possibly an anonymizer or a malware-compromised server),
 * the last address (208.80.152.46) is one of the Wikimedia squids (sq36.wikimedia.org).