Extension:قائمة سوداء-سبام

From mediawiki.org
This page is a translated version of the page Extension:SpamBlacklist and the translation is 46% complete.
Outdated translations are marked like this.
هذا الامتداد يأتي مع إصدار ميدياويكي 1.21 وما بعده. لذا لن تحتاج لتنزيل هذه السمة مرة أخرى. إلا أنك سوف تحتاج لاتباع التعليمات الأخرى المقدمة.
الدليل المرجعي لامتدادات ميدياويكي
SpamBlacklist
حالة الإصدار مستقر
تنفيذ تصرف خاصة بالصفحة
بيان تُنتج مُرشح سبام يعتمد على regex
المؤلف/المؤلفون Tim Starlingنقاش
آخر إصدار تحديثات مستمرة
سياسة التوافق تصدر اللقطات البرمجية مع ميدياويكي. الإصدار الرئيسي لا يتوافق مع الإصدارات السابقة.
MediaWiki 1.31+
ترخيص رخصة جنو العمومية 2.0 أو ما بعدها
التنزيل
README
  • $wgBlacklistSettings
  • $wgLogSpamBlacklistHits
  • sboverride
  • spamblacklistlog
تنزيلات ربع سنوية 50 (Ranked 99th)
استخدام مواقع الويكي العمومية 4,601 (Ranked 180th)
ترجم الامتداد SpamBlacklist لو كان متوفرا على translatewiki.net
المسائل المهام المفتوحة · الإبلاغ عن عطل تقني
A proposal to rename this extension is discussed at مهمة T254649.

SpamBlacklist يمنع التعديلات التي تحتوي روابط URLs التي يتوافق نطاقها مع أنماط التعبير المحددة في ملفات محددة أو صفحات wiki والتسجيل من قبل المستخدمين باستخدام عناوين بريد إلكتروني محددة.

عندما يحاول شخص ما بحفظ صفحة ما، يتحقق هذا الملحق من النص مع قائمة (من المحتمل أن تكون كبيرة جدًا) بأسماء المضيفات غير السموح بها. إذا وُجد توافق، يقوم الملحق بعرض رسالة خطأ للمستخدم ويرفض حفظ الصفحة.

مساعدة التثبيت

التثبيت

  • نزّل الملف/الملفات وضعها في دليل يحمل اسم ‎SpamBlacklist داخل مجلد ‎extensions/‎ لديك.
    يجب على مطوري البرمجيات والمساهمين بالكود البرمجي تثبيت الامتداد من غت بدلا من ذلك، مستخدمين:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SpamBlacklist
  • أضف الكود التالي في الجزء الأسفل من ملف LocalSettings.php :
    wfLoadExtension( 'SpamBlacklist' );
    
  • قم بإعداد القائمة حسب ما تريد
  • Yes تم التنفيذ – اذهب إلى Special:Version على موقع الويكي لديك كي تتحقق من أن الامتداد قد ثبت بنجاح.

إعداد القائمة السوداء

الصفحات المحلية التالية تُستخدم دائما، مهما كانت المصادر الإضافية المدرجة:

المصدر الإضافي الافتراضي لقائمة الحظر لعناوين URL المحظورة هو قائمة حظر Wikimedia للبريد العشوائي على Meta-Wiki ، في ' m: القائمة السوداء للبريد العشوائي' '. افتراضيًا يقوم المُلحق باستخدام هذه القائمة، ويقوم بإعادة تحميلها كل 10-15 دقيقة. استخدام هذه القائمة كافي لمنع معظم محاولات السبام في عدد كبير من الويكيات. ولكن نظرًا لاستخدام قائمة حظر ويكيميديا من قِبل مجموعة متنوعة من مواقع الويكي الكبيرة مع مئات الآلاف من الروابط الخارجية، فهي متحفظة نسبيًا في الروابط التي تحظرها.

The Wikimedia spam block list can only be edited by administrators; but you can suggest modifications to the block list at m:Talk:Spam blacklist.

