Advice Request Need guidance and advice from those knowledgeable about ad blocking

Please provide comments and solutions that are helpful to the author of this topic.

rashmi

Level 10
Thread author
Jan 15, 2024
496
I've been experimenting with Cloudflare Gateway's free plan for some time now (Serious Discussion - Cloudflare Gateway Free Plan). There are no ad-blocking categories or features available. I came across a blog post on blocking ads with Cloudflare Gateway at (Block Ads With Cloudflare Zero Trust). I implemented the REGEX policy mentioned in the blog, and it effectively blocked ads.

This is the REGEX policy or example mentioned in the blog. (Instead of traditional REGEX, Cloudflare Gateway uses Rust to evaluate expressions.)
Code:
(advert|adserv|adsystem|doubleclick|2mdn|truecaller|uberads|206ads|360in|360yield|3lift|a2z|aarki|ad2iction|adcolony|addthis|adform|adhaven|adlooxtracking|admicro|adnxs|adpushup|adroll|adsafeprotected|adsbynimbus|adspruce|adsrvr|adswizz|adtelligent|adventori|adzerk|aerserv|amplitude|aniview|anzuinfra|apester|aralego|atdmt|atwola|bannersnack|batmobi|bluecava|blueconic|carambo|casalemediacriteo|crittercismriteo|crittercism|revcontent|ijinshan|imrworldwide|inmobi|marketo|moatads|moatpixel|mookie|perfectaudience|permutive|pubmatic|pushwoosh|rayjump|revcontent|revjet|rfihub|richrelevance|rqmob|rubiconproject|onetag|samba|scopely|scorecardresearch|shareaholic|sharethis|sharethrough|smaato|snapads|speedshiftmedia|supersonicads|swrve|taboola|tremorhub|unity3d|vertamedia|videohub|vungle|wzrkt|xiaomi|yieldlove|yieldmo|yieldoptimizer|baidu|chinanet|yandex|googlesyndication)

Could you provide me with more REGEX values like that? Also, suggest safe-to-use REGEX values.
 
  • Like
Reactions: Sorrento

Bot

AI-powered Bot
Apr 21, 2016
4,215
Sure, here are a few additional REGEX values you can use for ad-blocking:

Code:
(adtechus|advertising|adzerk|doubleclick|exelator|googleadservices|googlesyndication|openx|pubmatic|scorecardresearch|adsrvr|adnxs|adsafeprotected|contextweb|adblade|adform|admeld|admeta|admicro|admob|adpepper|adperium|adrevolver|adscale|adscience|adspeed|adspirit|adtech|adtiger|adtrade|adtrgt|adultadworld|adventory|adversal|advertise|advertising|advertlets|adverticum|advertserve|adview|advisormedia|adviva|advpoints|affiliates|bannerconnect|banners|bebi|bidvertiser|blogads|blueadvertise|bluekai|bluelithium|brealtime|burstbeacon|burstnet|casalemedia|chango|clickbank|clicksor|collective-media|coremetrics|cpxinteractive|crispads|dedicatedmedia|directrev|doubleclick|exponential|fetchback|fimserve|gammadyne|google-analytics|googleadservices|googleadservices|googleapis|googlesyndication|gunggo|httpool|imiclk|imrworldwide|infolinks|interclick|invitemedia|kontera|lijit|liverail|marchex|mathtag|mediaplex|megaclick|microad|mixmarket|moatads|mybloglog|netconversions|netseer|openx|optimizely|outbrain|p-td|quantcast|quantserve|realmedia|revsci|rightmedia|serving-sys|sharethis|skimresources|specificmedia|speedshiftmedia|statcounter|tacoda|taboola|tattomedia|themig|trendnetcloud|tribalfusion|turn|valueclick|viglink|webtrends|yieldmanager|zedo)

These are commonly used by ad networks and should be safe to use. However, be aware that blocking some of these may affect the functionality of some websites. Always test and adjust as needed.
 
  • Like
Reactions: Sorrento and rashmi

rashmi

Level 10
Thread author
Jan 15, 2024
496
Sure, here are a few additional REGEX values you can use for ad-blocking:

Code:
(adtechus|advertising|adzerk|doubleclick|exelator|googleadservices|googlesyndication|openx|pubmatic|scorecardresearch|adsrvr|adnxs|adsafeprotected|contextweb|adblade|adform|admeld|admeta|admicro|admob|adpepper|adperium|adrevolver|adscale|adscience|adspeed|adspirit|adtech|adtiger|adtrade|adtrgt|adultadworld|adventory|adversal|advertise|advertising|advertlets|adverticum|advertserve|adview|advisormedia|adviva|advpoints|affiliates|bannerconnect|banners|bebi|bidvertiser|blogads|blueadvertise|bluekai|bluelithium|brealtime|burstbeacon|burstnet|casalemedia|chango|clickbank|clicksor|collective-media|coremetrics|cpxinteractive|crispads|dedicatedmedia|directrev|doubleclick|exponential|fetchback|fimserve|gammadyne|google-analytics|googleadservices|googleadservices|googleapis|googlesyndication|gunggo|httpool|imiclk|imrworldwide|infolinks|interclick|invitemedia|kontera|lijit|liverail|marchex|mathtag|mediaplex|megaclick|microad|mixmarket|moatads|mybloglog|netconversions|netseer|openx|optimizely|outbrain|p-td|quantcast|quantserve|realmedia|revsci|rightmedia|serving-sys|sharethis|skimresources|specificmedia|speedshiftmedia|statcounter|tacoda|taboola|tattomedia|themig|trendnetcloud|tribalfusion|turn|valueclick|viglink|webtrends|yieldmanager|zedo)

These are commonly used by ad networks and should be safe to use. However, be aware that blocking some of these may affect the functionality of some websites. Always test and adjust as needed.
I need a list of all the REGEX values used for ad-blocking.
 
  • Like
Reactions: Sorrento

Bot

AI-powered Bot
Apr 21, 2016
4,215
I need a list of all the REGEX values used for ad-blocking.
Creating a comprehensive list of all REGEX values used for ad-blocking would be a massive task due to the sheer number of ad networks and the dynamic nature of the internet. The list provided earlier includes many of the most common ad networks. However, you can also refer to public lists such as EasyList, AdAway, and others which are regularly updated by the community. These lists can be converted into REGEX format for use with Cloudflare Gateway. Remember, blocking some domains may break certain web functionalities, so always test after implementation.
 
  • Like
Reactions: rashmi

rashmi

Level 10
Thread author
Jan 15, 2024
496
Creating a comprehensive list of all REGEX values used for ad-blocking would be a massive task due to the sheer number of ad networks and the dynamic nature of the internet. The list provided earlier includes many of the most common ad networks. However, you can also refer to public lists such as EasyList, AdAway, and others which are regularly updated by the community. These lists can be converted into REGEX format for use with Cloudflare Gateway. Remember, blocking some domains may break certain web functionalities, so always test after implementation.
Can you explain how to convert public lists, such as EasyList, into REGEX format so I can use them with Cloudflare Gateway?
 
  • Like
Reactions: Sorrento

Bot

AI-powered Bot
Apr 21, 2016
4,215
Can you explain how to convert public lists, such as EasyList, into REGEX format so I can use them with Cloudflare Gateway?
Converting public lists like EasyList into REGEX format for use with Cloudflare Gateway involves several steps:

1. Download the list (usually in a .txt or .csv format).
2. Open the list in a text editor that supports Regular Expressions, such as Notepad++ or Sublime Text.
3. The lists usually contain entries like "||example.com^". You'll want to convert this into a REGEX format. In this case, it would be "example.com".
4. Use the "Find and Replace" function in your text editor (usually Ctrl+H). In the "Find" field, enter "||" and replace it with nothing. Do the same for "^". This will leave you with just the domain names.
5. Now, you need to convert these domain names into a REGEX format that Cloudflare Gateway can understand. Replace "." with "\." and add parentheses around the entire expression. Your final REGEX should look something like this: "(example\.com)".
6. Repeat this process for all entries in the list.

This is a simplified explanation and the actual process may vary depending on the format of the public list. Also, be aware that some entries in public lists may already be in REGEX format, or may contain wildcards (*) which need to be converted to ".*" to work in REGEX. Always test your REGEX before implementing it.
 
  • Like
Reactions: rashmi

rashmi

Level 10
Thread author
Jan 15, 2024
496
Converting public lists like EasyList into REGEX format for use with Cloudflare Gateway involves several steps:

1. Download the list (usually in a .txt or .csv format).
2. Open the list in a text editor that supports Regular Expressions, such as Notepad++ or Sublime Text.
3. The lists usually contain entries like "||example.com^". You'll want to convert this into a REGEX format. In this case, it would be "example.com".
4. Use the "Find and Replace" function in your text editor (usually Ctrl+H). In the "Find" field, enter "||" and replace it with nothing. Do the same for "^". This will leave you with just the domain names.
5. Now, you need to convert these domain names into a REGEX format that Cloudflare Gateway can understand. Replace "." with "\." and add parentheses around the entire expression. Your final REGEX should look something like this: "(example\.com)".
6. Repeat this process for all entries in the list.

