Lurker News
Back to discussion

Comment by nuccy

nuccy1 reply#
Instead of blocking by IP, just check SERVER_NAME/HTTP_SERVER variables in your backend/web server (or even in JavaScript of the page check window.location.hostname) and in case those include anything but original hostname, redirect to the original website (or serve different content with a warning to the visitor). If you have apache2/nginx this can be easily achieved by creating a default virtualhost (which is not your website), and additionally creating explicitly your website virtualhost. Then the default virtualhost can have a proper redirect while serving any other hostname.

Those variables are populated by the browser, unless proxying server is rewring them, your web-server will be able to detect imposter and serve him/her with a redirect. If rewrites are indeed in place, then check in the frontend. Blocking by IP is the last option if nothing else works.

michaelmior2 replies#
As the OP mentioned, JS is stripped and URLs are being written, so I doubt either of those approaches will work.
nuccy4 replies#
Making js essential is not that hard, right? Just "display: none" on the root element, which is removed by js :)

More sophisticated options can been found in other comments.

nuccy1 reply#
The other kind of problem is if the website is not really proxied but rather dumped, patched and re-served. In such case the only option (if JavaScript frontend redirect doesn't work) is blocking by IP the dumping server.

To identify IPs, as pointed in the root comment of this thread, you can create a one-pixel link to a dummy page, which dumping software would visit, but a human wouldn't. So you will see who visited that specific page and block those IPs for good.

Continue this thread — 1 reply

michaelmior13 replies#
Forcing all users of your website to use JavaScript to get around a scammer is pretty heavy-handed.

Continue this thread — 13 replies

tofuahdude#
Tail wagging the dog is never a good answer.
klyrs1 reply#
It's trivial to strip that "display: none" out, too.

Continue this thread — 1 reply

mnutt1 reply#
Maybe an html redirect tag that bounces through a tertiary domain before redirecting to your real one? If they noticed you were doing it they could mitigate it, but they might deem it too much effort and just go away.

You might also start with the hypothesis that they're using regex for JS removal and try various script injection tricks...

michaelmior#
If they're already stripping JS, I can't imagine it would be a lot of work to also remove the redirect.