‹ BackHN Continuity

Thread

Self-Hosting on the Dark Web

358 points · 118 comments · mooreds

  1. ivanmontillam · · focus · HN ↗
    What I really love about Onion sites is that if they are big enough, performance engineering really becomes Tor-specific. A few examples:

    - Making assets embedded as base64 (img src the header logo as base64, all CSS should be inline, etc.).

    - Leveraging CSS as much as possible (if you use animations and transitions, use CSS as much as possible for these, avoid JS for them).

    - Make sure your website is mostly rendered on the backend. If you're to have JS, your website should work without it.

    - Security becomes REALLY fun, as in, avoid XSS, CSRF, SQL Injection attacks and any other injections as much as possible.

    As someone summarizes in another comment[0], keep the chattiness as minimal as possible. By chattiness I understand they mean, pack as much data as you can in the same Keep-Alive connection. Avoid making new HTTP requests as much as possible, as each one might get assigned to a new Onion route making things slow.

    If you can ship your website to the browser in a single connection, you've won.

    I've always been impressed by performance of these big Onion sites, they really push the limits of software engineering creativity, given these constraints and nature of Tor.

    --

    [0]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49872320">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49872320

    EDIT: Formatting of bullet points.

    1. orbital-decay · · focus · HN ↗
      Also DDoS becomes a problem, and the ways it&#x27;s done are pretty specific to Tor. Double captchas are necessary when you&#x27;re getting DDoSed, due to performance reasons. Oh, and captchas are also pretty specific to Tor as well.

      There&#x27;s also a problem of site fronting. Anyone could run a proxy pretending to be you, for arbitrary reasons (not even necessarily the obvious forging and credential stealing). Every site, even a personal blog, has dozens of parasitic fronts, either actively malicious or dormant. You need off-site ways to tell users what is the real address, and provide a smoke test for them (often a part of the address as a picture, for example in a captcha).

      &gt;avoid JS for them

      Using any JS defies the point and makes your site instantly suspicious.

      1. dalvrosa · · focus · HN ↗
        How are captchas done?
        1. ulrikrasmussen · · focus · HN ↗
          A combination of different ones, sometimes close to what you know from the clearnet, i.e. click pictures that match a description. For the proxy defeating one, the server can send you a picture of the real .onion address where some letters are blanked out, and with noise added to it to prevent it from being solved by the proxy. You then have to enter the blanked out letters from the browser URL.

          This can of course still be defeated if the proxy URL receives very few requests and just have a human in the middle to solve the CAPTCHAs. But it does make the attack non-automated.

          1. dalvrosa · · focus · HN ↗
            Thanks!
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.