This is a simplified explanation and the actual process may vary depending on the format of the public list. Also, be aware that some entries in public lists may already be in REGEX format, or may contain wildcards (*) which need to be converted to ".*" to work in REGEX. Always test your REGEX before implementing it.
Are there any ad-blocking public lists available in REGEX format?
 

Bot

AI-powered Bot
Apr 21, 2016
4,215
Are there any ad-blocking public lists available in REGEX format?
While most ad-blocking lists like EasyList, AdAway, and others are not directly available in REGEX format, there are some resources that provide converted lists. For instance, 'NoTrack Blocklist' and 'Pi-hole's Gravity' are two such lists that offer REGEX formatted ad-blocking lists. However, always ensure to test these lists as some REGEX expressions might not be compatible with every ad-blocking tool.
 
  • Like
Reactions: rashmi

rashmi

Level 10
Thread author
Jan 15, 2024
496
Converting public lists like EasyList into REGEX format for use with Cloudflare Gateway involves several steps:

1. Download the list (usually in a .txt or .csv format).
2. Open the list in a text editor that supports Regular Expressions, such as Notepad++ or Sublime Text.
3. The lists usually contain entries like "||example.com^". You'll want to convert this into a REGEX format. In this case, it would be "example.com".
4. Use the "Find and Replace" function in your text editor (usually Ctrl+H). In the "Find" field, enter "||" and replace it with nothing. Do the same for "^". This will leave you with just the domain names.
5. Now, you need to convert these domain names into a REGEX format that Cloudflare Gateway can understand. Replace "." with "\." and add parentheses around the entire expression. Your final REGEX should look something like this: "(example\.com)".
6. Repeat this process for all entries in the list.

This is a simplified explanation and the actual process may vary depending on the format of the public list. Also, be aware that some entries in public lists may already be in REGEX format, or may contain wildcards (*) which need to be converted to ".*" to work in REGEX. Always test your REGEX before implementing it.
How can I convert a list of domain names into a REGEX format that Cloudflare Gateway can understand using Notepad++ in batch?
 

Bot

AI-powered Bot
Apr 21, 2016
4,215
How can I convert a list of domain names into a REGEX format that Cloudflare Gateway can understand using Notepad++ in batch?
Here's a step-by-step guide to convert a list of domain names into REGEX format using Notepad++:

1. Open your list of domain names in Notepad++.
2. Open the "Find and Replace" dialog (Ctrl+H).
3. In the "Find what" field, enter `(\.)` (without quotes). This will find all periods.
4. In the "Replace with" field, enter `\\.` (without quotes). This will replace periods with escaped periods.
5. Ensure the "Search Mode" is set to "Regular expression".
6. Click "Replace All". This will escape all periods in your domain names.
7. Now, to add parentheses around each domain, open "Find and Replace" dialog again.
8. In the "Find what" field, enter `^(.*)$` (without quotes). This matches the entire line.
9. In the "Replace with" field, enter `($1)` (without quotes). This will replace the entire line with the same content, but enclosed in parentheses.
10. Click "Replace All".

Now, your list of domain names should be in REGEX format suitable for Cloudflare Gateway. Remember to test your REGEX before implementing it.
 
  • Like
Reactions: rashmi

rashmi

Level 10
Thread author
Jan 15, 2024
496
Here's a step-by-step guide to convert a list of domain names into REGEX format using Notepad++:

1. Open your list of domain names in Notepad++.
2. Open the "Find and Replace" dialog (Ctrl+H).
3. In the "Find what" field, enter `(\.)` (without quotes). This will find all periods.
4. In the "Replace with" field, enter `\\.` (without quotes). This will replace periods with escaped periods.
5. Ensure the "Search Mode" is set to "Regular expression".
6. Click "Replace All". This will escape all periods in your domain names.
7. Now, to add parentheses around each domain, open "Find and Replace" dialog again.
8. In the "Find what" field, enter `^(.*)$` (without quotes). This matches the entire line.
9. In the "Replace with" field, enter `($1)` (without quotes). This will replace the entire line with the same content, but enclosed in parentheses.
10. Click "Replace All".

Now, your list of domain names should be in REGEX format suitable for Cloudflare Gateway. Remember to test your REGEX before implementing it.
I followed the steps, but it didn't enclose the domain names in parentheses.
 

Bot

AI-powered Bot
Apr 21, 2016
4,215
I followed the steps, but it didn't enclose the domain names in parentheses.
Apologies for the confusion. Let's try another approach:

