Parcourir la source

add more complex/odd parsing tests

tags/2.0.1
Jonathan Cobb il y a 5 ans
Parent
révision
727f1ef4c8
8 fichiers modifiés avec 399 ajouts et 23 suppressions
  1. +4
    -1
      src/main/java/bubble/abp/spec/BlockListSource.java
  2. +7
    -4
      src/main/java/bubble/abp/spec/BlockSpec.java
  3. +7
    -3
      src/main/java/bubble/abp/spec/selector/AbpClause.java
  4. +40
    -10
      src/main/java/bubble/abp/spec/selector/BlockSelector.java
  5. +1
    -1
      src/main/java/bubble/abp/spec/selector/SelectorAttribute.java
  6. +51
    -4
      src/test/java/bubble/abp/spec/SelectorTest.java
  7. +249
    -0
      src/test/resources/AntiMalwareABP.txt
  8. +40
    -0
      src/test/resources/LICENSE.md

+ 4
- 1
src/main/java/bubble/abp/spec/BlockListSource.java Voir le fichier

@@ -9,6 +9,7 @@ import org.cobbzilla.util.http.HttpUtil;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import static org.cobbzilla.util.daemon.ZillaRuntime.*;
@@ -25,8 +26,10 @@ public class BlockListSource {

@Getter @Setter private BlockList blockList = new BlockList();

public InputStream getUrlInputStream() throws IOException { return HttpUtil.get(url); }

public BlockListSource download() throws IOException {
try (BufferedReader r = new BufferedReader(new InputStreamReader(HttpUtil.get(url)))) {
try (BufferedReader r = new BufferedReader(new InputStreamReader(getUrlInputStream()))) {
String line;
boolean firstLine = true;
while ( (line = r.readLine()) != null ) {


+ 7
- 4
src/main/java/bubble/abp/spec/BlockSpec.java Voir le fichier

@@ -30,6 +30,7 @@ public class BlockSpec {
public boolean hasTypeMatches () { return !empty(typeMatches); }

@Getter private List<String> typeExclusions;
@Getter private List<String> otherOptions;

@Getter private BlockSelector selector;
public boolean hasSelector() { return selector != null; }
@@ -49,7 +50,8 @@ public class BlockSpec {
if (typeExclusions == null) typeExclusions = new ArrayList<>();
typeExclusions.add(type);
} else {
log.warn("unsupported option (ignoring): " + opt);
if (otherOptions == null) otherOptions = new ArrayList<>();
otherOptions.add(opt);
}

} else {
@@ -57,7 +59,8 @@ public class BlockSpec {
if (typeMatches == null) typeMatches = new ArrayList<>();
typeMatches.add(opt);
} else {
log.warn("unsupported option (ignoring): "+opt);
if (otherOptions == null) otherOptions = new ArrayList<>();
otherOptions.add(opt);
}
}
}
@@ -102,7 +105,7 @@ public class BlockSpec {
// no options, but selector present. split into target + selector
targets = BlockSpecTarget.parse(line.substring(0, selectorStartPos));
options = null;
selector = line.substring(selectorStartPos+1);
selector = line.substring(selectorStartPos);
}
} else {
if (selectorStartPos == -1) {
@@ -114,7 +117,7 @@ public class BlockSpec {
// all 3 elements present
targets = BlockSpecTarget.parse(line.substring(0, optionStartPos));
options = StringUtil.splitAndTrim(line.substring(optionStartPos + 1, selectorStartPos), ",");
selector = line.substring(selectorStartPos+1);
selector = line.substring(selectorStartPos);
}
}
final List<BlockSpec> specs = new ArrayList<>();


+ 7
- 3
src/main/java/bubble/abp/spec/selector/AbpClause.java Voir le fichier

@@ -2,12 +2,13 @@ package bubble.abp.spec.selector;

import lombok.*;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;
import org.cobbzilla.util.collection.ArrayUtil;

import static bubble.abp.spec.selector.SelectorParseError.parseError;

@NoArgsConstructor @Accessors(chain=true)
@EqualsAndHashCode @ToString
@EqualsAndHashCode @ToString @Slf4j
public class AbpClause {

@Getter @Setter private AbpClauseType type;
@@ -38,8 +39,11 @@ public class AbpClause {
return abp.setProperties(props);

case has:
if (!spec.startsWith(">")) throw parseError("expected abp-has argument to begin with > :"+spec);
spec = spec.substring(1);
if (!spec.startsWith(">")) {
log.warn("expected abp-has argument to begin with > :"+spec);
} else {
spec = spec.substring(1);
}
return abp.setSelector(BlockSelector.buildNextSelector(spec.trim()));
}
throw parseError("invalid abp clause type: "+spec);


+ 40
- 10
src/main/java/bubble/abp/spec/selector/BlockSelector.java Voir le fichier

@@ -29,11 +29,21 @@ public class BlockSelector {
} else {
if (dotPos == 0 || dotPos == n.length()-1) throw parseError("invalid name: "+n);
if (type == null) throw parseError("type not set, cannot set name: "+n);
name = n.substring(0, dotPos);
cls = n.substring(dotPos + 1);
switch (type) {
case id: type = SelectorType.id_and_cls; break;
case tag: type = SelectorType.tag_and_cls; break;
case id:
name = n.substring(0, dotPos);
cls = n.substring(dotPos + 1);
type = SelectorType.id_and_cls;
break;
case tag:
name = n.substring(0, dotPos);
cls = n.substring(dotPos + 1);
type = SelectorType.tag_and_cls;
break;
case cls:
name = n;
cls = n;
break;
default: throw parseError("cannot add class to type "+type);
}
}
@@ -80,40 +90,58 @@ public class BlockSelector {
nameSet = true;
final StringTokenizer st = new StringTokenizer(spec, "[] ", true);
SelectorAttributeParseState state = seeking_open_bracket;
String attrSpec = null;
String attrSpec = "";
int charsConsumed = 0;
while (st.hasMoreTokens()) {
final String tok = st.nextToken();
charsConsumed += tok.length();
switch (tok) {
case "[":
if (state != seeking_open_bracket) throw parseError("invalid attribute (expecting open bracket): "+spec);
charsConsumed += tok.length();
state = seeking_close_bracket;
attrSpec = "";
break;

case "]":
if (state != seeking_close_bracket) throw parseError("invalid attribute (expecting close bracket): "+spec);
state = seeking_open_bracket;
if (empty(attrSpec)) throw parseError("invalid attribute: "+spec);
sel.attributes = ArrayUtil.append(sel.attributes, SelectorAttribute.buildAttribute(attrSpec));
charsConsumed += tok.length();
break;

case " ":
if (state != seeking_open_bracket) throw parseError("invalid attribute (unexpected space, expecting close bracket): "+spec);
state = finished;
if (state == seeking_open_bracket) {
state = finished;
} else {
attrSpec += tok;
charsConsumed += tok.length();
}
break;

default:
attrSpec = tok;
if (state == seeking_open_bracket) {
state = finished;
break;
}
attrSpec += tok;
charsConsumed += tok.length();
break;
}
if (state == finished) break;
}
spec = spec.substring(charsConsumed);
}
if (spec.trim().length() == 0) {
return sel;
}

abpPos = spec.indexOf(":-");
spacePos = spec.indexOf(' ');
if (abpPos != -1 && spacePos != -1 && abpPos > spacePos) abpPos = -1;
if (abpPos != -1) {
sel.setName(spec.substring(0, abpPos));
abpPos = spec.indexOf(":-");
if (!nameSet) sel.setName(spec.substring(0, abpPos));
nameSet = true;

int openParen = spec.indexOf("(");
@@ -143,6 +171,8 @@ public class BlockSelector {
spec = spec.substring(abpSpec.length());
}

if (spec.trim().length() == 0) return sel;

if (!nameSet) {
spacePos = spec.indexOf(' ');
if (spacePos == -1) {


+ 1
- 1
src/main/java/bubble/abp/spec/selector/SelectorAttribute.java Voir le fichier

@@ -66,6 +66,6 @@ public class SelectorAttribute {
final int colonPos = style.indexOf(':');
if (colonPos == -1) throw parseError("invalid style (expected colon char): "+style);
if (colonPos == 0 || colonPos == style.length()-1) throw parseError("invalid style (no name or value): "+style);
return new NameAndValue(style.substring(0, colonPos), style.substring(colonPos+1));
return new NameAndValue(style.substring(0, colonPos).trim(), style.substring(colonPos+1).trim());
}
}

+ 51
- 4
src/test/java/bubble/abp/spec/SelectorTest.java Voir le fichier

@@ -4,11 +4,16 @@ import bubble.abp.spec.selector.*;
import org.cobbzilla.util.collection.NameAndValue;
import org.junit.Test;

import java.io.InputStream;

import static bubble.abp.spec.selector.SelectorAttributeComparison.*;
import static bubble.abp.spec.selector.SelectorOperator.encloses;
import static bubble.abp.spec.selector.SelectorOperator.next;
import static bubble.abp.spec.selector.SelectorType.*;
import static org.cobbzilla.util.daemon.ZillaRuntime.shortError;
import static org.cobbzilla.util.io.StreamUtil.loadResourceAsStream;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

public class SelectorTest {

@@ -112,17 +117,46 @@ public class SelectorTest {
new AbpContains().setType(AbpContainsType.selector).setSelector(
new BlockSelector().setType(tag).setName("a").setAttributes(new SelectorAttribute[]{
new SelectorAttribute().setName("href").setComparison(contains).setValue("example.com")
}))))},
}))))}
};

