Jump to content

Extension:QuestyCaptcha

本頁使用了標題或全文手工轉換
From mediawiki.org
This page is a translated version of the page Extension:QuestyCaptcha and the translation is 64% complete.
MediaWiki扩展手册
QuestyCaptcha
发行状态: 稳定版
实现 页面操作
描述 新增一個基於問題的驗證碼。
作者 Emufarmers
MediaWiki 1.45+
skipcaptcha
许可证 GNU General Public License 2.0 or later
下載
前往translatewiki.net翻譯QuestyCaptcha扩展

QuestyCaptcha(原本是一個獨立的插件程式,現已成為)ConfirmEdit 扩展的一部份。 QuestCaptcha並不是使用數學問題(輕而易舉就能破解)或圖片(請參見下方),而是要求使用者回答問題。 網站擁有者在LocalSettings.php中添增問題(及其答案!),擴充功能會從中隨機挑選。

安裝

安裝過程與 ConfirmEdit 的安裝過程大致相同。

  • 下載適用於您版本的快照並解壓縮
  • 在擴充功能資料夾中建立一個名為 ConfirmEdit 的資料夾
  • 將檔案上傳至 extensions/ConfirmEdit/ 資料夾
  • 編輯位於MediaWiki安裝根目錄下的 LocalSettings.php 檔案,並在靠近檔案末端處加入以下幾行:
wfLoadExtensions([ 'ConfirmEdit' ]);
wfLoadExtensions([ 'ConfirmEdit/QuestyCaptcha' ]);
$wgCaptchaClass = 'QuestyCaptcha';
...
  • 您亦可設定 ConfirmEdit 的觸發條件及其他選項;若驗證碼未顯示,請在程式碼後方加入以下內容。 若執行如編輯頁面或建立頁面等指定的操作,驗證碼機制將被觸發。 您可以使用設定值 truefalse 來啟用或停用特定操作的驗證碼功能。 Requiring a Captcha to create a page does not show the Captcha when indirectly creating pages, for example when moving pages or uploading files.
$wgMainCacheType    = CACHE_ANYTHING;
$wgCaptchaTriggers['edit']          = true;
$wgCaptchaTriggers['create']        = true;
$wgCaptchaTriggers['addurl']        = true;
$wgCaptchaTriggers['createaccount'] = true;
$wgCaptchaTriggers['badlogin']      = true;

此提示來自此頁面

弱點

基於圖像的驗證碼存在若干漏洞。 採用光學字元辨識(OCR)技術的機器人就能破解這些密碼,而唯一的防禦方式是讓圖像對人類和電腦都更難辨讀。 然而,OCR演算法正不斷獲得改進,電腦終將比人類更擅長破解驗證碼。 與此同時,垃圾郵件發送者可以付錢給發展中國家的勞工來破解驗證碼,或是誘騙一般的網路使用者去破解驗證碼。 基於數學的驗證碼更是輕而易舉被自動化的垃圾郵件機器人破解,原因不言而喻。

基於問題的驗證碼(CAPTCHA)不會受到OCR的漏洞影響。 人類仍然是可受雇去解決此類問題,但問題本身可能具有情境敏感性:若有人詢問MediaWiki採用哪種植物作為標誌,除非身處mediawiki.org網站,否則答案絕非顯而易見。

With the advent of large language models capable of answering most common questions, the effectiveness of question-based CAPTCHAs is decreasing. Any question for which the answer is well known or easily discovered with a web search can be trivially solved by LLMs. For now, question-based captchas are still effective; however, sophisticated spammers are increasingly leveraging LLMs.

若您的維基包含爭議性內容、或可能成為他人敵意的目標,QuestCaptcha 可能並非最適合您的驗證碼方案。因為破壞者能輕鬆破解所有驗證碼,並將其載入至破壞機器人中。 QuestyCaptcha並非為抵禦蓄意破壞者而設計。

另一方面,由於任何特定網站使用的問題資料庫規模較小,人類要回答該網站的所有問題並儲存答案,是相當容易的。 即使是攻擊大量網站的攻擊者,他們每攻擊一個網站也只需執行少量手動操作;此外,垃圾郵件發送者亦可能從各類網站抓取問答內容,供其用於破解驗證碼。 從這個角度來看,它不如其他為每位使用者生成獨特拼圖的驗證碼系統。 然而實際上,若您經營的是小型且不受歡迎的網站,垃圾郵件發送者通常不會費心破解您的QuestyCaptcha驗證碼。

在選擇問題時,避免文化偏見至關重要。 例如,一檔在美國廣受歡迎的電視節目,巴西的編輯者可能並不熟悉;反之,美國人也很難知道澳大利亞的總理是誰。 請專注於那些基於普遍知識或與維基主題相關的知識所提出的問題。

您或許希望與維基的用戶共同協作來構思問題及答案。 若您在維基上進行此操作,事後可能需要刪除包含問答內容的頁面,或至少將該部分內容清空,以免攻擊者透過谷歌搜尋或在您的維基上使用 Special:Search 指令來查找問題。 請注意,基於模板的混淆技術雖能防範透過搜尋引擎進行的檢索,卻無法抵禦Special:Search功能——該功能會直接檢索原始維基文本內容。

問答的設定

答案不區分大小寫,您可將多個答案放入陣列中,為單一問題提供多種選項。所有答案必須以小寫形式書寫:

$wgCaptchaQuestions = [
    "What is one color on this web page?" => [ 'red', 'green', 'blue', 'white', 'black' ],
];

CSS

The QuestyCaptcha question is easy to overlook on the Special:CreateAccount page. Newcomers can easily fail the question because they don't notice it. The question text and background are the same as the adjacent text and background and easy to overlook.

If the maintainers could fix that, so that on the Create Account special page the question stands out in bold green text with an outline or something, that would help.

You can use your wiki's MediaWiki:Common.css to style the QuestyCaptcha question so that it stands out visually.

First you will need to set Make $wgAllowSiteCSSOnRestrictedPages to true, because Common.css is disabled for the Create Account page by default for security. To enable it add this to LocalSettings:

$wgAllowSiteCSSOnRestrictedPages = true; //default is false

$wgUseSiteCss will also need to be true, which is already the default unless you have changed it:

$wgUseSiteCss = true; //default is true

This CSS (tested in MediaWiki 1.31.1) in Common.css makes the QuestyCaptcha question on the Create Account page red, which is hard to overlook:

/* ConfirmEdit QuestyCaptcha -- on Create Account */
.htmlform-tip + .mw-htmlform-field-HTMLInfoField { color:red; }

This CSS makes the question on the Edit page, such as on add URL, green bold bigger and italic:

/* ConfirmEdit QuestyCaptcha -- on Edit page + add a URL */
label[for=wpCaptchaWord] {
    color:green;
    font-weight:bold;
    font-size:150%;
    font-style:italic;
}