AdguardTeam / AdguardForMac

Open bug tracker for Mac version of AdGuard
https://adguard.com/
294 stars 15 forks source link

Extend $network modifier - let it be an exception rule as well #190

Closed adbuker closed 7 years ago

adbuker commented 7 years ago

related to AdguardTeam/AdguardForWindows#1631

vityevato commented 7 years ago

171

vityevato commented 7 years ago

For supporting UDP blocking in Mac version we need follow next rule.

Url part of the rule with network option must contain fully specified IP address and may contain port. IPv6 address must be put in square brackets. Valid examples:

127.0.0.1$network 127.0.0.1:443$network [ff08::8080]$network [ff08::8080]:443$network

vityevato commented 7 years ago

ADMC-CR-23

vityevato commented 7 years ago

For testing TCP we may use this plan:

  1. define site for testing, for example www.domain.com
  2. get ip for this site, using command in terminal host www.domain.com
  3. add blocking rule with network option, for example:
    • 159.122.35.130$network;
    • 159.122.35.130:80$network;
  4. open Filtering Log window
  5. try open the site in browser... As result we must obtain blocking record in Filtering Log and the site page must not opened.
  6. change rule to exception rule, by add @@ prefix
  7. try open the site in browser... As result we must obtain exception record in Filtering Log and the site page must opened without filtration.

For testing UDP we may use this plan:

  1. get UDP packet sender app with UI, like that: https://packetsender.com
  2. open terminal and run UDP listener, for example on 4444 port: nc -lku 127.0.0.1 4444
  3. open UDP packet sender and send packet (any data) to 127.0.0.1 on 4444 port In this case we must see in terminal window that packet is received
  4. in Adguard Preferences, add UDP packet sender to filtering applications
  5. add blocking rule with network option: 127.0.0.1:4444$network
  6. in UDP packet sender, send packet (any data) to 127.0.0.1 on 4444 port In this case we must see in terminal window that packet is not received
  7. change rule to exception rule, by add @@ prefix
  8. in UDP packet sender, send packet (any data) to 127.0.0.1 on 4444 port In this case we must see in terminal window that packet is received