2017 © Pedro Peláez
 

library referrer-spam-blacklist

Community-contributed list of referrer spammers

image

piwik/referrer-spam-blacklist

Community-contributed list of referrer spammers

  • Wednesday, December 13, 2017
  • by piwik
  • Repository
  • 68 Watchers
  • 402 Stars
  • 208,592 Installations
  • 5 Dependents
  • 1 Suggesters
  • 208 Forks
  • 7 Open issues
  • 34 Versions
  • 3 % Grown

The README.md

This is a community-contributed list of referrer spammers maintained by Matomo, the leading open source web analytics platform., (*1)

Usage

The list is stored in this repository in spammers.txt. This text file contains one host per line., (*2)

You can download this file manually, download the whole folder as zip or clone the repository using git:, (*3)

git clone https://github.com/matomo-org/referrer-spam-list.git

PHP

If you are using PHP, you can also install the list through Composer:, (*4)

composer require matomo/referrer-spam-blacklist

Parsing the file should be pretty easy using your favorite language. Beware that the file can contain empty lines., (*5)

Here is an example using PHP:, (*6)

$list = file('spammers.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);

Nginx

Nginx's server block can be configured to check the referer and return an error:, (*7)

if ($http_referer ~ '0n-line.tv') {return 403;}
if ($http_referer ~ '100dollars-seo.com') {return 403;}
...

When combined, list exceeds the max length for a single regex expression, so hosts must be broken up as shown above., (*8)

Here is a bash script to create an nginx conf file:, (*9)

sort spammers.txt | uniq | sed 's/\./\\\\./g' | while read host; 
do 
    echo "if (\$http_referer ~ '$host') {return 403;}" >> /etc/nginx/referer_spam.conf
done;

you would then include /etc/nginx/referer_spam.conf; inside your server block, (*10)

Now as a daily cron job so the list stays up to date:, (*11)

0 0 * * * cd /etc/nginx/referrer-spam-blacklist/ && git pull > /dev/null && echo "" > /etc/nginx/referer_spam.conf && sort spammers.txt | uniq | sed 's/\./\\\\\\\\./g' | while read host; do echo "if (\$http_referer ~ '$host') {return 403;}" >> /etc/nginx/referer_spam.conf; done; service nginx reload > /dev/null

In Matomo (formerly Piwik)

This list is included in each Matomo release so that referrer spam is filtered automatically. Matomo will also automatically update this list to its latest version every week., (*12)

Contributing

To add a new referrer spammer to the list, click here to edit the spammers.txt file and select Create a new branch for this commit and start a pull request.. In your pull request please explain where the referrer domain appeared and why you think it is a spammer. Please open one pull request per new domain., (*13)

If you open a pull request, it is appreciated if you keep one hostname per line, keep the list ordered alphabetically, and use Linux line endings., (*14)

Please search if somebody already reported the host before opening a new one., (*15)

Subdomains

Matomo does sub-string matching on domain names from this list, so adding semalt.com is enough to block all subdomain referrers too, such as semalt.semalt.com., (*16)

However, there are cases where you'd only want to add a subdomain but not the root domain. For example, add referrerspammer.tumblr.com but not tumblr.com, otherwise all *.tumblr.com sites would be affected., (*17)

Sorting

To keep the list sorted the same way across forks it is recommended to let the computer do the sorting. The list follows the merge sort algorithm as implemented in sort. You can use sort to both sort the list and filter out doubles:, (*18)

sort -uf -o spammers.txt spammers.txt

Community Projects

Apache .htaccess referrer spam blacklist - A script for Apache users that generates a list of RewriteConds based on spammers.txt., (*19)

Disclaimer

This list of Referrer spammers is contributed by the community and is provided as is. Use at your own discretion: it may be incomplete (although we aim to keep it up to date) and it may contain outdated entries (let us know if a hostname was added but is not actually a spammer)., (*20)

License

Public Domain (no copyright)., (*21)

The Versions

13/12 2017

dev-master

9999999-dev

Community-contributed list of referrer spammers

  Sources   Download

public domain

14/11 2017

dev-spmedia-patch-17

dev-spmedia-patch-17

Community-contributed list of referrer spammers

  Sources   Download

public domain

06/10 2017

dev-spmedia-patch-16

dev-spmedia-patch-16

Community-contributed list of referrer spammers

  Sources   Download

public domain

06/10 2017

dev-spmedia-patch-15

dev-spmedia-patch-15

Community-contributed list of referrer spammers

  Sources   Download

public domain

27/09 2017

dev-spmedia-patch-14

dev-spmedia-patch-14

Community-contributed list of referrer spammers

  Sources   Download

public domain

22/09 2017

dev-spmedia-patch-13

dev-spmedia-patch-13

Community-contributed list of referrer spammers

  Sources   Download

public domain

14/09 2017

dev-spmedia-patch-12

dev-spmedia-patch-12

Community-contributed list of referrer spammers

  Sources   Download

public domain

14/09 2017

dev-spmedia-patch-11

dev-spmedia-patch-11

Community-contributed list of referrer spammers

  Sources   Download

public domain

14/09 2017

dev-spmedia-patch-10

dev-spmedia-patch-10

Community-contributed list of referrer spammers

  Sources   Download

public domain

23/08 2017

dev-spmedia-patch-9

dev-spmedia-patch-9

Community-contributed list of referrer spammers

  Sources   Download

public domain

23/08 2017

dev-spmedia-patch-8

dev-spmedia-patch-8

Community-contributed list of referrer spammers

  Sources   Download

public domain

16/08 2017

dev-spmedia-patch-7

dev-spmedia-patch-7

Community-contributed list of referrer spammers

  Sources   Download

public domain

03/08 2017

dev-spmedia-patch-6

dev-spmedia-patch-6

Community-contributed list of referrer spammers

  Sources   Download

public domain

12/07 2017

dev-spmedia-patch-5

dev-spmedia-patch-5

Community-contributed list of referrer spammers

  Sources   Download

public domain

11/07 2017

dev-spmedia-patch-4

dev-spmedia-patch-4

Community-contributed list of referrer spammers

  Sources   Download

public domain

09/05 2017

dev-spmedia-patch-3

dev-spmedia-patch-3

Community-contributed list of referrer spammers

  Sources   Download

public domain

09/05 2017

dev-spmedia-patch-2

dev-spmedia-patch-2

Community-contributed list of referrer spammers

  Sources   Download

public domain

11/04 2017

dev-spmedia-patch-1

dev-spmedia-patch-1

Community-contributed list of referrer spammers

  Sources   Download

public domain

28/03 2017

1.0.13

1.0.13.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

27/02 2017

1.0.12

1.0.12.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

03/01 2017

1.0.11

1.0.11.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

28/09 2016

1.0.10

1.0.10.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

20/07 2016

1.0.9

1.0.9.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

22/03 2016

1.0.8

1.0.8.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

05/01 2016

1.0.7

1.0.7.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

07/10 2015

1.0.6

1.0.6.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

10/09 2015

dev-alpha9.com

dev-alpha9.com

Community-contributed list of referrer spammers

  Sources   Download

public domain

24/08 2015

dev-pops.foundation

dev-pops.foundation

Community-contributed list of referrer spammers

  Sources   Download

public domain

06/07 2015

1.0.5

1.0.5.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

25/06 2015

1.0.4

1.0.4.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

06/05 2015

1.0.3

1.0.3.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

23/04 2015

1.0.2

1.0.2.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

20/04 2015

1.0.1

1.0.1.0

Community-contributed list of referrer spammers

  Sources   Download

public domain

20/04 2015

1.0.0

1.0.0.0

Community-contributed list of referrer spammers

  Sources   Download

public domain