Community discussions

MikroTik App
 
User avatar
macsrwe
Forum Guru
Forum Guru
Topic Author
Posts: 1007
Joined: Mon Apr 02, 2007 5:43 am
Location: Arizona, USA
Contact:

Simple outgoing URL substitution

Sun Jan 15, 2023 3:07 am

I thought I would "try something simple" today, and (of course) it wasn't.
I thought I would try to set up a rule to redirect all references to amazon.com or www.amazon.com from my LAN to go to smile.amazon.com instead, for the obvious reasons.
First I tried using the proxy, as suggested here. It didn't work, probably because the advice was from 2008 and since then, all traffic is https-itized at the earliest possible opportunity.
Then I tried using DNS static with a regexp of ^(www\.|)amazon\.com (this is from Winbox, not Terminal, so the backslash levels are OK). But it doesn't do anything. I've flushed my computer's DNS cache, and I know the MikroTik's DNS feature is enabled properly because I use it for other stuff.
Is there an easy way to do this?
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3250
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Simple outgoing URL substitution

Sun Jan 15, 2023 5:19 am

Mikrotik DNS won't re-write the HTTP request's host headers. So I suspect AWS's backend uses the Host: header generated by the browser, regardless if smile.amazon.com uses a different IP in DNS.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11433
Joined: Thu Mar 03, 2016 10:23 pm

Re: Simple outgoing URL substitution

Sun Jan 15, 2023 2:48 pm

Is there an easy way to do this?

As @Amm0 already hinted: it's impossible to do it without client noticing it this way or another.
OK, some security agency with good business contacts with either amazon or digicert (issuer of amazon certificates) or both could do it, but you can't.

The only possibility would be to run some adcanced proxy (MT's own is not) and then you'd have to explicitly configure client (browser) to use that proxy. Such configuration means that verification of server is delegated to proxy (by client) and then you can start playing dirty (or charitable :wink:).
 
User avatar
macsrwe
Forum Guru
Forum Guru
Topic Author
Posts: 1007
Joined: Mon Apr 02, 2007 5:43 am
Location: Arizona, USA
Contact:

Re: Simple outgoing URL substitution

Thu Jan 19, 2023 3:18 am

Amazing timing! The problem solved itself!
Today, Amazon announced they will be discontinuing Amazon Smile as of February 20. :(

Who is online

Users browsing this forum: Bing [Bot], giovanniv and 82 guests