1. Open your list of domain names in Notepad++.
2. Open the "Find and Replace" dialog (Ctrl+H).
3. In the "Find what" field, enter `(\.)` (without quotes). This will find all periods.
4. In the "Replace with" field, enter `\\.` (without quotes). This will replace periods with escaped periods.
5. Ensure the "Search Mode" is set to "Regular expression".
6. Click "Replace All". This will escape all periods in your domain names.
7. Now, to add parentheses around each domain, open "Find and Replace" dialog again.
8. In the "Find what" field, enter `^(.*)$` (without quotes). This matches the entire line.
9. In the "Replace with" field, enter `\($1\)` (without quotes). This will replace the entire line with the same content, but enclosed in parentheses.
10. Click "Replace All".

Now, your list of domain names should be enclosed in parentheses and in REGEX format suitable for Cloudflare Gateway.
 
  • Like
Reactions: rashmi

rashmi

Level 10
Thread author
Jan 15, 2024
496
Apologies for the confusion. Let's try another approach:

1. Open your list of domain names in Notepad++.
2. Open the "Find and Replace" dialog (Ctrl+H).
3. In the "Find what" field, enter `(\.)` (without quotes). This will find all periods.
4. In the "Replace with" field, enter `\\.` (without quotes). This will replace periods with escaped periods.
5. Ensure the "Search Mode" is set to "Regular expression".
6. Click "Replace All". This will escape all periods in your domain names.
7. Now, to add parentheses around each domain, open "Find and Replace" dialog again.
8. In the "Find what" field, enter `^(.*)$` (without quotes). This matches the entire line.
9. In the "Replace with" field, enter `\($1\)` (without quotes). This will replace the entire line with the same content, but enclosed in parentheses.
10. Click "Replace All".

Now, your list of domain names should be enclosed in parentheses and in REGEX format suitable for Cloudflare Gateway.
How can I convert a list of domain names into the following REGEX format using Notepad++ in batch?
(advert|adserv|adsystem|doubleclick|2mdn|truecaller|uberads)
 

Bot

AI-powered Bot
Apr 21, 2016
4,215
How can I convert a list of domain names into the following REGEX format using Notepad++ in batch?
(advert|adserv|adsystem|doubleclick|2mdn|truecaller|uberads)
To convert a list of domain names into the REGEX format you've mentioned using Notepad++, follow these steps:

1. Open your list of domain names in Notepad++.
2. Open the "Find and Replace" dialog (Ctrl+H).
3. In the "Find what" field, enter `\R` (without quotes). This will find all line breaks.
4. In the "Replace with" field, enter `|` (without quotes). This will replace line breaks with the pipe symbol.
5. Ensure the "Search Mode" is set to "Extended (\n, \r, \t, \0, \x)".
6. Click "Replace All". This will replace all line breaks with the pipe symbol, creating a single line of domain names separated by pipes.
7. Now, manually add parentheses around the entire line of domain names.

Your final REGEX should look something like this: `(advert|adserv|adsystem|doubleclick|2mdn|truecaller|uberads)`.
 
  • Like
Reactions: rashmi

rashmi

Level 10
Thread author
Jan 15, 2024
496
To convert a list of domain names into the REGEX format you've mentioned using Notepad++, follow these steps:

1. Open your list of domain names in Notepad++.
2. Open the "Find and Replace" dialog (Ctrl+H).
3. In the "Find what" field, enter `\R` (without quotes). This will find all line breaks.
4. In the "Replace with" field, enter `|` (without quotes). This will replace line breaks with the pipe symbol.
5. Ensure the "Search Mode" is set to "Extended (\n, \r, \t, \0, \x)".
6. Click "Replace All". This will replace all line breaks with the pipe symbol, creating a single line of domain names separated by pipes.
7. Now, manually add parentheses around the entire line of domain names.

Your final REGEX should look something like this: `(advert|adserv|adsystem|doubleclick|2mdn|truecaller|uberads)`.
How can I remove TLDs from a list of domain names using Notepad++ in batch?
 

Bot

AI-powered Bot
Apr 21, 2016
4,215
How can I remove TLDs from a list of domain names using Notepad++ in batch?
To remove TLDs (Top Level Domains) from a list of domain names using Notepad++, follow these steps:

1. Open your list of domain names in Notepad++.
2. Open the "Find and Replace" dialog (Ctrl+H).
3. In the "Find what" field, enter `\.\w+$` (without quotes). This will find the TLDs.
4. Leave the "Replace with" field blank. This will replace the TLDs with nothing.
5. Ensure the "Search Mode" is set to "Regular expression".
6. Click "Replace All".

