oniongrok forwards ports on the local host to remote Onion addresses as Tor hidden services and vice-versa

oniongrok

Onion addresses for anything.

oniongrok forwards ports on the local host to remote Onion addresses as Tor hidden services and vice-versa.

Why would I want to use this?

oniongrok is a decentralized way to create virtually unstoppable global network tunnels.

For example, you might want to securely publish and access a personal service from anywhere in the world, across all sorts of network obstructions -- your ISP doesn't allow ingress traffic to your home lab, your clients might be in heavily firewalled environments (public WiFi, mobile tether), etc.

With oniongrok, that service doesn't need a public IPv4 or IPv6 ingress. You'll eventually be able to restrict access with auth tokens. And you don't need to rely on, and share your personal data with for-profit services (like Tailscale, ZeroTier, etc.) to get to it.

How do I build it?

Local build

Should work on: Linux, Darwin, Android (gomobile) according to the berty.tech/go-libtor README.

In a local clone of this project,

make

This will take a long time the first time you build, because it compiles CGO wrappers for Tor and its dependencies.

You'll need to have C library dependencies installed for the build to work:

  • tor
  • openssl
  • libevent
  • zlib

If you're on NixOS, you can run nix-shell in this directory to get these dependencies installed into your shell context.

Docker

The provided Dockerfile builds a minimal image that can run oniongrok in a container. Build is Debian-based, runtime is distroless.

What can I do with it right now?

Currently, you can publish local services as ephemeral Tor hidden services.

For example:

# Forward localhost port 8000 to remote onion port 8000
oniongrok 8000

# Forward localhost port 8000 to remote onion port 80
oniongrok 8000=80

# Forward local interface 8000 to remote onion ports 80, 8080
# and forward local port 9090 to remote port 9090.
oniongrok 192.168.1.100:8000=80,8080,9000

# Forward remote onion port 80 to localhost port 80
oniongrok xxx.onion:80

# Forward remote onion port 80 to local port 80 on all interfaces
oniongrok xxx.onion:80=0.0.0.0:80

# Forward port 80 on Docker host
docker run --rm ghcr.io/cmars/oniongrok:main host.docker.internal:80

Running with Docker is similar, though you'll need to provide local interface IP addresses that route inside the container. Currently these are not DNS resolved, but if you know the address of your host on the container,

docker run --rm ghcr.io/cmars/oniongrok:main 192.168.65.1:8000

If you're using Podman, exposing the local host network is another option.

podman run --network=host --rm ghcr.io/cmars/oniongrok:main 8000 

What features are planned?

  • Client authentication tokens
  • Configurable hops policy (trade anonymity for performance)
  • Persistent addresses.
  • Option to define forwards in a JSON or YAML config file

For example:

# Forward auth-protected remote onion port 22 to localhost port 2222.
oniongrok --auth hunter2 xxx.onion:22=2222

# Forward local port 22, requiring auth to connect (token will be displayed)
oniongrok --auth-generate 22

# Persistent key stored as "myhttpserver" to $XDG_DATA_HOME/oniongrok/myhttpserver
oniongrok 8000=80@myhttpserver

# Operate from a yaml file.
oniongrok --config config.yaml

I'd also like to support more platforms, and eventually some package managers (brew, NixOS, choco if we get Windows).

How can I contribute?

Pull requests are welcome in implementing the above wishlist / planned functionality.

Otherwise, donate to the Tor project with your dollar, or by hosting honest proxies and exit nodes. If you like and use this project, it only further proves the point that Tor is essential public infrastructure that benefits us all and needs our support.

