The Un-Official Proxomitron Forum
Boosting Privoxy's Filtering Capabilities with Customised Filters - Printable Version

+- The Un-Official Proxomitron Forum (https://www.prxbx.com/forums)
+-- Forum: Forum Related (/forumdisplay.php?fid=37)
+--- Forum: Privoxy (/forumdisplay.php?fid=49)
+--- Thread: Boosting Privoxy's Filtering Capabilities with Customised Filters (/showthread.php?tid=2225)



Boosting Privoxy's Filtering Capabilities with Customised Filters - Faxopita - Aug. 04, 2015 02:39 PM

In connexion with your post:

(Aug. 04, 2015 11:08 AM)cattleyavns Wrote:  Block WebRTC:
Code:
FILTER: blockwebrtc
s†(^[^;]*?(?:<head[^>]*?>|<body[^>]*?>|<script[^>]*?>[^>]*?</script>))†\n<script>function NoWebRTC(e){return 1}window.RTCPeerConnection=NoWebRTC; window.webkitRTCPeerConnection=NoWebRTC; window.mozRTCPeerConnection=NoWebRTC;</script>\n$1†i

Test: https://diafygi.github.io/webrtc-ips/

I've just added the filter in my user.filter file, but fails to work on the test site. I'm having the same issue with the other filters as well. Privoxy loads the filter with success, but get “0 hits” every time I visit the test sites.

In my user.action file, I've got this:
Code:
{ +filter{blockwebrtc} }
  /

My Privoxy version: 3.0.21


RE: Boosting Privoxy's Filtering Capabilities with Customised Filters - cattleyavns - Aug. 04, 2015 02:59 PM

Hi Faxopita, okay, so '0 hits' means my filter cannot find any tags to replace with my code.

First, can you try this:
Code:
FILTER: blockwebrtc
s†(<head>)†\n<script>function NoWebRTC(e){return 1}window.RTCPeerConnection=NoWebRTC; window.webkitRTCPeerConnection=NoWebRTC; window.mozRTCPeerConnection=NoWebRTC;</script>\n$1†i

The second I think possibly, that is "†" might not work on some system (for me † is the best), so can you please try this code, I simply replace † with @:
Code:
FILTER: blockwebrtc
s@(^[^;]*?(?:<head[^>]*?>|<body[^>]*?>|<script[^>]*?>[^>]*?</script>))@\n<script>function NoWebRTC(e){return 1}window.RTCPeerConnection=NoWebRTC; window.webkitRTCPeerConnection=NoWebRTC; window.mozRTCPeerConnection=NoWebRTC;</script>\n$1@i


If my filter work, that page couldn't get my local IP, like this picture: http://i.imgur.com/6E4D5v7.png
Anyways, I will help you fix this problem until everything work fine.

SMALL AND OFF-TOPIC TIPS: By disabling Privoxy log, Privoxy will become faster.


RE: Boosting Privoxy's Filtering Capabilities with Customised Filters - Faxopita - Aug. 04, 2015 04:53 PM

Your last suggestion works. I had to replace † by @; filters anticlickjacking and blockwebrtc are both working well on my system. However, though I replaced † by @ in filter canvasblocker the result is strange: on the test site BrowserLeaks, the filter produced 1 hit (as expected I guess), but still can see my browser's fingerprint details…


RE: Boosting Privoxy's Filtering Capabilities with Customised Filters - Faxopita - Aug. 04, 2015 06:37 PM

(Aug. 04, 2015 02:59 PM)cattleyavns Wrote:  SMALL AND OFF-TOPIC TIPS: By disabling Privoxy log, Privoxy will become faster.

Hello cattleyavns, always good to know. In my case, I prefer to have a log of third-party/implicit requests so I can analyse them before I go to bed… This is how I discover new privacy-offending agents.


RE: Boosting Privoxy's Filtering Capabilities with Customised Filters - cattleyavns - Aug. 05, 2015 12:40 AM

(Aug. 04, 2015 04:53 PM)Faxopita Wrote:  Your last suggestion works. I had to replace † by @; filters anticlickjacking and blockwebrtc are both working well on my system. However, though I replaced † by @ in filter canvasblocker the result is strange: on the test site BrowserLeaks, the filter produced 1 hit (as expected I guess), but still can see my browser's fingerprint details…

Confirmed that my canvas filter only work fine on Firefox, but I remember that I tested this filter with Chrome before and it worked, that is weird and I realized that Chrome canvas fingerprinting is now different with Firefox canvas fingerprinting, so I will try to fix it, but I'm not sure.
Or maybe that website tricked my method, in the past it have worked for sure, I remembered that.


RE: Boosting Privoxy's Filtering Capabilities with Customised Filters - Faxopita - Dec. 24, 2015 11:19 PM

Canvas fingerprinting and WebRTC blockers written by Black Rider and available here. Both tested successfully on my configuration.

Code:
FILTER: CanvasBlocker
s@(\w\.getImageData\((.*?)\));|(\w\.toDataURL\((.*?)\));@@

Test here.

Code:
FILTER: WebRTCBlocker
s@<head(.*?)>@<head$1>\n<script>function NoWebRTC(e){return 1}
window.RTCPeerConnection=NoWebRTC;
window.webkitRTCPeerConnection=NoWebRTC;
window.mozRTCPeerConnection=NoWebRTC;</script>\n@i

Test here.

Code to block Javascript-written keyloggers available here. Website in French, but you can just grab the code.

Don't forget to activate these filters in user.action file.


RE: Boosting Privoxy's Filtering Capabilities with Customised Filters - cattleyavns - Dec. 26, 2015 11:52 PM

(Dec. 24, 2015 11:19 PM)Faxopita Wrote:  Canvas fingerprinting and WebRTC blockers written by Black Rider and available here. Both tested successfully on my configuration.

Code:
FILTER: CanvasBlocker
s@(\w\.getImageData\((.*?)\));|(\w\.toDataURL\((.*?)\));@@

Test here.

Code:
FILTER: WebRTCBlocker
s@<head(.*?)>@<head$1>\n<script>function NoWebRTC(e){return 1}
window.RTCPeerConnection=NoWebRTC;
window.webkitRTCPeerConnection=NoWebRTC;
window.mozRTCPeerConnection=NoWebRTC;</script>\n@i

Test here.

Code to block Javascript-written keyloggers available here. Website in French, but you can just grab the code.

Don't forget to activate these filters in user.action file.

Thank you very much for sharing keylogger blocker, I think I get some ideas from that, I can write a better version of it, and a better version of Canvas Blocker.

The CanvasBlocker you shared above is a nice solution for all web browser, it is sad that my version only works on Firefox and til now I still have no solution to make it works on Chrome.

I have some interesting filters to boost user privacy too, just check: http://www.prxbx.com/forums/showthread.php?tid=2223&pid=18507#pid18507


RE: Boosting Privoxy's Filtering Capabilities with Customised Filters - Faxopita - Dec. 27, 2015 08:20 PM

Hi Cattleyavns, it's been a long time since our last talk. Glad you're happy with the rules. It would indeed be excellent if you could make CanvasBlocker rock solid in the future.

Thanks again for sharing your filters.


RE: Boosting Privoxy's Filtering Capabilities with Customised Filters - vlad_s - Nov. 05, 2017 09:34 PM

(Dec. 24, 2015 11:19 PM)Faxopita Wrote:  Canvas fingerprinting and WebRTC blockers written by Black Rider and available here. Both tested successfully on my configuration.

Code:
FILTER: CanvasBlocker
s@(\w\.getImageData\((.*?)\));|(\w\.toDataURL\((.*?)\));@@

Test here.

Hello! A good filter, but the site https://yandex.ru/maps/ breaks down, I do not see the map. I have your filter located first:

Code:
+filter{adsbygoogle}
+filter{CanvasBlocker}
+filter{WebRTCBlocker}

/.*

then below it goes:

Code:
-filter{CanvasBlocker}
-filter{WebRTCBlocker}
+filter{yandex-maps}

yastatic.net/maps-beta/build/chunks/home/
yandex.ru/maps/

But the filter does not turn off. I would like to fix it. Thank you!


RE: Boosting Privoxy's Filtering Capabilities with Customised Filters - Faxopita - Nov. 07, 2017 12:14 PM

Hi vlad_s!

I think proceeding that way may help:
Code:
{+filter{adsbygoogle}}
/
{+filter{CanvasBlocker}}
/
{+filter{WebRTCBlocker}}
/

{-filter{CanvasBlocker}}
/(.*/)?maps?(-|/)

{-filter{WebRTCBlocker}}
/(.*/)?maps?(-|/)



RE: Boosting Privoxy's Filtering Capabilities with Customised Filters - vlad_s - Nov. 07, 2017 08:22 PM

In Firebug, an error appears in the console. The previous time it was the same. The problem is only because of the canvas filter.
[Image: 4nLOJ8O35X_thumb.jpg]


RE: Boosting Privoxy's Filtering Capabilities with Customised Filters - vlad_s - Feb. 23, 2018 08:38 AM

https://ipper.ru/ still determines the fingerprint.