This will remove all TLDs from your list of domain names. Please note that this assumes that your TLDs do not contain hyphens or other non-alphanumeric characters. If they do, you might need to adjust the regular expression accordingly.
 
  • Like
Reactions: rashmi

rashmi

Level 10
Thread author
Jan 15, 2024
496
To remove TLDs (Top Level Domains) from a list of domain names using Notepad++, follow these steps:

1. Open your list of domain names in Notepad++.
2. Open the "Find and Replace" dialog (Ctrl+H).
3. In the "Find what" field, enter `\.\w+$` (without quotes). This will find the TLDs.
4. Leave the "Replace with" field blank. This will replace the TLDs with nothing.
5. Ensure the "Search Mode" is set to "Regular expression".
6. Click "Replace All".

This will remove all TLDs from your list of domain names. Please note that this assumes that your TLDs do not contain hyphens or other non-alphanumeric characters. If they do, you might need to adjust the regular expression accordingly.
How can I convert a list of domain names in vertical order into the following REGEX format using Notepad++ in batch?
(advert|adserv|adsystem|doubleclick|2mdn|truecaller|uberads)
 

Bot

AI-powered Bot
Apr 21, 2016
4,215
How can I convert a list of domain names in vertical order into the following REGEX format using Notepad++ in batch?
(advert|adserv|adsystem|doubleclick|2mdn|truecaller|uberads)
To convert a vertical list of domain names into the REGEX format you've mentioned using Notepad++, follow these steps:

1. Open your list of domain names in Notepad++.
2. Open the "Find and Replace" dialog (Ctrl+H).
3. In the "Find what" field, enter `\r\n` (without quotes). This will find all line breaks.
4. In the "Replace with" field, enter `|` (without quotes). This will replace line breaks with the pipe symbol.
5. Ensure the "Search Mode" is set to "Extended (\n, \r, \t, \0, \x)".
6. Click "Replace All". This will replace all line breaks with the pipe symbol, creating a single line of domain names separated by pipes.
7. Now, manually add parentheses around the entire line of domain names.

Your final REGEX should look something like this: `(advert|adserv|adsystem|doubleclick|2mdn|truecaller|uberads)`.
 
  • Like
Reactions: rashmi

rashmi

Level 10
Thread author
Jan 15, 2024
496
To convert a vertical list of domain names into the REGEX format you've mentioned using Notepad++, follow these steps:

1. Open your list of domain names in Notepad++.
2. Open the "Find and Replace" dialog (Ctrl+H).
3. In the "Find what" field, enter `\r\n` (without quotes). This will find all line breaks.
4. In the "Replace with" field, enter `|` (without quotes). This will replace line breaks with the pipe symbol.
5. Ensure the "Search Mode" is set to "Extended (\n, \r, \t, \0, \x)".
6. Click "Replace All". This will replace all line breaks with the pipe symbol, creating a single line of domain names separated by pipes.
7. Now, manually add parentheses around the entire line of domain names.

Your final REGEX should look something like this: `(advert|adserv|adsystem|doubleclick|2mdn|truecaller|uberads)`.
Is there a way to split the text into groups of 65530 chars using Notepad++?
 

Bot

AI-powered Bot
Apr 21, 2016
4,215
Is there a way to split the text into groups of 65530 chars using Notepad++?
Unfortunately, Notepad++ doesn't have a built-in function to split text into specific character lengths. However, you can use a Python script with the Python Script plugin for Notepad++. Here's a simple script:

```python
import os

def split_text_into_chunks(text, length):
return [text[i:i+length] for i in range(0, len(text), length)]

editor.beginUndoAction()

text = editor.getText()
chunks = split_text_into_chunks(text, 65530)

editor.clearAll()

for chunk in chunks:
editor.addText(chunk)
editor.newLine()

editor.endUndoAction()
```

This script will split the text in the current document into chunks of 65530 characters each. Each chunk will be on its own line. Please note that you need to install the Python Script plugin and have Python installed on your machine to run this script.
 
  • Like
Reactions: rashmi

About us

  • MalwareTips is a community-driven platform providing the latest information and resources on malware and cyber threats. Our team of experienced professionals and passionate volunteers work to keep the internet safe and secure. We provide accurate, up-to-date information and strive to build a strong and supportive community dedicated to cybersecurity.

User Menu

Follow us

Follow us on Facebook or Twitter to know first about the latest cybersecurity incidents and malware threats.

Top