Owner
Comments
  • SyncThing web GUI

    SyncThing web GUI

    Great project, thanks.

    Doesn't work with WEB GUI Syncthing (8384) - "Host check error". However, python -m http.server works as it should.

    Client site - Win10 + TorBrowser. Second site - Ubuntu 20.04.

  • [Snyk] Security upgrade debian from bullseye to 11

    [Snyk] Security upgrade debian from bullseye to 11

    This PR was automatically created by Snyk using the credentials of a real user.


    Keeping your Docker base image up-to-date means you’ll benefit from security fixes in the latest version of your chosen image.

    Changes included in this PR

    • build/Dockerfile

    We recommend upgrading to debian:11, as this image has only 43 known vulnerabilities. To do this, merge this pull request, then verify your application still works as expected.

    Some of the most important vulnerabilities in your base image include:

    | Severity | Priority Score / 1000 | Issue | Exploit Maturity | | :------: | :-------------------- | :---- | :--------------- | | low severity | **** | CVE-2022-1664
    SNYK-DEBIAN11-DPKG-2847942 | No Known Exploit | | critical severity | **** | OS Command Injection
    SNYK-DEBIAN11-OPENSSL-2807596 | No Known Exploit | | critical severity | 500 | Out-of-bounds Read
    SNYK-DEBIAN11-PCRE2-2808697 | No Known Exploit | | critical severity | 500 | Out-of-bounds Read
    SNYK-DEBIAN11-PCRE2-2808704 | No Known Exploit | | low severity | 150 | Information Exposure
    SNYK-DEBIAN11-UTILLINUX-2401081 | No Known Exploit |


    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

    For more information: 🧐 View latest project report

    🛠 Adjust project settings


    Learn how to fix vulnerabilities with free interactive lessons:

    🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.

  • [Snyk] Security upgrade debian from bullseye to 11

    [Snyk] Security upgrade debian from bullseye to 11

    This PR was automatically created by Snyk using the credentials of a real user.


    Keeping your Docker base image up-to-date means you’ll benefit from security fixes in the latest version of your chosen image.

    Changes included in this PR

    • Dockerfile

    We recommend upgrading to debian:11, as this image has only 43 known vulnerabilities. To do this, merge this pull request, then verify your application still works as expected.

    Some of the most important vulnerabilities in your base image include:

    | Severity | Priority Score / 1000 | Issue | Exploit Maturity | | :------: | :-------------------- | :---- | :--------------- | | low severity | 436 | CVE-2022-1664
    SNYK-DEBIAN11-DPKG-2847942 | No Known Exploit | | critical severity | 500 | OS Command Injection
    SNYK-DEBIAN11-OPENSSL-2807596 | No Known Exploit | | critical severity | 500 | Out-of-bounds Read
    SNYK-DEBIAN11-PCRE2-2808697 | No Known Exploit | | critical severity | 500 | Out-of-bounds Read
    SNYK-DEBIAN11-PCRE2-2808704 | No Known Exploit | | low severity | 150 | Information Exposure
    SNYK-DEBIAN11-UTILLINUX-2401081 | No Known Exploit |


    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

    For more information: 🧐 View latest project report

    🛠 Adjust project settings


    Learn how to fix vulnerabilities with free interactive lessons:

    🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.

  • [Snyk] Security upgrade debian from bullseye to 11

    [Snyk] Security upgrade debian from bullseye to 11

    This PR was automatically created by Snyk using the credentials of a real user.


    Keeping your Docker base image up-to-date means you’ll benefit from security fixes in the latest version of your chosen image.

    Changes included in this PR

    • build/Dockerfile

    We recommend upgrading to debian:11, as this image has only 43 known vulnerabilities. To do this, merge this pull request, then verify your application still works as expected.

    Some of the most important vulnerabilities in your base image include:

    | Severity | Issue | Exploit Maturity | | :------: | :---- | :--------------- | | low severity | CVE-2022-1271
    SNYK-DEBIAN11-GZIP-2444256 | No Known Exploit | | low severity | CVE-2022-1292
    SNYK-DEBIAN11-OPENSSL-2807596 | No Known Exploit | | low severity | CVE-2022-1587
    SNYK-DEBIAN11-PCRE2-2808697 | No Known Exploit | | low severity | CVE-2022-1586
    SNYK-DEBIAN11-PCRE2-2808704 | No Known Exploit | | low severity | CVE-2022-1271
    SNYK-DEBIAN11-XZUTILS-2444276 | No Known Exploit |


    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

    For more information: 🧐 View latest project report

    🛠 Adjust project settings


    Learn how to fix vulnerabilities with free interactive lessons:

    🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.

  • [Snyk] Security upgrade debian from bullseye to 11

    [Snyk] Security upgrade debian from bullseye to 11

    This PR was automatically created by Snyk using the credentials of a real user.


    Keeping your Docker base image up-to-date means you’ll benefit from security fixes in the latest version of your chosen image.

    Changes included in this PR

    • Dockerfile

    We recommend upgrading to debian:11, as this image has only 43 known vulnerabilities. To do this, merge this pull request, then verify your application still works as expected.

    Some of the most important vulnerabilities in your base image include:

    | Severity | Priority Score / 1000 | Issue | Exploit Maturity | | :------: | :-------------------- | :---- | :--------------- | | low severity | 364 | CVE-2022-1271
    SNYK-DEBIAN11-GZIP-2444256 | No Known Exploit | | low severity | 221 | CVE-2022-1292
    SNYK-DEBIAN11-OPENSSL-2807596 | No Known Exploit | | low severity | 221 | CVE-2022-1587
    SNYK-DEBIAN11-PCRE2-2808697 | No Known Exploit | | low severity | 221 | CVE-2022-1586
    SNYK-DEBIAN11-PCRE2-2808704 | No Known Exploit | | low severity | 150 | CVE-2022-1271
    SNYK-DEBIAN11-XZUTILS-2444276 | No Known Exploit |


    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

    For more information: 🧐 View latest project report

    🛠 Adjust project settings


    Learn how to fix vulnerabilities with free interactive lessons:

    🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.

  • fix: improve embedded Tor static build

    fix: improve embedded Tor static build

    Replace go-libtor with local static build of latest Tor stable release.

    Linux build uses Docker for distro-independence; other OSes will likely run directly on a $GOOS VM.

  • chore!: rebrand as onionpipe

    chore!: rebrand as onionpipe

    Trademark disputes can leave a project like this one vulnerable to seizure and takeover by well-funded parties.

    Even though "onion" is a vegetable and "grok" is jargon-speak, best to steer clear. Those who have the most gold will write the rules.

    So this project is rebranding as onionpipe. Which is probably a better name and brand for what this is anyway.

    BREAKING CHANGE: rename of all packages & artifacts.

  • feat: preliminary client auth and local identity management

    feat: preliminary client auth and local identity management

    Add client subcommands for managing local client public key identities, and backend support for requiring and providing client authorization for secure, private onion access.

    New flags added to oniongrok [forward]:

    --require-auth <public key1>[,public key2,...] requires client public key authorization for remote onions being exported in a forward. The list is a list of client public x25519 keys, base32 encoded with no padding.

    --auth <private key or name> specifies the client authorization to use when importing remote onions to a local address.

  • Example docker-compose.yml

    Example docker-compose.yml

    Dunno if you'd find this useful anywhere in your documentation but this works for me.

    version: "3.7"
    services:
      oniongrok:
        image: ghcr.io/cmars/oniongrok:main
        ## You will need to consider changing the command.
        command: "--secrets /data/.local/share/oniongrok/secrets.json sign:80~80@sign"
        volumes:
          - ./data/:/data/.local/share/oniongrok/
    
    ## Demo App, Could be anything.
      sign:
        image: 'eerotal/libresignage:latest'
        volumes:
          - ./data/sign:/var/www/html/data'
    

    At some point, I think it might not be a horrible idea to potentially look at making one of these examples that use the Traefik reverse proxy for fun and research. Especially if that example just uses docker labels.