You can add other bad URLs on your own wiki. List them in the global variable $wgBlacklistSettings in LocalSettings.php . See examples below.

$wgBlacklistSettings is an two level array. Top level key is spam or email. They take an array with each value containing either a URL, a filename or a database location.

If you use $wgBlacklistSettings in "LocalSettings.php", the default value of "[[m:Spam blacklist]]" will no longer be used - if you want that block list to be accessed, you will have to add it in manually, see examples below.

Specifying a database location allows you to draw the block list from a page on your wiki.

The format of the database location specifier is ">DB: [db name] [title]". [db name] should exactly match the value of $wgDBname in LocalSettings.php .

You should create the required page name [title] in the default namespace of your wiki. If you do this, it is strongly recommended that you protect the page from general editing. Besides the obvious danger that someone may add a regex that matches everything, please note that an attacker with the ability to input arbitrary regular expressions may be able to generate segfaults in the PCRE library.

أمثلة

If you want to, for instance, use the English-language Wikipedia's spam block list in addition to the standard Meta-Wiki one, you could call the following in LocalSettings.php , AFTER wfLoadExtension( 'SpamBlacklist' ); call:

$wgBlacklistSettings = [
	'spam' => [
		'files' => [
			"https://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ver=1",
			"https://en.wikipedia.org/w/index.php?title=MediaWiki:Spam-blacklist&action=raw&sb_ver=1"
		],
	],
];

Here is an example of an entirely local set of block lists: the administrator is using the update script to generate a local file called "wikimedia_blacklist" that holds a copy of the Meta-Wiki blacklist, and has an additional block list on the wiki page "My spam block list":

$wgBlacklistSettings = [
	'spam' => [
		'files' => [
			"$IP/extensions/SpamBlacklist/wikimedia_blacklist", // Wikimedia's list
			// database, title
			'DB: wikidb My_spam_block_list',    
		],
	],
];

Logging

By default, the extension does not log hits to a spam blacklist log. To enable logging set $wgLogSpamBlacklistHits = true;. You can use the spamblacklist user right to control access to the logs. Every signed-in user can view the logs by default.


حالات

Backtrack Limit

If you encounter issues with the block list, you may want to increase the backtrack limit.

However on the other hand, this can reduce your security against DOS [1] attacks, as the backtrack limit is a performance limit:

// Bump the Perl Compatible Regular Expressions backtrack memory limit
// (PHP 5.3.x default, 1000K, is too low for SpamBlacklist)
ini_set( 'pcre.backtrack_limit', '8M' );

Hardened Wikis

The SpamBlacklist will not allow editing if the wiki is hardened. Hardening includes limiting open_basedir so that curl is not on-path, and setting allow_url_fopen=Off in php.ini.

In the hardened case, SpamBlacklist will cause an exception when Guzzle attempts to make a network request. The Guzzle exception message is, GuzzleHttp requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler.

قائمة آمنة

يمكن الاحتفاظ بقائمة آمنة مقابلة عن طريق تحرير MediaWiki:Spam-whitelist page. هذا مفيد إذا كنت ترغب في تجاوز إدخالات معينة من قائمة حظر wiki أخرى تستخدمها على سبيل المثال ، تستخدم مواقع wikimedia أحيانًا قائمة حظر البريد العشوائي لأغراض أخرى غير مكافحة البريد العشوائي.

It is questionable how effective the Wikimedia spam block lists are at keeping spam off of third-party wikis. Some spam might be targeted only at Wikimedia wikis, or only at third-party wikis, which would make Wikimedia's blacklist of little help to said third-party wikis in those cases. Also, some third-party wikis might prefer that users be allowed to cite sources that Wikipedia does not allow. Sometimes what one wiki considers useless spam, another wiki might consider useful.

Users may not always realize that, when a link is rejected as spammy, it does not necessarily mean that the individual wiki they are editing has specifically chosen to ban that URL. Therefore, wiki system administrators may want to edit the Manual:System messages at MediaWiki:Spamprotectiontext and/or MediaWiki:Spamprotectionmatch on your wiki to invite users to make suggestions at MediaWiki talk:Spam-whitelist for pages that should be added by a Manual:Administrators to the safe list. For example, you could put, for MediaWiki:Spamprotectiontext:

The text you wanted to save was blocked by the spam filter. This is probably caused by a link to a blacklisted external site. {{SITENAME}} maintains [[MediaWiki:Spam-blacklist|its own block list]]; however, most blocking is done by means of [[metawikimedia:Spam-blacklist|Meta-Wiki's block list]], so this block should not necessarily be construed as an indication that {{SITENAME}} made a decision to block this particular text (or URL). If you would like this text (or URL) to be added to [[MediaWiki:Spam-whitelist|the local spam safe list]], so that {{SITENAME}} users will not be blocked from adding it to pages, please make a request at [[MediaWiki talk:Spam-whitelist]]. A [[Project:Sysops|sysop]] will then respond on that page with a decision as to whether it should be listed as safe.

ملاحظات

  • سقوم هذا الملحق فقط بفحص الروابط الخارجية الجديدة التي يضيفها محرروا الويكي للتحقق من المستخدم، أضف Akismet نظرًا لأن الأدوات المختلفة لمكافحة السبام على ميدياويكي تستخدم طرقًا مختلفة لاكتشاف الإساءة، فإن من الأفضل استخدام الضمانات مجتمعة.
  • Users with the sboverride can override the block list and add blocked links to pages. By default this right is only given to bots.

الاستخدام

البنية النحوية

إذا أردت إنشاء قائمة حظر خاصة بك، أو تعديل قائمة موجودة، فهذا هو النص:

كل ما في السطر بعد '#' يتم تجاهله (للملاحظات). جميع النصوص الأخرى هي أجزاء من regex تتطابق فقط مع عناوين URL الداخلية.

ملاحظات:

  • لا تقم بإضافة "http://"؛ قد يفشل هذا، نظرًا لأن التعبير العادي سيتطابق مع ما "بعد" "http://" (أو" https://") داخل عناوين URL.
  • كذلك لا حاجة لكتابة "www"، لأن الـ regex يبحث عن تطابق النطاقات subdomains. بكتابة"www\." صراحة، يمكن أن يتطابق مع نطاقات فرعية محددة.

العلامات (؟<=//|\.) و $ تتطابق مع بداية اسم النطاق ونهايته، و"ليس" بداية ونهاية عنوان URL. علامة ^ لا تُستخدم.

  • لا تحتاج إلى تخطي Slashes بالخطوط المائلة للخلف backslashes، سيتم تنفيذ ذلك تلقائيًا بواسطة البرنامج.
  • The spam blacklist functions prior to abuse filters, so blacklisted domains will not show in the entries in abuse filter log (special:abuselog), and will only show in (special:log/spamblacklist).
مثال

السطر التالي سيحظر جميع عناوين URL التي تحتوي على النص "example.com"، باستثناء الحالات التي يسبقها مباشرة أو متبوعة بحرف أو رقم.

\bexample\.com\b

هذه ستُحظر:

  • http://www.example.com
  • http://www.this-example.com
  • http://www.google.de/search?q=example.com

These are not blocked:

  • http://www.goodexample.com
  • http://www.google.de/search?q=example.commodity

الأداء

يُنشئ الملحق عبارة regex واحدة تبدو مثل /https?:\/\/[a-z0-9\-.]*(line 1|line 2|line 3|....)/Si (حيث يتم تخطي جميع الخطوط المائلة slashes داخل السطور تلقائيًا). يقوم بحفظ هذا في ملف "محمل" "loader" صغير لتجنب تحميل جميع التعليمات البرمجية في كل عرض للصفحة. لن يتأثر أداء عرض الصفحة حتى إذا كنت لا تستخدم ذاكرة التخزين المؤقت bytecode على الرغم من أن استخدام ذاكرة التخزين المؤقت يوصى به بشدة لأي تثبيت ميدياويكي.

تضيف مطابقة regex عمومًا مقدارًا ضئيلًا من مقدار حمل الصفحة (في حدود 100 مللي ثانية من واقع تجربتنا). لكن قد يستغرق تحميل ملف السبام من القرص أو قاعدة البيانات وإنشاء regex وقتًا طويلاً اعتمادًا على جهازك. إذا وجدت أن تمكين هذا الملحق يؤدي إلى إبطاء عمليات الحفظ بشكل ملحوظ، فحاول تثبيت ذاكرة تخزين مؤقت supported bytecode cache. يقوم هذا الملحق بتخزين regex المركب مؤقتًا في حالة وجود مثل هذا النظام.

If you're sharing a server and cache with several wikis, you may improve your cache performance by modifying getSharedBlacklists and clearCache in SpamBlacklist_body.php to use $wgSharedUploadDBname (or a specific DB if you do not have a shared upload DB) rather than $wgDBname . Be sure to get all references! The regexes from the separate MediaWiki:Spam-blacklist and MediaWiki:Spam-whitelist pages on each wiki will still be applied.

خوادم قائمة الحظر الخارجية (RBL's)

In its standard form, this extension requires that the block list be constructed manually. While regular expression wildcards are permitted, and a block list originated on one wiki may be re-used by many others, there is still some effort required to add new patterns in response to spam or remove patterns which generate false-positives.

Much of this effort may be reduced by supplementing the spam regex with lists of known domains advertised in spam email. The regex will catch common patterns (like "casino-" or "-viagra") while the external block list server will automatically update with names of specific sites being promoted through spam.

In the filter() function in includes/SpamBlacklist.php, approximately halfway between the file start and end, are the lines:

       # Do the match
       wfDebugLog( 'SpamBlacklist', "Checking text against " . count( $blacklists ) .
           " regexes: " . implode( ', ', $blacklists ) . "\n" );

Directly above this section (which does the actual regex test on the extracted links), one could add additional code to check the external RBL servers [2]:

        # Do RBL checks
        $retVal = false;
        $wgAreBelongToUs = ['l1.apews.org.', 'multi.surbl.org.', 'multi.uribl.com.'];
        foreach( $addedLinks as $link ) {
              $link_url=parse_url($link);
              $link_url=$link_url['host'];
              if ($link_url) {
                   foreach( $wgAreBelongToUs as $base ) {
                        $host = "$link_url.$base";
                        $ipList = gethostbynamel( $host );
                        if( $ipList ) {
                           wfDebug( "RBL match: Hostname $host is {$ipList[0]}, it's spam says $base!\n" );
                           $ip = wfGetIP();
                           wfDebugLog( 'SpamBlacklistHit', "$ip caught submitting spam: {$link_url} per RBL {$base}\n" );
                           $retVal = $link_url . ' (blacklisted by ' . $base .')';
                           wfProfileOut( $fname );
                           return $retVal;
                        }
                   }
              }
        }

        # if no match found on RBL server, continue normally with regex tests...

This ensures that, if an edit contains URLs from already blocked spam domains, an error is returned to the user indicating which link cannot be saved due to its appearance on an external spam block list. If nothing is found, the remaining regex tests are allowed to run normally, so that any manually-specified 'suspicious pattern' in the URL may be identified and blocked.

Note that the RBL servers list just the base domain names - not the full URL path - so http://example.com/casino-viagra-lottery.html will trigger RBL only if "example.com" itself were blocked by name by the external server. The regex, however, would be able to block on any of the text in the URL and path, from "example" to "lottery" and everything in between. Both approaches carry some risk of false-positives - the regex because of the use of wildcard expressions, and the external RBL as these servers are often created for other purposes - such as control of abusive spam email - and may include domains which are not engaged in forum, wiki, blog or guestbook comment spam per se.

أدوات أخرى لمكافحة السبام

هناك العديد من النصوص المفيدة على موقع mediawiki.org حول مكافحة السبام وأعمال التخريب الأخرى:

تشمل الملحقات الأخرى لمكافحة السبام والتخريب ما يلي:

References