Release status: stable
|Implementation||Special page, User identity|
|Description||CheckUser function allows a user with permissions 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.|
|Author(s)||Tim Starling, Aaron Schulz|
Translate the CheckUser extension if possible
|Check usage and version matrix; code metrics|
|Bugs: list open list all report|
- This page is about the extension itself. For the Wikimedia Foundation CheckUser policy, see m:CheckUser policy.
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.
Download[edit | edit source]
You can download the extension directly from the MediaWiki source code repository (browse code). You can get:
- One of the extensions tags
Not all extensions have tags. Some extensions have tags for each release, in which case those tags have the same stability as the release. To download a tag
- Go to the tags list
- Click the name of the tag you want to download
- Click "snapshot"
- The latest version of one of the extensions branches
Each extension has a master branch containing the latest code (might be unstable). Extensions can have further branches as well.
- Go to the branches list
- Click the branch name
- Click "snapshot"
- A snapshot made during the release of a MediaWiki version.
This might be unstable and is not guaranteed to work with the associated MediaWiki version.
After you've got the code, save it into the extensions/CheckUser directory of your wiki.
If you are familiar with git and have shell access to your server, you can obtain the extension, with all its tags and branches, as follows:
cd extensions git clone
Installation[edit | edit source]
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.
On an existing wiki[edit | edit source]
Basic[edit | edit source]
- Download the files (using snapshot, or directly from SVN) to the extensions directory, e.g. put the unzipped CheckUser folder in YourWikiSite/wiki/extensions.
- Using a telnet/ssh client program such as PuTTY, navigate to the extensions/CheckUser folder and run
- If you are running a version of MediaWiki prior to 1.16, AdminSettings.php (in your root MediaWiki directory) will need to have a valid username and password set for access to the database.
require_once ( "$IP/extensions/CheckUser/CheckUser.php" );
Installing without command prompt access[edit | edit source]
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 (naturally /path/to 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 above:
- Download cu_changes.sql and cu_log.sql
- In phpMyAdmin, click the database you're using for mediawiki along the left side
- On the next screen, click the "Import" tab at the top.
- 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.
- Repeat for the second file
On a new wiki[edit | edit source]
Follow step 1 as above, then run the MediaWiki installation. The MediaWiki installer automatically will do installation tasks if you select the checkbox for CheckUser when prompted for which extensions to install.
Configuration[edit | edit source]
This tool migrates recent changes data to a separate
cu_changes table, and adds to that when new entries are added. If $wgPutIPinRC 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 to make recentchanges shorter, without affecting checkuser. Use
$wgCUDMaxAge to set how far back checkuser data can go, in seconds.
In versions for MediaWiki 1.22 and later, the CheckUser-specific setting $wgCheckUserCIDRLimit determines the largest range that can be checked in a single check. Its format is the same as $wgBlockCIDRLimit.
CheckUsers using Mozilla Firefox can add this JS script to their .js file. It makes retrieving IP WHOIS data easier. It requires
applets.codebase.principle support (about:config) enabled. (This can be
signed.applets.codebase_principle_support in Firefox 3)
Granting right to use CheckUser[edit | edit source]
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. To only allow the adding and removing of the checkuser permission, use the following instead:
$wgAddGroups['sysop'] = 'checkuser'; $wgRemoveGroups['sysop'] = 'checkuser';
Usage[edit | edit source]
Basic interface[edit | edit source]
- Go to Special:CheckUser.
- In the user field, type in the username (without the 'user:' prefix), IP address, or CIDR range.
- IP: any IPv4 or IPv6 address.
- CIDR: you can check a range of IP addresses by appending the CIDR prefix (by default, up to /16 for IPv4 (65,536 addresses), up to /64 for IPv6 (~1.8446*1019 addresses) before revision 7352, up to /48 for IPv6 (~1.2089*1024 addresses or 65536 /64s - controlled by $wgCheckUserCIDRLimit in the latest version) after revision 7352). For notation, see Range blocks.
- XFF: you can check a client IP address provided by X-Forwarded-For headers by appending /xff (for example, 127.0.0.1/xff).
- Select the information you want to retrieve.
- Get IPs: returns IP addresses used by a registered user.
- Get edits from IP: returns all edits made by a user (registered or anonymous) from an IP address or range.
- Get users: returns user accounts that have edited from an IP or range.
- 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 in a log visible only to users with the checkuser-log permission.
Information returned[edit | edit source]
A typical entry in the CheckUser results for a user summary ("get users") is as follows:
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:
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[edit | edit source]
XFF (X-Forwarded-For) headers indicate the series of IP addresses used from the user's computer (first) to the last proxy server. In case of Wikimedia, the last proxy server is one of the Wikimedia proxies (listed under $wgSquidServersNoPurge in the Wikimedia configuration file).
In this example:
- 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 (22.214.171.124) is one of the Wikimedia squids (sq36.wikimedia.org).
MediaWiki configuration settings $wgUsePrivateIPs, $wgSquidServers, $wgSquidServersNoPurge and extensions using the IsTrustedProxy hook (such as Extension:TrustedXFF) change the way an actual IP address used to attribute edits is selected.
Error messages[edit | edit source]
- database query syntax error
If you receive an error message like this when you try to save a page:
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "efUpdateCheckUserData". Database returned error "1146: Table 'cu_changes' doesn't exist (localhost)".
This means that CheckUser has not been installed correctly. In this case you forgot to create the necessary
cu_changes table in your database.
API[edit | edit source]
CheckUser also provides an API.
Notes[edit | edit source]
- . Ensure that you are running a PHP version 5.x install, otherwise this script will not run. The result will be something similar to this:
...cu_changes table added. ...doing rc_id from 368856 to 368955.... ... ...cu_changes table added and populated. ...cu_log added ...logging disabled, skipping log import.
|This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page.|
|Language:||English • Deutsch • 日本語 • 한국어 • Nederlands • português do Brasil • русский|