serve a static website as a .onion hidden service

hidden service server A CLI that will host a static website as a .onion hidden service. Comes with an additional binary that can be used to generate v

Sep 4, 2022
Simple Relay between a Unix socket and a TCP socket, and vice versa.
Simple Relay between a Unix socket and a TCP socket, and vice versa.

Simple TCP <-> Unix Relay simpletcpunixrelay is a program which exposes a TCP endpoint as a Unix socket and vice versa. Usecase Let's say you are runn

Nov 23, 2022
Onion addresses for anything.

onionpipe Onion addresses for anything. onionpipe forwards ports on the local host to remote Onion addresses as Tor hidden services and vice-versa. Wh

Jan 1, 2023
A simple calculator to return the final price with the input included percentage or vice versa

ccl A simple calculator in Golang and Cobra to return the final price with the i

Oct 10, 2022
Automatically exposes the remote container's listening ports back to the local machine

Auto-portforward (apf) A handy tool to automatically set up proxies that expose the remote container's listening ports back to the local machine. Just

Dec 15, 2022
EasyAgent is an infrastructure component, applied to manage the life-cycle of services on the remote host.
EasyAgent is an infrastructure component, applied to manage the life-cycle of services on the remote host.

Easyagent English | 中文 介绍 easyagent是在袋鼠云内部广泛使用的基础架构组件,最佳应用场景包括ELK体系beats等数据采集器的管控和配置管理、数栈体系自动化部署等 基本原理 easyagent主要有sidecar和server两个组件,sidecar部署在主机端,si

