by SimeVidas · 5y ago · 0 comments
Example: The Frontend Focus newsletter in Gmail
The link of the first news headline is something like
https://www.google.com/url?q=https%3A%2F%2Ffrontendfoc.us%2Flink%2F109272%2Fc0daad1d97&sa=D&sntz=1&usg=AFQgCNFEh5TaNZpHqsqyBGWEaq2iL9MwCg
The actual URL is https://www.slashgear.com/safari-overhaul-includes-tab-groups-and-web-extensions-on-mobile-07676634/I thought it might be possible to build something like this with curl -Ls -w %{url_effective}, but seems like it only handles HTTP 302 redirects, whereas this site seems to be using Javascript, so you probably need a real crawler.
Ctrl+Alt+T
$ python3
>>> from urllib import parse
>>> parse.unquote('https%3A//www.google.com/url%3Fq%3Dhttps%3A//www.example.com/foo.php%3Fp0%3Darg0%26p1%3Darg1%26p2%3Darg2%26yoursoul%3DaXNtaW5l')
'https://www.google.com/url?q=https://www.example.com/foo.php?p0=arg0&p1=arg1&p2=arg2&yoursoul=aXNtaW5l'
>>> from base64 import b64decode as bd
>>> bd(b'aXNtaW5l')
b'ismine'
>>>
Copy into clipboard: https://www.example.com/foo.phpCtrl+D
Ctrl+D
Why I even bother in 2021?
I don't know.
I've found https://urlex.org/ useful (top DDG search result). You end up with the disambiguated link in most cases (Twitter, Bitly, and similar shorteners).
I've not looked to see how many levels of redirection/misdirection it will resolve.
You're disguising location and device information, but that's about it?
- The "hit" comes from the resolver rather than your own IP. So long as there's no referrer pass-through of personal information, your location is minimised.
- Such links often come through other social media, in my case, rather than email. In the specific case of email this practice is of little use in protecting privacy. However if you're sanitising links pulled off social media shares or the like, you're at least preventing downstream contamination.
- Another practice is to randomly scramble any visible identifiers. This presumes longer URLs, rather than shortened ones.
- In practice, I scrub any "utm-medium" or similar URI attributes as a matter of course. URLEX is helpful for expanding shortened links ... which I've not encountered so much in email, though truth be told, I've largely abandoned email for numerous reasons, the present topic included.
For the Google links, I actually use an extension to automatically restore the original URL links.
We used to ask people for their email address to unsubscribe them, but then they accused us of using a dark pattern to keep them subscribed. So letting people unsubscribe easier with fewer hoops to jump through seems like the lesser of two evils.