Hacker News new | ask | show | jobs
by noident 462 days ago
WhatsApp and Telegram are hardly replacements for Tor access. A government can block them easily.

The onion service's days were numbered after they fired Runa Sandvik. I'm surprised it lasted this long. Looking at the pay and current labor disputes, it seems like the New York Times isn't a good place for a skilled software engineer to work these days.

They'll keep running SecureDrop over an onion service, right...?

4 comments

Runa was a gem. Her firing was a huge blow to the company. Nobody of any note lasts very long at NYT.
Amen to that. I should have known she was behind the Tor link, which I used often. I'm disappointed in the Times. Nothing new there.
> WhatsApp and Telegram are hardly replacements for Tor access. A government can block them easily.

Also, you tell a private company information that you are reading the NYT and which articles you read. If the NYT is banned or a signal of suspicion where you live, that doesn't help.

Yeah only last year a court in Spain ruled to block telegram for everyone after some minor civil law disagreement. I had to scramble to set up an MTProxy for me and my friends (which was pretty easy with docker). Fortunately it never happened because the government called them back.
Lol it is not hard to create a hidden service:

Prerequisites:

- Linux: You may need `sudo` privileges to install Tor and modify system files.

- macOS: Homebrew must be installed (`brew`) to manage Tor.

- A web server must already be running on the specified local port (e.g., 8080).

- Firewall: This function does not configure the firewall. Ensure that:

  - Tor’s default port (9050) is allowed.
  - Your web server’s port (e.g., 8080) is accessible locally.


  #!/usr/bin/env bash

  # Function to add a Tor hidden service for a local web server
  add_tor_hidden_service() {
    local local_port="${1:-8080}"  # Default to 8080 if no port is provided
    local torrc=""
    local tordir=""
    local sudo_cmd=""
    local os_type=""

    # Detect OS and set paths
    if [[ "$OSTYPE" == "linux-gnu"* ]]; then
      os_type="linux"
      torrc="/etc/tor/torrc"
      tordir="/var/lib/tor"
      sudo_cmd="sudo -n"
    elif [[ "$OSTYPE" == "darwin"* ]]; then
      os_type="macos"
      torrc="$(brew --prefix)/etc/tor/torrc"
      tordir="$(brew --prefix)/var/lib/tor"
    else
      echo "Error: Unsupported OS (Linux or macOS required)" >&2
      return 1
    fi

    # Install Tor if not already installed
    if ! command -v tor &>/dev/null; then
      echo "Installing Tor..." >&2
      if [[ "$os_type" == "linux" ]]; then
        if [ -f /etc/debian_version ]; then
          $sudo_cmd apt update && $sudo_cmd apt install -y tor
        elif [ -f /etc/redhat-release ]; then
          $sudo_cmd yum install -y tor || $sudo_cmd dnf install -y tor
        else
          echo "Error: Only Debian or RedHat-based Linux supported" >&2
          return 1
        fi
      elif [[ "$os_type" == "macos" ]]; then
        brew install tor
      fi
    fi

    # Ensure Tor is running
    if [[ "$os_type" == "linux" ]]; then
      $sudo_cmd systemctl start tor
    elif [[ "$os_type" == "macos" ]]; then
      brew services start tor
    fi

    # Configure hidden service
    local hidden_service_dir="$tordir/hidden_service_$local_port"
    local dir_line="HiddenServiceDir $hidden_service_dir"
    local port_line="HiddenServicePort 80 127.0.0.1:$local_port"

    if ! grep -qF -- "$dir_line" "$torrc"; then
      echo "Configuring Tor hidden service..." >&2
      echo "$dir_line" | $sudo_cmd tee -a "$torrc" >/dev/null
      echo "$port_line" | $sudo_cmd tee -a "$torrc" >/dev/null
    fi

    # Restart Tor to apply changes
    echo "Restarting Tor..." >&2
    if [[ "$os_type" == "linux" ]]; then
      $sudo_cmd systemctl restart tor
    elif [[ "$os_type" == "macos" ]]; then
      brew services restart tor
    fi

    # Wait for onion address to be generated
    local onion_address=""
    for attempt in {1..30}; do
      if [[ -f "$hidden_service_dir/hostname" ]]; then
        onion_address=$($sudo_cmd cat "$hidden_service_dir/hostname")
        break
      fi
      sleep 1
    done

    if [[ -z "$onion_address" ]]; then
      echo "Error: Failed to generate onion address" >&2
      return 1
    fi

    echo "Success! Your web server is now available on the Tor network." >&2
    echo "Onion address: $onion_address" >&2
    echo "$onion_address"
  }

  # Example usage
  # serve -p 8080
  # add_tor_hidden_service 8080
  add_tor_hidden_service "$@"
Tested on macOS, probably good in other OS listed above. So run a server on a port. Then run this function. Boom, you have a hidden service.

Mining for a nice vanity hostname might be more difficult tho! How would that be done?

> Mining for a nice vanity hostname might be more difficult tho! How would that be done?

https://community.torproject.org/onion-services/advanced/van...

Nice, this is cool, too: Onionmine hahaha :)

https://onionservices.torproject.org/apps/web/onionmine/