Nov 24, 2022
Server that forwards the tx to the specified smart contract

tx-forwarder Server that forwards the tx to the specified smart contract. Usage In production use ./tx-forwarder, in development use go run main.go in

Dec 6, 2021
A simple DNS forwarder that forwards DNS queries to various upstreams

A simple DNS forwarder that forwards DNS queries to various upstreams. If an upstream returns NXDomain, the next upstream is tried.

Jul 8, 2022
rconn is a multiplatform program for creating generic reverse connections. Lets you consume services that are behind firewall or NAT without opening ports or port-forwarding.
rconn is a multiplatform program for creating generic reverse connections. Lets you consume services that are behind firewall or NAT without opening ports or port-forwarding.

rconn (r[everse] conn[ection]) is a multiplatform program for creating reverse connections. It lets you consume services that are behind NAT and/or fi

Jan 1, 2023
The rest api that can manage the iptables rules of the remote host

fiewall-api firewall api是基于firewalld来远程管理iptables规则的rest-api,无需部署agent Features 指定一个主机ip,让这个主机上的iptables增加一个规则 处理单个IP或CIDR范围(xx.xx.xx.xx/mask,mac,inte

Mar 24, 2022
Application wirtten in GO to check if the port on the remote host is open

portcheck A simple Pod that get API POST request with port type and number with a target's IP address and checks if the destination port is available

Nov 26, 2021
Shrek is a vanity .onion address generator written in Go.
Shrek is a vanity .onion address generator written in Go.

Shrek Shrek is a vanity .onion address generator written in Go. Usage (CLI) Shrek compiles to a single binary that can be used on the CLI. To build an

Aug 16, 2022
A library for working with IP addresses and networks in Go

IPLib I really enjoy Python's ipaddress library and Ruby's ipaddr, I think you can write a lot of neat software if some of the little problems around

Dec 20, 2022
Verify IP addresses of respectful crawlers like Googlebot by reverse dns and forward dns lookups
Verify IP addresses of respectful crawlers like Googlebot by reverse dns and forward dns lookups

goodbots - trust but verify goodbots verifies the IP addresses of respectful crawlers like Googlebot by performing reverse dns and forward dns lookups

Aug 16, 2022
Given a list of domains, you resolve them and get the IP addresses.
Given a list of domains, you resolve them and get the IP addresses.

resolveDomains Given a list of domains, you resolve them and get the IP addresses. Installation If you want to make modifications locally and compile

Oct 19, 2022
A little tool to test IP addresses quickly against a geolocation and a reputation API

iptester A little tool to test IP addresses quickly against a geolocation and a

May 19, 2022
Remake of the original sqlifinder but in GOlang, and allows for listed targets, domain crawling, and tor connections
Remake of the original sqlifinder but in GOlang, and allows for listed targets, domain crawling, and tor connections

_______ _____ _____ _______ _____ __ _ ______ _______ ______ |______ | __| | | |______ | | \ | | \ |______ |_____/

Jan 4, 2023
Local development against a remote Kubernetes or OpenShift cluster
Local development against a remote Kubernetes or OpenShift cluster

Documentation - start here! ** Note: Telepresence 1 is being replaced by our even better Telepresence 2. Please try Telepresence 2 first and report an

Jan 8, 2023
An experimental Tor-Proxy serivce written in Go using Go-proxy and Go-libtor.

tor-proxy An experimental standalone tor-proxy service built with Go, using go-proxy, go-libtor and bine. This is a simple replacement to Tor's origin

Nov 9, 2022