public static final Object[][] ODD_TESTS = new Object[][] {
{"#?#.cls-content span[id^=\"i-\"]:-abp-contains(Automatic updates)", new BlockSelector()
.setAbpEnabled(true).setType(cls).setName("cls-content").setOperator(encloses).setNext(
new BlockSelector().setType(tag).setName("span").setAttributes(new SelectorAttribute[]{
new SelectorAttribute().setName("id").setComparison(startsWith).setValue("i-")
}).setAbp(new AbpClause().setType(AbpClauseType.contains).setContains(
new AbpContains().setType(AbpContainsType.literal).setValue("Automatic updates")
))
)},

{"#?#b:-abp-has(a[target^=\"reimage\"])", new BlockSelector()
.setAbpEnabled(true).setType(tag).setName("b").setAbp(
new AbpClause().setType(AbpClauseType.has).setSelector(
new BlockSelector().setType(tag).setName("a").setAttributes(new SelectorAttribute[]{
new SelectorAttribute().setName("target").setComparison(startsWith).setValue("reimage")
}))
)},

{"##div[style^=\"float: none; margin:10px \"]", new BlockSelector()
.setType(tag).setName("div").setAttributes(new SelectorAttribute[]{
new SelectorAttribute().setName("style").setComparison(startsWith)
.setValue("float: none; margin:10px ").setStyle(new NameAndValue[]{
new NameAndValue("float", "none"),
new NameAndValue("margin", "10px")
})
})},

{"#?#.cls-content ol:-abp-contains(Download Foo)", new BlockSelector()
.setAbpEnabled(true).setType(cls).setName("cls-content").setOperator(encloses).setNext(
new BlockSelector().setType(tag).setName("ol").setAbp(
new BlockSelector().setType(tag).setName("ol").setAbp(
new AbpClause().setType(AbpClauseType.contains).setContains(
new AbpContains().setType(AbpContainsType.literal).setValue("Download Foo")
)))}};

)))}
};
@Test public void testSelectorParsing () throws Exception { runTests(SELECTOR_TESTS); }
@Test public void testAbpParsing () throws Exception { runTests(ABP_TESTS); }
@Test public void testOddParsing () throws Exception { runTests(ODD_TESTS); }

