Extensão:CheckUser

From mediawiki.org
This page is a translated version of the page Extension:CheckUser and the translation is 34% complete.
Outdated translations are marked like this.
Manual de extensões do MediaWiki
CheckUser
Estado da versão: estável
Implementação Página especial , Identidade de usuário , API , Hook , Banco de dados
Descrição CheckUser permite que um usuário com permissões para verificar quais IPs são utilizados por um determinado nome de usuário e que nomes de usuários são utilizados por um determinado IP, sem ter que executar consultas diretamente no banco de dados à mão.
Autor(es) Tim Starling, Aaron Schulz, Dreamy Jazz
Última versão 2.5 (continuous updates)
Política de
compatibilidade
Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.35+
PHP 7.4.3+
Modifica o banco
de dados
Sim
Tabelas cu_changes
cu_log_event
cu_private_event
cu_log
cu_useragent_clienthints
cu_useragent_clienthints_map
Licença GNU GPL (Licença Pública Geral) 2.0 ou superior
Download
  • $wgCheckUserGBtoollink
  • $wgCheckUserClientHintsSpecialPages
  • $wgCheckUserCAMultiLock
  • $wgCheckUserLogSuccessfulBotLogins
  • $wgCheckUserLogLogins
  • $wgCUPublicKey
  • $wgCheckUserCAtoollink
  • $wgCheckUserClientHintsRestApiMaxTimeLag
  • $wgCheckUserDeveloperMode
  • $wgCheckUserClientHintsForDisplay
  • $wgCUDMaxAge
  • $wgCheckUserCIDRLimit
  • $wgCheckUserMaxBlocks
  • $wgCheckUserPurgeOldClientHintsData
  • $wgCheckUserDisplayClientHints
  • $wgCheckUserClientHintsUnsetHeaderWhenPossible
  • $wgCheckUserForceSummary
  • $wgCheckUserEnableSpecialInvestigate
  • $wgCheckUserLogAdditionalRights
  • $wgCheckUserCollapseCheckUserHelperByDefault
  • $wgCheckUserClientHintsValuesToHide
  • $wgCheckUserClientHintsEnabled
  • $wgCheckUserMaximumRowCount
  • $wgCheckUserInvestigateMaximumRowCount
  • $wgCheckUserTemporaryAccountMaxAge
  • $wgCheckUserEventTablesMigrationStage
  • $wgCheckUserClientHintsHeaders

  • checkuser
  • checkuser-log
  • checkuser-temporary-account
  • investigate
Quarterly downloads 253 (Ranked 29th)
Public wikis using 9,118 (Ranked 13th)
Para traduzir a extensão CheckUser, verifique sua disponibilidade no translatewiki.net
Problemas Tarefas em aberto · Relatar um bug
Esta página é sobre a própria extensão. Para a política de Wikimedia Foundation CheckUser, veja m:Política de CheckUser.

CheckUser é uma extensão que permite que um usuário (com a permissão de checkuser) verifique quais IPs são utilizados por um determinado usuário e que usuários são usados ​​por um determinado IP, sem ter que executar consultas diretamente no banco de dados. Esta extensão está presente em todas as wikis Wikimedia.

As atualizações serão feitas de acordo com as necessidades das wikis Wikimedia, ou quando vulnerabilidades críticas são descobertas.

Instalação

  • Baixe e coloque o(s) arquivo(s) num diretório chamado CheckUser na sua pasta extensions/.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CheckUser
  • Se estiver instalando a partir do git, execute o Composer para instalar as dependências PHP através de composer install --no-dev no diretório da extensão. (Veja tarefa T173141 para possíveis complicações.)
  • Adicione o seguinte código ao final do seu arquivo LocalSettings.php :
    wfLoadExtension( 'CheckUser' );
    
  • Execute o script de atualização que criará automaticamente as tabelas de banco de dados necessárias a essa extensão.
  • Configure as required.
  • Yes Concluído – Navegue à página Special:Version em sua wiki para verificar se a instalação da extensão foi bem sucedida.

