←back to thread

379 points mobeigi | 3 comments | | HN request time: 0.444s | source
Show context
DanielHB ◴[] No.41869510[source]
I want to share a story in a somewhat related topic:

anti web-scraping techniques

The most devious version I ever seen of this, I was baffled, astonished and completely helpless:

This website I was trying to scrap generated a new font (as in a .woff file) on every request, the font had the position of the letters randomly moved around (for example, the 'J' would be in place of the 'F' character in the .woff and so on) and the text produced by the website would be encoded to match that specific font.

So every time you loaded the website you got a completely different font with a completely different text, but for the user the text would look fine because the font mapped it to the original characters. If you tried to copy-and-paste the text from the website you would get some random garbled text.

The only way I could think of to scrap that would have been to OCR the .woff font files, but OCR could easily prevent mass-scraping due to sheer processing costs.

replies(7): >>41869674 #>>41869684 #>>41869775 #>>41869796 #>>41869877 #>>41870330 #>>41871277 #
1. sebstefan ◴[] No.41869775[source]
If it's just swapping letters then rather than trying to dive into the WOFF you could just get the garbled data and treat it as a cesar cypher, I guess. A few dozen rotations and you're through

It's kind of annoying and prone to break but I'd rather have that than whatever Facebook is doing where every class name, ID & identifiable tags in the markup gets randomly generated every once in a while

replies(2): >>41870310 #>>41872578 #
2. wbl ◴[] No.41870310[source]
Could be an arbitrary permutation or worse have multiple equivalent characters. Fonts can do a lot.
3. Apofis ◴[] No.41872578[source]
That likely wouldn't work, doesn't mean the letters were simply rotated. Would probably be just random.