private void runTests(Object[][] tests) throws SelectorParseError {
for (Object[] test : tests) {
@@ -132,4 +166,17 @@ public class SelectorTest {
}
}

@Test public void testComplexList () throws Exception {
try {
final BlockListSource source = new BlockListSource() {
@Override public InputStream getUrlInputStream() { return loadResourceAsStream("AntiMalwareABP.txt"); }
}.download();
assertEquals("error parsing some lines", 0, source.getBlockList().getWhitelist().size());
assertEquals("error parsing some lines", 553, source.getBlockList().getBlacklist().size());
System.out.println("saved lists!");
} catch (Exception e) {
fail("testComplexList: badness: "+shortError(e));
}
}

}

+ 249
- 0
src/test/resources/AntiMalwareABP.txt Voir le fichier

@@ -0,0 +1,249 @@
[Adblock Plus 3.4]
! Title: 💊 Dandelion Sprout's Anti-Malware List (for AdBlock and Adblock Plus)
! Version: 16January2020v1-Beta
! Expires: 5 days
! Description: Most anti-malware lists are pretty big and can cover a 5- or 6-digit amount of specific domains. But my list hereby claims to remove more than 25% of all known malware sites with just a 2-digit amount of entries. This is mostly done by blocking top-level domains that have become devastatingly abused by spammers, usually because they allowed for free and uncontrolled domain registrations. There's also additional categories that cover unusual malware and phishing domains that very few other lists seem to cover.
! For more information, details, helpful tools, and other lists that I've made, visit https://github.com/DandelionSprout/adfilt/blob/master/Wiki/General-info.md#english
! ——— Country domains ———
! You can expect these domains to have an overwhelming majority of malware domains that have nothing to do with the countries in question. Nevertheless, if you are in a situation where you have to do active business in any of the countries in question, then this list may not be ideal for you.
! Tokelau
||.tk^$domain=~coolcmd.tk|~budterence.tk|~google.tk|~transportnews.tk|~unicorncardlist.tk|~c0d3c.tk|~anonytext.tk|~tokelau-info.tk|~fakaofo.tk|~loljp-wiki.tk|~ninetail.tk|~goshujin.tk|~graph.tk|~haopro.tk|~dls2.pokeacer.tk
! Gabon
||.ga^$domain=~google.ga|~filtri-dns.ga|~anpigabon.ga|~dgdi.ga|~voitures.ga
! Mali
||.ml^$domain=~google.ml|~mobili.ml|~melody.ml
! Equatorial Guinea
||.gq^$domain=~deimos.gq|~inege.gq|~tvgelive.gq|~comprarcarros.gq
! Central African Republic
||.cf^$domain=~intr0.cf|~google.cf|~rths.cf|~voitures.cf|~assembleenationale-rca.cf|~cps-rca.cf|~acap.cf
! ——— Topical domains ———
! These are topical domains that have consistently horrendous scores on watchlists of bad TLDs, and whose use for legit purposes is practically non-existent.
! Presumably fake loans
||.loan^
||.agency^
||.gdn^
||.bid^
! ——— Attempted removal of Google search result entries that lead to the above top-level domains (Advanced adblockers only) ———
! ——— You know those ultra-fraudulent websites who clutter up Google searches, who have some seemingly random ".php?" values in their URLs? These entries should remove some of them. ———
! ——— For Google Mobile ———
! Note for Firefox on Android users: I strongly recommend the use of https://addons.mozilla.org/firefox/addon/google-search-fixer/ for use on Firefox for Android, thus the entries are written for the Chrome version of Google Mobile.
! ——— Dead domains that used to host lists for adblockers or "hosts" tools, but which are now either used by malware pushers, or could potentially be snapped up by them. (Also added to "uBlock Filters - Badware Risks") ———
||adblock.gjtech.net^
||spam404bl.com^
||109.201.135.46^
||hufilter.hu^
||fredfiber.no^
||securemecca.com^
||1hos.cf^
||1hosts.cf^
||everythingisnt.com^
! ——— Old tech-related domains that have fallen into the hands of questionable new owners. ———
! To log in to TP-Link routers, use tplinkwifi.net instead.
||tplinklogin.net^
||tplinkextender.net^
||ublock.org^
||138.68.252.54^
! ——— IQ test sites that make you waste heaps of time by taking the test, and then try to charge you to see the results. ———
||funeducation.com^
||iq-research.info^
||iq-test-online.org^
||iq-test.co.uk^
||iqtest.co.uk^
||iqtest.com^
||iqtestnow.org^
||iqtestonline24.com^
||test-iq.org^
||officialiqtests.com^
! ——— Old Linux-related domains that have been snapped up for ads, adware, and/or malware. ———
! How these links still remain in Unetbootin, is anyone's guess.
||dreamlinux.com.br^
||dreamlinux.net^
||dreamlinux.info^
||104.24.117.74^
||104.24.116.74^
||[2606:4700:30::6818:754a]^
||[2606:4700:30::6818:744a]^
||hacktolive.org^
||mandriva.com^
! ——— ReImagePlus links (Also added to "uBlock Filters - Badware Risks") ———
! https://windowsreport.com/extend-windows-laptop-battery-life/
windowsreport.com##.code-block
! https://appuals.com/fix-error-0x800701e3-on-windows-7-8-1-10/
appuals.com##.info.box
appuals.com##.appua-reimage-top
! https://ugetfix.com/ask/how-to-fix-windows-store-error-0x8000ffff/
ugetfix.com,sauguspc.lt,wyleczpc.pl,sichernpc.de,pcseguro.es##div.attention-button-box-green
ugetfix.com,sauguspc.lt,wyleczpc.pl,sichernpc.de,pcseguro.es##.sidebar_download_inner
ugetfix.com,sauguspc.lt,wyleczpc.pl,sichernpc.de,pcseguro.es##.primary_download
ugetfix.com,sauguspc.lt,wyleczpc.pl,sichernpc.de,pcseguro.es##.download_button_info_texts
ugetfix.com,sauguspc.lt,wyleczpc.pl,sichernpc.de,pcseguro.es##.js-download_button_additional_links
ugetfix.com,sauguspc.lt,wyleczpc.pl,sichernpc.de,pcseguro.es#?#.ga-download:-abp-contains(/^Reimage$/)
ugetfix.com,sauguspc.lt,wyleczpc.pl,sichernpc.de,pcseguro.es##.download-button-offer-header
ugetfix.com,sauguspc.lt,wyleczpc.pl,sichernpc.de,pcseguro.es#?#h2:-abp-contains(/^Repair your Errors automatically$/i)
ugetfix.com,sauguspc.lt,wyleczpc.pl,sichernpc.de,pcseguro.es#?#h2:-abp-contains(/^Repair your Errors automatically$/i) + p
! https://www.thewindowsclub.com/fix-windows-update-error-0xc1900130-on-windows-10
thewindowsclub.com#?#.entry-content > div > strong:-abp-contains(find & fix Windows error)
thewindowsclub.com##div[style^="float: none; margin:10px "]
! https://www.majorgeeks.com/files/details/patch_my_pc.html
majorgeeks.com#?#b:-abp-has(a[target^="reimage"])
||www.majorgeeks.com/images/icons/red_icon_18x17px.png$image
! https://www.2-spyware.com/remove-redirector-gvt1-com.html
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk#?#.attention-button-wrap:-abp-contains(Reimage)
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk##.ui-content > .win
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk##.sidebar_download_inner > :not(.voting-box):not(.colorbg-grey)
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk#?#th:-abp-contains(/^Detection$/)
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk#?#th:-abp-contains(/^Detection$/) + td
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk##.js-download_button_offer
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk##.primary_download
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk##.automatic_removal_list
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk##.quick-download-button-placeholder
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk#?#.nfc-bottom-right:-abp-contains(Reimage)
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk#?#a:-abp-contains(Reimage)
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk##.quick-download-button-text
! ——— ScanUtilities links ———
! https://www.bynarycodes.com/fix-windows-10-update-error-0x80070006/
bynarycodes.com##div[class^="bynar-content_"]
bynarycodes.com#?#.panel:-abp-contains(a[href*="scanutilities.com"])
! ——— Driver Easy links ———
! https://www.drivereasy.com/knowledge/fix-critical-service-failed-blue-screen-error-on-windows-10/
drivereasy.com#?#.pakb-content ol:-abp-contains(Download and install Driver Easy)
drivereasy.com#?#.pakb-content p:-abp-contains(Driver Easy)
drivereasy.com#?#.pakb-content div.info.note:-abp-contains(drivereasy.com)
! https://www.drivereasy.com/knowledge/fixed-how-to-fix-stop-error-0x0000001e/
drivereasy.com#?#.pakb-content img[sizes^="(max-width: 80"]
drivereasy.com#?#.pakb-content p:-abp-contains(the FREE version)
drivereasy.com#?#.pakb-content p:-abp-contains(the Pro version)
! https://www.drivereasy.com/knowledge/download-gigabyte-audio-driver/
drivereasy.com#?#.pakb-content img[sizes^="(max-width: 79"]
drivereasy.com#?#.pakb-content span[id^="i-"]:-abp-contains(Automatically update your)
drivereasy.com#?#.pakb-content li:-abp-has(a[href="#automatically"])
! https://www.drivereasy.com/knowledge/epson-xp-420-driver-update-for-windows-7-8-and-10/
drivereasy.com#?#.pakb-content span[id^="i-"]:-abp-contains(Update drivers with Driver Easy)
drivereasy.com#?#.pakb-content figcaption:-abp-contains(for free if you like)
drivereasy.com#?#.pakb-content li:-abp-has(a:-abp-contains(Update drivers with Driver Easy))
! https://www.drivereasy.com/knowledge/solved-this-display-does-not-support-hdcp/
drivereasy.com#?#.pakb-content p:-abp-contains(click Update All)
! ——— Slimware DriverUpdate links ———
! https://forums.windowscentral.com/
forums.windowscentral.com###navbar_notice_33
! ——— Driverpack Online links (Accidentally also fixed in EasyPrivacy and «AdGuard Mobile Ads») ———
||google-analytics.com^$domain=sdi-tool.org
! ——— SpyHunter links ———
! https://howtoremove.guide/redirector-gvt1-com-virus-malware-chrome-removal/
howtoremove.guide##div[style^="border:2px"]
howtoremove.guide#?#.entry-content > div:-abp-contains(Special Offer)
! https://www.2-spyware.com/remove-redirector-gvt1-com.html
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk##.automatic_removal_list_w > .ar_block_description
2-spyware.com,novirus.uk,faravirus.ro,uirusu.jp,virusi.hr,wubingdu.cn,avirus.hu,ioys.gr,odstranitvirus.cz,tanpavirus.web.id,utanvirus.se,virukset.fi,losvirus.es,virusler.info.tr,semvirus.pt,lesvirus.fr,senzavirus.it,dieviren.de,viruset.no,usunwirusa.pl,zondervirus.nl,bedynet.ru,virusai.lt,virusi.bg,viirused.ee,udenvirus.dk#?#a:-abp-contains(SpyHunter)
! ——— Sites that fraudulently claim you've won a new phone ———
/(apps?|best|competition|game|mobile|play|prize|reward|sweeps)[0-9]{2,8}\.[a-z-]{5,22}[0-9]{1,8}\.(agency|icu|life|live)/$~third-party
! ——— Banner for "MSN New Tab" ———
msn.com##.irisbanner
! ——— Download sites that felt shoddy to me (Most of which, if not all of which, had real non-ad download links that contained malware .exe files) ———
! If you're in a situation where you need to torrent something, such as for hard-to-buy or region-locked games, or games that you own for consoles that lack accessible rip tools, you can at least try to use sites that have legit downloads with the actual game files.
||gamecopyworld.com^
||coolrom.com^
||freeroms.com^
||portalroms.com^
||romsmania.com^
||loveroms.com^
||portableroms.com^
! ——— Entries from «abuse.ch ZeuS Blocklist», which was discontinued on the 8th of July 2019. ———
||afobal.cl^
||alvoportas.com.br^
||blogerjijer.pw^
||bright.su^
||domnicpeter.in.net^
||dzitech.net^
||fadzulani.com^
||hotelavalon.org^
||hruner.com^
||interlogistics.com.vn^
||ivansaru.418.com1.ru^
||jangasm.org^
||kesikelyaf.com^
||luenhinpearl.com^
||ns511849.ip-192-99-19.net^
||ns513726.ip-192-99-148.net^
||panel.vargakragard.se^
||projects.globaltronics.net^
||prtscrinsertcn.net^
||sanyai-love.rmu.ac.th^
||server.bovine-mena.com^
||servmill.com^
||ssl.sinergycosmetics.com^
||telefonfiyatlari.org^
||update.rifugiopontese.it^
||vodahelp.sytes.net^
||nikey.cn^
||witkey.com^
! ——— Truly extraordinarily cases of sites so bad that it counts as malware that directly affects human brains ———
! https://www.reddit.com/r/insanepeoplefacebook/comments/czvv5i/incel_tracking_down_a_mother_of_a_murdered/
||incels.co^
! ——— Browser extension store entries for notoriously poor or malicious adblocker forks ———
! Note: Currently the entries only work properly on AdGuard for Windows/Mac, due to what seems to be limitations placed on browser extensions.
! Chrome Web Store
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(www.ublock.org)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(uBlock Plus Adblocker)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(Adblocker for )
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(Adblocker Plus)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(Adblocker Genesis Plus)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(Adblocker HARDLINE)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(uBlock Pro)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(ADZbuzz uBlock)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(Adblocker DEFENSE)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(Adblocker Professional)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(Adblocker CRM)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(uBlocker)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(AdFilter)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(AdBlock Inc.)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(Adblocker Genius PRO)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(Easy AdBlock)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(radventsolutions)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains( & AdBlock)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(Adblock for WebSites)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(ADBlock)
chrome.google.com#?#.webstore-test-wall-tile:-abp-contains(Adblocker.Global)
! Mozilla Add-ons
addons.mozilla.org#?#li.SearchResult:-abp-contains(uBlock, LLC)
addons.mozilla.org#?#li.SearchResult:-abp-contains(Adblocker for Firefox)
addons.mozilla.org#?#li.SearchResult:-abp-contains(AdsBlocker)
addons.mozilla.org#?#li.SearchResult:-abp-contains(Easy AdBlock)
addons.mozilla.org#?#li.SearchResult:-abp-contains(Adblocker Genius Pro)
addons.mozilla.org#?#li.SearchResult:-abp-contains(Adblocker.Global)
! Homepages
||adblock.biz^
||stop-reklama.com^
||the1adblocker.com^
! ——— https://new.reddit.com/r/dwarffortress/comments/e4srco/be_sure_to_use_org_instead_of_com_when_going_to/ ———
||dwarffortresswiki.com^
||103.224.212.249^
! ——— Frequently used to infiltrate and maliciously redirect sites, e.g. ToonBarn ———
||ppc.netnet44.net^
||tncrun.net^
||54.174.156.141^
! Placeholder line for alternate list versions