Using MediaWiki-Docker

Follow the steps in MediaWiki-Docker/Extension/CheckUser to install this extension inside a MediaWiki Docker instance.

Configuração

Esta ferramenta migra dados das mudanças recentes para uma tabela $changes separada e adiciona-se a isso quando novas entradas são adicionadas. Se $wgPutIPinRC foi previamente definido como false, não haverá dados iniciais para pesquisa, mas as novas edições serão preenchidas assim que a extensão for configurada. However, entries added after installation of this extension will contain the IP address.

Depois de executar as consultas, você pode reduzir $wgRCMaxAge para tornar as mudanças recentes mais curtas, sem afetar o checkuser. Use $wgCUDMaxAge para definir uma distância com os dados disponíveis para o checkuser podem ser exibidos, em segundos.

Nas versões do MediaWiki 1.22 e posteriores, a configuração específica do CheckUser $wgCheckUserCIDRLimit determina o maior intervalo que pode ser verificado em uma única verificação. Seu formato é o mesmo que $wgBlockCIDRLimit . Caso contrário, o limite padrão (para todas as versões) é /32 para seleções IPv6 e /16 para seleções IPv4.

To allow this tool to log successful and failed login attempts as well as logouts, set $wgCheckUserLogLogins to true. If you have bot accounts on your wiki, setting $wgCheckUserLogSuccessfulBotLogins to false will skip logging successful login attempts to bot accounts.

Concedendo o direito de usar CheckUser

Para conceder o direito de usar a função CheckUser, um usuário capaz de gerenciar privilégios de usuário deve ir para Special:UserRights e digitar o nome do usuário na caixa e, em seguida, selecionar a opção "Check User". Uma vez feito isso, a opção Verificar Usuário aparecerá na página Special:SpecialPages para esse usuário.

To allow users to access the IP addresses of temporary accounts, they should be granted the checkuser-temporary-account right.

Para ativar o gerenciamento de direitos do usuário para administradores, coloque o seguinte em LocalSettings.php:

$wgGroupPermissions['sysop']['checkuser'] = true;
$wgGroupPermissions['sysop']['checkuser-log'] = true;
$wgGroupPermissions['sysop']['investigate'] = true;
$wgGroupPermissions['sysop']['checkuser-temporary-account'] = true;

Para permitir apenas a adição e remoção da permissão de checkuser ao usuário, use o seguinte em vez disso:

$wgAddGroups['sysop'][] = 'checkuser';
$wgRemoveGroups['sysop'][] = 'checkuser';

Configuração

Opções de configuração em extension.json
Parâmetros Padrão comentário
$wgCUDMaxAge 7776000 Quanto tempo para manter os dados CU (em segundos)? (padrão = 3 meses)
$wgCheckUserMaxBlocks 200 Limite máximo de um bloqueio
$wgCheckUserForceSummary false Configure isso como 'true' se você quiser forçar os checkusers a dar um motivo para cada verificação que eles fizerem através de Special:CheckUser. (não é muito útil, uma vez que os checkusers poderiam simplesmente dar um resumo como "eles precisam ser verificados" ou "Eu sinto que é necessário" e o software não saberia)
$wgCheckUserCIDRLimit [ 'IPv4' => 16, 'IPv6' => 19 ] Limite CIDR mais curto em que podem se verificar em qualquer verificação de intervalo individual.
$wgCUPublicKey '' Chave pública para criptografar dados privados que podem ser lidos posteriormente. Gera uma chave pública com algo como:

openssl genrsa -out cu.key 2048; openssl rsa -in cu.key -pubout > cu.pub e colar o conteúdo do cu.pub aqui

Used with an associated private key to encrypt certain data that is not shown to CUs but stored in the cu_changes or cu_private_event table. Currently this is only the recipients of emails. Without a valid public key the data will not be stored.

