tordam

A library for peer discovery inside the Tor network
git clone https://git.parazyd.org/tordam
Log | Files | Refs | README | LICENSE

commit a0c32a9239b34025ed8c700e4daa1e200b3b9bc0
parent 64624b0a842c5cbee96503d7a347b5bec1711161
Author: parazyd <parazyd@dyne.org>
Date:   Sun,  7 Mar 2021 20:25:04 +0100

Remove old files.

Diffstat:
Dcontrib/README.md | 43-------------------------------------------
Dcontrib/echo_recv.py | 38--------------------------------------
Dcontrib/echo_send.py | 41-----------------------------------------
Dcontrib/gource.go | 59-----------------------------------------------------------
Dcontrib/network.gif | 0
5 files changed, 0 insertions(+), 181 deletions(-)

diff --git a/contrib/README.md b/contrib/README.md @@ -1,43 +0,0 @@ -contrib -======= - -Some files here could be helpful for you to find a usecase for tor-dam. - -### `echo_send.py` and `echo_recv.py` - -These two Python programs can be seen as a reference echo client/server -implementation for working over SOCKS5. With these, you can use some -onion address and port created and opened by tor-dam. - -``` -$ tor-dam -p "6969:6969" -d ./echo-dam -$ sleep 1 -$ hostname="$(cat ./echo-dam/hs/hostname)" -$ ./echo_recv.py -l 127.0.0.1 -p 6969 & -$ ./echo_send.py -a "$hostname" -p 6969 -t "$torsocksport" -``` - -N.B. You can find `$torsocksport` using `netstat(8)` or whatever -similar too. - - -### `gource.go` - -This is a Golang implementation of a Redis pubsub client, and was used -to create [network.gif](network.gif) that can be seen in this directory. -The internal format used for publishing is: - -``` -%s|%s|%s|%s -``` - -which translates to: - -``` -timestamp|onion_address|modification_type|onion_address -``` - -``` -$ redishost="127.0.0.1:35918" # You can find this in netstat -$ go run gource.go -r "$redishost" | gource --log-format custom - -``` diff --git a/contrib/echo_recv.py b/contrib/echo_recv.py @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2017-2021 Ivan Jelincic <parazyd@dyne.org> -# -# This file is part of tor-dam -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - -from argparse import ArgumentParser -from socket import socket, AF_INET, SOCK_STREAM - -parser = ArgumentParser() -parser.add_argument('-l', '--listen', default='127.0.0.1') -parser.add_argument('-p', '--port', default=5000) -args = parser.parse_args() - -s = socket(AF_INET, SOCK_STREAM) -s.bind((args.listen, args.port)) -s.listen(1) - -conn, ddr = s.accept() -while 1: - data = conn.recv(1024) - if not data: - break - print(data) - conn.send(data) -conn.close() diff --git a/contrib/echo_send.py b/contrib/echo_send.py @@ -1,41 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2017-2021 Ivan Jelincic <parazyd@dyne.org> -# -# This file is part of tor-dam -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <https://www.gnu.org/licenses/>. - -from argparse import ArgumentParser -from socket import socket, AF_INET, SOCK_STREAM - -import socks - -parser = ArgumentParser() -parser.add_argument('-a', '--address', default='some.onion') -parser.add_argument('-p', '--port', default=5000) -parser.add_argument('-t', '--tor', default='127.0.0.1:9050') -args = parser.parse_args() - -if '.onion' in args.address: - s = socks.socksocket(AF_INET, SOCK_STREAM) - s.set_proxy(socks.SOCKS5, args.tor.split()[0], int(args.tor.split()[1])) -else: - s = socket(AF_INET, SOCK_STREAM) - -s.connect((args.address, args.port)) -s.send(b'HELLO') -data = s.recv(1024) -s.close() - -print(data) diff --git a/contrib/gource.go b/contrib/gource.go @@ -1,59 +0,0 @@ -package main - -/* - * Copyright (c) 2017-2021 Ivan Jelincic <parazyd@dyne.org> - * - * This file is part of tor-dam - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -import ( - "context" - "flag" - "fmt" - "log" - - "github.com/go-redis/redis" -) - -var ( - redisAddr = flag.String("-r", "127.0.0.1:39148", "host:port for redis") - rctx = context.Background() - rcli *redis.Client -) - -func main() { - flag.Parse() - - rcli = redis.NewClient(&redis.Options{ - Addr: *redisAddr, - Password: "", - DB: 0, - }) - - // "tordam" is the hardcoded name of the channel - pubsub := rcli.Subscribe(rctx, "tordam") - _, err := pubsub.Receive(rctx) - if err != nil { - log.Fatal(err) - } - - log.Println("Subscribed to channel in redis") - - ch := pubsub.Channel() - for msg := range ch { - fmt.Println(msg.Payload) - } -} diff --git a/contrib/network.gif b/contrib/network.gif Binary files differ.