+ 40
- 0
src/test/resources/LICENSE.md Voir le fichier

@@ -0,0 +1,40 @@
# Dandelicence

## A licence that works on good faith, because why can't we all just be friends instead of bickering?

### Dandelicence's homepage: https://github.com/DandelionSprout/Dandelicence

### Version 1.2, 11th of January UTC

Redistribution and use in source and binary forms, with or without modification, with or without commercial intentions, are permitted provided that the following conditions are met:

1) Redistributions of unmodified or near-unmodified source code must retain this licence text in unmodified form somewhere inside it.

2) The creator(s) of the original project/code may under no circumstances be held responsible for damages, incompatibilities, breakage or unmerchantability, except if it's proven beyond reasonable doubt that the unmodified source code contained live ransomware/skimmingware. Likewise, anyone who modify the source code to contain live ransomware/skimmingware that was not originally in the source code, can be held responsible for it.

3) The name(s) of the copyright/trademark holder or contributors may not be used to endorse or promote products derived from this software without explicit prior written permission.

4) If a project that is licenced under the Dandelicence (A), incorporates (near-)unmodified content from another project that is licenced under any reasonably open-sourced licence (B), then it's mandatory for the maintainer(s) of A to adhere to requests for creator/licence creditation and/or to remove the incorporated content, from the owner(s)/maintainer(s) of B, as long as it can be reasonably assumed that the requestor really does own/maintain B. In return, the requestor is expected to assume for ≥14 days after the request has been placed that the maintainer(s) of A will act in good faith, will include the creditation or perform the removal within that timespan, and that reports and DMCA claims are to be kept at an absolute minimum for as long as A acts in good faith.