$wgCheckUserCAMultiLock false This can be used to add a link to Special:MultiLock by CentralAuth to the Special:CheckUser's mass block form. This requires the Extensão:CentralAuth extension to be installed on the wiki. To enable this, set this to an array with a central wiki's database name and an array with the name(s) of the global group(s) to add the link for. For example:
$wgCheckUserCAMultiLock = [
    'centralDB' => 'metawiki',
    'groups' => [ 'steward' ]
];
$wgCheckUserCAtoollink false Since 77360f1cf1d2. This adds a link to central wiki Special:CentralAuth to the Special:CheckUser's "Get users" results. This requires the Extensão:CentralAuth extension to be installed on the wiki. To enable this, set this with a central wiki's database name. For example:
$wgCheckUserCAtoollink = 'metawiki';
$wgCheckUserGBtoollink false Since 77360f1cf1d2. This adds a link to local or central wiki Special:GlobalBlock to the Special:CheckUser's "Get users" results. This requires the GlobalBlocking extension to be installed on the wiki. To enable this, if a $wgConf is configured, set this to an array with a central wiki's database name and an array with the name(s) of the local (or global if you have Extensão:CentralAuth installed) group(s) to add the link for. For example:
$wgCheckUserGBtoollink = [
	'centralDB' => 'metawiki',
	'groups' => [ 'steward', 'staff' ]
];
$wgCheckUserEnableSpecialInvestigate false (<=1.39)
true (1.40+)
Since 57dcfe46d2e4. This enables Special:Investigate, an updated version of Special:CheckUser that allows checking for multiple user accounts and IP addresses within one investigation.
$wgCheckUserLogLogins false Whether CheckUser should log login and logout attempts (both successful and not).
$wgCheckUserLogSuccessfulBotLogins true Whether CheckUser should store successful login attempts to accounts with the bot user group if $wgCheckUserLogLogins is set to true. Only is used if $wgCheckUserLogLogins is true
$wgCheckUserMaximumRowCount 5000 The maximum number of results that can be returned by Special:CheckUser. Before MediaWiki 1.39, in the 'Get edits' and 'Get IPs' results having over 5 000 results would return the results in a different format. From MediaWiki 1.39 this is the maximum number of results to show by page and more can be generated using the paging links
$wgCheckUserInvestigateMaximumRowCount 25000 Similar to $wgCheckUserMaximumRowCount, but for Investigate
$wgCheckUserTemporaryAccountMaxAge (1.40+) 86400 The number of seconds for which the temporary account API response is fresh.
$wgCheckUserEventTablesMigrationStage (1.40+) 3 Used to control the migration stage of log events stored in cu_changes to the new cu_log_event and cu_private_event tables. Is temporary and will be removed once migration is complete.
$wgCheckUserClientHintsEnabled (1.41+) true Used to control whether client hints should be collected and displayed in results by CheckUser.
$wgCheckUserClientHintsSpecialPages (1.41+) [ "CreateAccount", "Emailuser", "PasswordReset", "Userlogin", "Userlogout" ] The list of SpecialPages where CheckUser will request client hints if $wgCheckUserClientHintsEnabled is true.
$wgCheckUserClientHintsActionQueryParameter (1.41+) [ "history" ] The list of "action" values in the query parameters where client hints will be requested.
$wgCheckUserClientHintsHeaders (1.41+) { "Sec-CH-UA": "", "Sec-CH-UA-Arch": "architecture", "Sec-CH-UA-Bitness": "bitness", "": "brands", "Sec-CH-UA-Form-Factor": "", "Sec-CH-UA-Full-Version-List": "fullVersionList", "Sec-CH-UA-Mobile": "mobile", "Sec-CH-UA-Model": "model", "Sec-CH-UA-Platform": "platform", "Sec-CH-UA-Platform-Version": "platformVersion", "Sec-CH-UA-WoW64": ""} The list of client hint types that will be requested. Keys represent the client hint values requested using the Accept-CH header. Values represent the equivalent name when requesting them from the JS client side client hints API.
$wgCheckUserClientHintsUnsetHeaderWhenPossible (1.41+) true If true, the server will send an empty Accept-CH header when the user is viewing a page which does not need client hints data.


Special:CheckUser usage

Interface básica

  1. Vá para Special:CheckUser.
  2. No campo "usuário", digite o nome de um usuário (sem o prefixo User:), um endereço IP ou um intervalo CIDR.
    • IP: qualquer endereço IPv4 ou IPv6.
    • CIDR: you can check a range of IP addresses by appending the CIDR prefix. The CIDR prefix value for IPv4 can be between 16-32 and the value for IPv6 can be between 19-128. The smaller number for both ranges can be changed using the configuration variable $wgCheckUserCIDRLimit. Para a notação, veja Help:Bloqueios de intervalos .
    • XFF: você pode verificar um endereço de cliente fornecido por X-Forwarded-For adicionando /xff (por exemplo, 127.0.0.1/xff).
  3. Selecione a informação que deseja recuperar.
    • Obter IPs - #* Obter IPs: retorna endereços IP usados ​​por um usuário registrado.
    • ⧼checkuser-edits⧽ - #* Obter edições de IP: retorna todas as edições feitas por um usuário (registrado ou anônimo) de um endereço IP ou intervalo.
    • Mostrar usuários - #* Obter usuários: retorna contas de usuários que foram editadas de um IP ou intervalo.
  1. No campo motivo, digite o motivo pelo qual você está acessando os dados confidenciais.

Tente resumir sucintamente a situação (por exemplo, "spam cross-wiki"); isso será logado em um registro visível apenas para usuários com a permissão checkuser-log.


Informações exibidas

Uma entrada típica nos resultados das verificações para um resumo de usuário ("get users") é a seguinte:


  1. Example user agent

Isso é formatado para se adequar a uma grande quantidade de informações em um formato que pode ser facilmente listado e compreendido, mas é difícil de ler, a menos que você saiba qual é a informação fornecida. A informação é apresentada da seguinte forma:

  • Nome de usuário (Links de usuários) (Período de tempo em que os usuários editaram a partir do IP ou intervalo fornecido) [Número de edições do IP ou intervalo]
    1. O Endereço de IP editou de XFF: Informações XFF fornecidas (podem ser falsificadas)

Cada combinação de IP/XFF usada para editar está listada, em ordem de uso.

Os últimos dez agentes de usuário (navegador, sistema operacional, linguagem do sistema e versões) de cada edição feitas no IP ou no intervalo são listados posteriormente.

Formato XFF

Os cabeçalhos XFF (X-Forwarded-For) indicam a série de endereços IP usados do computador do usuário (primeiro) até o último servidor proxy. No caso da Wikimedia, o último servidor proxy é um dos proxies da Wikimedia (listado em $wgCdnServersNoPurge no arquivo de configuração da Wikimedia).

Exemplo:

aaa.aaa.aaa.aaa XFF: 10.4.46.42, 127.0.0.1, aaa.aaa.aaa.aaa, 208.80.152.46

  • Os dois primeiros endereços (10.4.46.42, 127.0.0.1) são privados para a rede de origem e não podem ser alcançados diretamente pela Internet pública,
  • O terceiro endereço (aaa.aaa.aaa.aaa) é o "rosto público" do editor, geralmente um ISP de banda larga ou dial-up, um gateway da empresa, (mas possivelmente um anonimizador ou um servidor comprometido com malware)
  • O último endereço (208.80.152.46) é uma das squids da Wikimedia (sq36.wikimedia.org).

Opções de configuração do MediaWiki $wgUsePrivateIPs , $wgCdnServers , $wgCdnServersNoPurge e usando extensões. O hook IsTrustedProxy (com a Extension:TrustedXFF ) altera a forma em que um endereço IP real usado para atribuir edições está selecionado.

Personal tool links

When you get results from Special:CheckUser you can add personal user tool links via the following interface messages:

  • MediaWiki:checkuser-toollinks for IPs in the 'Get IP Addresses' check type (for example m:MediaWiki:checkuser-toollinks)
  • MediaWiki:Checkuser-cidr-tool-links for IP ranges produced by the CIDR calculator present at the bottom of all Special:CheckUser pages. Interface message added in 1.41.