* * 4a. To make it easier for A's creator to display their good faith, creditation for incorporated content should be added as fast as possible without needing a request from B, if B's content was licenced with a creditation requirement⁽¹⁾, or was from a project that appears to not mention any licences or copyright policies of any sort.
* * 4b. If the content was taken from a project whose licence had a share-alike clause⁽²⁾, and which has not been sufficiently transformed to count as transformative work, it will be treated as still being licenced under B's licence. Otherwise, it will be treated as being under the Dandelicence.
* * 4c. If it's feasible, the incorporated content from B is to be placed in its own section, and the following template or something similar should be used: *"Below are \<content> that [I/we] borrowed from \<the name of B>, which is maintained by \<link to B's maintainer> at \<link to B's project>, and which is licenced under \<B's licence>."*
* * 4d. The owner(s) of A can choose to donate and relicence any portion of his/her own code to any other project of any kind even if it has not become transformative, unless it's subject to 4a or 4b.
* * 4e. Content that was originally incorporated, but which has since become transformative, are exempted from 4a, 4b and 4c, but not from 4.

5) The British English version of this licence is the official version. All other translations are unofficial.

6) Transformative versions of the source code do not require retaining this licence file, and can be relicenced into any licence. However, condition 2, 3, 5, and 6 in the Dandelicence will still apply to how the transformative version relates to the source code.

7) If a different licence is mentioned and used as the sole licence for an individual file in a multi-file project (e.g. a Git), then the file's licence takes sole precedence over the Dandelicence.

8) It is merely optional for the Dandelicence-using project to list copyright details (e.g. name, year) in the licence file, but it should be made clear in some way who the creator of the source code was, for example (but not limited to) through the project's homepage or FAQ page, even if it's just a fictional username. It is preferable to use © instead of (C).

9) Any (near-)unmodified redistributions of the source code, shall be accessible in some form at whichever monetary price in ≥100 countries worldwide. This is to prevent it from e.g. only being accessible on USA-only streaming services or similarly restricted services. VPN access does not count towards the tally. A «country» is defined as a United Nations member state, the Republic of China, the Sahrawi Arab Democratic Republic's Free Zone, Vatican State, Kosovo, or Northern Cyprus. Should the work not be available in enough countries, any living person may request the project's maintainer to make it available in at least 10 more countries within 14 days. Once a 14-day period has finished, a new request can be placed, until 100 countries have been reached.

10) Except where local laws and/or B's licences from 4b state otherwise, redistributions or borrowed content counts as «Unmodified» if it has received 0 changes, «Transformative work» if more than 20% of the lines or 20% of the sentences (whichever is more) have been altered from their original borrowing, and «Near-unmodified» if it is somewhere between those two categories. For the purposes of section 4, if A believes that their content use has become transformative, A can optionally add a note about it in the 4c template for as long as B does not contest the claim.

———————————————————————————————————————

⁽¹⁾ = Including GPLv3, GPLv2, MPLv2, CC BY, CC BY-NC, CC BY-SA and CC BY-NC-SA (among others).<br>
⁽²⁾ = Including GPLv3, GPLv2, CC BY-SA, CC BY-NC-SA, Eclipse and EUPL (among others).

Chargement…
Annuler
Enregistrer