Special:Investigate usage

Basic usage

  1. Vá para Special:Investigate.
  2. In the Nomes de usuário e endereços IP field, type in up to 10 targets, which may be usernames (without the User: prefix), IP addresses, or CIDR ranges.
  3. In the Motivo field, enter the reason you are accessing the confidential data, as described in the Special:CheckUser instructions above; this will be logged in a log visible only to users with the checkuser-log permission.

For advanced feature usage, see Help:Special Investigate.

Customizing tool links

As with Special:CheckUser, links to external tools can be customized.

The links are defined in the checkuser-investigate-compare-toollinks message. This message is parsed to find links, which are added to the menu in the IPs e agentes do usuário tab.


Showing IPs for temporary accounts

Versão MediaWiki:
1.40

The CheckUser extension will show since MediaWiki 1.40 a button that is displayed next to temporary account user links which allows the revealing of their IP address.

This functionality is available exclusively to users with the checkuser-temporary-account privilege, granting them the ability to view the IP addresses that are linked to temporary accounts. To access this information, the Enable revealing IP addresses for temporary accounts feature must be enabled on the user's Special:Preferences page.

These buttons will appear wherever user links are shown for a temporary account, such as when viewing page histories or in Special:Contributions. However, these will not be shown on Special:CheckUser, Special:Investigate or Special:InvestigateBlock.

API

CheckUser and CheckUserLog API

CheckUser também fornece um API. These two APIs work fairly similarly to the special pages, but the reason for a check using the checkuser API is prefixed with "API:" to indicate they were made using the API. Example usages of these APIs are shown below.

CheckUser API
api.php?action=query&list=checkuser&curequest=userips&cutarget=Jimbo_Wales
api.php?action=query&list=checkuser&curequest=edits&cutarget=127.0.0.1/16&xff=1&cureason=Some_check
CheckUserLog API
api.php?action=query&list=checkuserlog&culuser=WikiSysop&cullimit=25
api.php?action=query&list=checkuserlog&cultarget=127.0.0.1&culfrom=20111015230000

Temporary Account Reveal API

Versão MediaWiki:
1.40

Usage

The TemporaryAccountHandler class offers API endpoints for retrieving the IP addresses associated with temporary user accounts. To access this information, the Enable revealing IP addresses for temporary accounts feature must be enabled on the user's Special:Preferences page.

API endpoint

GET /rest.php/checkuser/v0/temporaryaccount/{name} where {name} is the user name you want to look up

Response

If the request is successful, the API will respond with a JSON object containing the following fields:

Name Type Description
ips string[] IPs of the given temporary account

If the request fails, the API will respond with an appropriate error code and message.

Example request

GET /rest.php/checkuser/v0/temporaryaccount/*Unregistered%202

Example response

{"ips": [ "114.127.69.62" , "212.47.235.82" , "212.47.235.81" ]}

TemporaryAccountRevisionHandler

The TemporaryAccountRevisionHandler class offers API endpoints for viewing the IP associated with a revision for temporary accounts. You can specify one or multiple revision IDs in the query string.

API endpoint

GET /rest.php/checkuser/v0/temporaryaccount/*Unregistered%203/revisions/{revisionId} where {revisionId} is the revision ID(s) you want to look up separated by the | character.

Response

If the request is successful, the API will respond with a JSON object containing the following fields:

Name Type Description
ips dictionary The revision ID as the key and the associated IP address as the value.

If the request fails, the API will respond with an appropriate error code and message.

Example request

GET /rest.php/checkuser/v0/temporaryaccount/*Unregistered%203/revisions/31

Example response

{"ips":{"31":"40.175.36.227"}}

Example request with multiple revisions

GET /w/rest.php/checkuser/v0/temporaryaccount/*Unregistered%205/revisions/194|193

Example response

{"ips":{"194":"40.175.36.227","193":"1.2.3.4"}}