Skip to content

Implemented '--tor inside' option to run inside of the Tor-connected virtual machine#484

Open
yurivict wants to merge 10 commits intoHelloZeroNet:masterfrom
yurivict:tor-inside
Open

Implemented '--tor inside' option to run inside of the Tor-connected virtual machine#484
yurivict wants to merge 10 commits intoHelloZeroNet:masterfrom
yurivict:tor-inside

Conversation

@yurivict
Copy link
Copy Markdown

@yurivict yurivict commented Jun 5, 2016

This implements my suggestion: #474

I tested ZN inside the Tor-connected VM and it works fine.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 5, 2016

Current coverage is 47.95%

Merging #484 into master will decrease coverage by 0.50%

@@             master       #484   diff @@
==========================================
  Files            55         56     +1   
  Lines          6579       6725   +146   
  Methods           0          0          
  Messages          0          0          
  Branches       1379       1401    +22   
==========================================
+ Hits           3188       3225    +37   
- Misses         2993       3098   +105   
- Partials        398        402     +4   

Powered by Codecov. Last updated by 523a7d4...257fd7e

@yurivict
Copy link
Copy Markdown
Author

yurivict commented Jun 5, 2016

The new --tor_hidden_services option expects the file containing the hidden services in this format:
{hs1-address}.onion
-----BEGIN RSA PRIVATE KEY-----
{hs1-private-key}
-----END RSA PRIVATE KEY-----
...
...
The same port that is used to listen for the file requests is expected to be routed from those onion services to the VM.

Onions can be generated using Shallot (https://github.com/katmagic/Shallot):

shallot a | grep -v '^\-*$' | sed -e 's/.*tries: //'

@yurivict yurivict changed the title Implemented '--tor inside' option to run inside of the Tor-conneted virtual machine Implemented '--tor inside' option to run inside of the Tor-connected virtual machine Jun 5, 2016
@yurivict
Copy link
Copy Markdown
Author

yurivict commented Jun 7, 2016

Please hold this. I need to troubleshoot some issues first with my setup. I will update this PR's patch when done and when I will see that it works 100%.

@HelloZeroNet
Copy link
Copy Markdown
Owner

OK,, I think renaming to --tor manual would be more straightforward, because it could be also useful without VM

@yurivict
Copy link
Copy Markdown
Author

yurivict commented Jun 7, 2016

Ok

@yurivict
Copy link
Copy Markdown
Author

yurivict commented Jun 7, 2016

Actually, this mode can't work outside of the VM, because it needs DNS resolution hooked up to Tor and IP routed through Tor, which I never saw to be done outside of the VM.

The possible environments are:

  • Whonix VM
  • Qubes VM
  • VM connected with vm-to-tor on FreeBSD (my project https://github.com/yurivict/vm-to-tor)
    One probably could make a whole network hooked to Tor, but this isn't a practical setup.

So I am not very excited by the name "manual" here because it doesn't reflect what it is very well. Maybe we should name it "embedded"? "Embedded" reflects the meaning better, because ZN is "embedded" into the Tor-VM environment ?

@yurivict
Copy link
Copy Markdown
Author

@HelloZeroNet Hi, I finished this feature. Tested it in VM, ZN works without any problems.

So do you agree to rename it into "embedded":
--tor embedded --tor_hidden_services /path/to/hs-file

@Adrianzo
Copy link
Copy Markdown

I'd also like this implemented. Good work!

@yurivict
Copy link
Copy Markdown
Author

Thanks!

I use it in a VM ever since I implemented it 1.5 months ago without a problem.

@tlaurion
Copy link
Copy Markdown

tlaurion commented Feb 15, 2019

@HelloZeroNet Why is this PR not merged?
@yurivict : could you rebase?

@tlaurion
Copy link
Copy Markdown

tlaurion commented Mar 13, 2019

@yurivict testing inside QubesOS whonix-14-ws qube, following zeronet unworking guide which permits access but not hosting sites (@adrelanos !!!)

git checkout -f yurivict/tor-inside
./zeronet.py --fileserver_ip $(qubesdb-read /qubes-ip) --tor inside --tor_hidden_services ~/Insurgo.hidden
- Starting ZeroNet...
[21:48:48] PluginManager Plugin Cors load error: AttributeError: 'Config' object has no attribute 'language' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > CorsPlugin.py line 6 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > Translate.py line 133 > Translate.py line 33
[21:48:48] - OpenSSL load failed: /usr/lib/x86_64-linux-gnu/libssl.so.1.1: undefined symbol: SSLeay, falling back to slow bitcoin verify
[21:48:48] PluginManager Plugin Chart load error: KeyError: 'indexes' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > ChartPlugin.py line 13 > ChartDb.py line 11 > Db.py line 165
[21:48:48] PluginManager Plugin UiConfig load error: AttributeError: 'Config' object has no attribute 'language' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > UiConfigPlugin.py line 3 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > Translate.py line 133 > Translate.py line 33
[21:48:48] PluginManager Plugin ContentFilter load error: AttributeError: 'Config' object has no attribute 'language' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > ContentFilterPlugin.py line 7 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > Translate.py line 133 > Translate.py line 33
[21:48:48] PluginManager Plugin Bigfile load error: AttributeError: 'module' object has no attribute 'afterLoad' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > BigfilePlugin.py line 22
[21:48:48] PluginManager Plugin OptionalManager load error: AttributeError: 'module' object has no attribute 'afterLoad' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > OptionalManagerPlugin.py line 13
[21:48:48] PluginManager Plugin TranslateSite load error: AttributeError: 'Config' object has no attribute 'language' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > TranslateSitePlugin.py line 4 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > Translate.py line 133 > Translate.py line 33
[21:48:48] PluginManager Plugin MergerSite load error: AttributeError: 'Config' object has no attribute 'language' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > MergerSitePlugin.py line 6 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > Translate.py line 133 > Translate.py line 33
[21:48:48] - Version: 0.3.7 r1287, Python 2.7.13 (default, Sep 26 2018, 18:42:22) 
[GCC 6.3.0 20170516], Gevent: 1.1.2
[21:48:48] - Creating FileServer....
[21:48:48] - Creating UiServer....
Insufficient number of onions: supplied 1, need at least 34, recommended to have 99+ onions

Any insight?

@tlaurion
Copy link
Copy Markdown

@yurivict @HelloZeroNet

Actually, I double read and understood that fileserver and tor-inside were mutually exclusive.
The same happens with:

./zeronet.py --tor inside --tor_hidden_services ~/Insurgo.hidden 
- Starting ZeroNet...
[22:41:35] PluginManager Plugin Cors load error: AttributeError: 'Config' object has no attribute 'language' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > CorsPlugin.py line 6 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > Translate.py line 133 > Translate.py line 33
[22:41:35] - OpenSSL load failed: /usr/lib/x86_64-linux-gnu/libssl.so.1.1: undefined symbol: SSLeay, falling back to slow bitcoin verify
[22:41:35] PluginManager Plugin Chart load error: KeyError: 'indexes' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > ChartPlugin.py line 13 > ChartDb.py line 11 > Db.py line 165
[22:41:35] PluginManager Plugin UiConfig load error: AttributeError: 'Config' object has no attribute 'language' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > UiConfigPlugin.py line 3 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > Translate.py line 133 > Translate.py line 33
[22:41:35] PluginManager Plugin ContentFilter load error: AttributeError: 'Config' object has no attribute 'language' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > ContentFilterPlugin.py line 7 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > Translate.py line 133 > Translate.py line 33
[22:41:35] PluginManager Plugin Bigfile load error: AttributeError: 'module' object has no attribute 'afterLoad' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > BigfilePlugin.py line 22
[22:41:35] PluginManager Plugin OptionalManager load error: AttributeError: 'module' object has no attribute 'afterLoad' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > OptionalManagerPlugin.py line 13
[22:41:35] PluginManager Plugin TranslateSite load error: AttributeError: 'Config' object has no attribute 'language' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > TranslateSitePlugin.py line 4 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > Translate.py line 133 > Translate.py line 33
[22:41:35] PluginManager Plugin MergerSite load error: AttributeError: 'Config' object has no attribute 'language' in PluginManager.py line 37 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > MergerSitePlugin.py line 6 > builtins.py line 93 > __init__.py line 1 > builtins.py line 93 > Translate.py line 133 > Translate.py line 33
[22:41:35] - Version: 0.3.7 r1287, Python 2.7.13 (default, Sep 26 2018, 18:42:22) 
[GCC 6.3.0 20170516], Gevent: 1.1.2
[22:41:35] - Creating FileServer....
[22:41:35] - Creating UiServer....
Insufficient number of onions: supplied 1, need at least 34, recommended to have 99+ onions

@yurivict
Copy link
Copy Markdown
Author

How many onions did you supply?

@tlaurion
Copy link
Copy Markdown

tlaurion commented Mar 14, 2019

@yurivict : only one.

Deleting all ./data directory and starting blank doesn't recreate the error. A clean clone of your repo doesn't recreate the error.

But once sites are added, the error reappears. Complaining with exponential required onion sites, where only one is necessary: the onion site configured into sys-whonix, which routes correctly the traffic to the zeronet qube, which is tested by port check and reachable from the outside world.

@yurivict
Copy link
Copy Markdown
Author

It has this condition tor_manager.numOnions() < serving+1. So please add at least 100 onions. There should be a large number of onions, otherwise the sites that you have can be traced and correlated through shared onions.

I will review and rebase the code, and will try to see if a limited set should suffice. But this seems to be how ZeroNet itself operates - it creates a lot of onions. In inside mode there is no way to auto-create them, they need to be supplied.

@yurivict
Copy link
Copy Markdown
Author

The eschalot project allows to generate them from the command line: https://github.com/ReclaimYourPrivacy/eschalot

@tlaurion
Copy link
Copy Markdown

tlaurion commented Mar 15, 2019

@yurivict

It has this condition tor_manager.numOnions() < serving+1. So please add at least 100 onions. There should be a large number of onions, otherwise the sites that you have can be traced and correlated through shared onions.

In my comprehension, the correlation from tor hidden service to me as the publisher would happen only if the number of peers is 2 for a new ZeroNet service, and on even that, it doesn't mean the that peer is downloading from the publisher itself, nor that all single peers or publisher are online all the time.

Pointed consideration is valid only when a site update is published to the first peer, after which it is difficult to trace back to the original hoster since that peer may be taken to update the zite copy of other peers in place of the publisher itself.

I understand the consideration though, but current error should still be a warning at best. A single onion site should be sufficient for a single ZeroNet instance. I'm not "hosting" 99+ sites myself in the current example, but redistributing sites I visited (I swear I do not have that numsites+1 under /data, still).

As for the previous point, this is still a bug and not a feature of current tor-inside addition. The user should not have to constantly maitain onion hostnames list to be both fillled to sys-whonix and ZeroNet as a consequence of visiting new zites, which results in him hosting those new sites himself for others.

At the end of it all, the same attacks to deobfuscate all those 99+ generated .onion site are the same as for identifying tor users/hidden onion services : timed attacks, DoS and most importantly, targeting and cutting down an hypothesized hidden onion linked internet connection and validate service unavailability, which would all point out to my qube and zeronet onion service being down whatever number of onion hidden sites generated, while the other peers hosting my zite would still distribute the latest version they have got from me or indirectly from me and prviding to others, which is a strong resilience feature of ZeroNet and other similar redundant/decentralized services.

Have I missed something?

@tlaurion
Copy link
Copy Markdown

@yurivict : ping?

Comment thread src/Site/SiteManager.py
# check if there are enough onions available
if sys.modules.get("main") and sys.modules["main"].file_server:
tor_manager = sys.modules["main"].file_server.tor_manager
if tor_manager and tor_manager.numOnions() < serving+1:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unpractical. serving here refers to the number of sites visited, not hosted. I would remove that condition completely.

@yurivict
Copy link
Copy Markdown
Author

@tlaurion I will be out of town next week, will correct it after next Sunday.

@tlaurion
Copy link
Copy Markdown

tlaurion commented Apr 6, 2019

@yurivict any update?

Sent from my Galaxy S3 using FastHub-Libre

@tlaurion
Copy link
Copy Markdown

@yurivict? Any problems?

@tlaurion
Copy link
Copy Markdown

tlaurion commented May 5, 2019

@yurivict : Sorry to insist, but this feature is really important.

@adrelanos
Copy link
Copy Markdown
Contributor

adrelanos commented May 5, 2019 via email

@tlaurion
Copy link
Copy Markdown

tlaurion commented May 5, 2019

@adrelanos: Accessing content works. Publishing doesn't.

Following official guide on whonix14 for QubesOS, here is the result after having started zeronet.

Setup: two whonix-ws workstations.
One being a publisher, one being a client, connected to different whonix-gw, one being a clone of the other.

Connectivity:
zeronet-publisher-whonix-ws-> sys-whonix -> vpn -> sys-firewall -> sys-net
zeronet-client-whonx-ws -> sys-whonix-clone -> vpn -> sys-firewall -> sys-net

Publisher:
An attempt to publish is done, while the client attempts to access it's URL which fails.
Publishing fails because there is no connected peer, while client is never able to access publisher's site.

user@host:~/ZeroNet$ cd ~/ZeroNet/ && git pull origin && ./zeronet.py --tor always --fileserver_ip $(qubesdb-read /qubes-ip)
Already up-to-date.
- Starting ZeroNet...
[21:34:26] - OpenSSL loaded, version: 01000212F
[21:34:26] - Patching sockets to tor socks proxy: 127.0.0.1:9050
[21:34:26] - Version: 0.6.5 r3864, Python 2.7.13 (default, Sep 26 2018, 18:42:22) 
[GCC 6.3.0 20170516], Gevent: 1.1.2
[21:34:26] - Creating FileServer....
[21:34:26] - Creating UiServer....
[21:34:27] - Removing old SSL certs...
[21:34:27] - Starting servers....
[21:34:27] Ui.UiServer --------------------------------------
[21:34:27] Ui.UiServer Web interface: http://127.0.0.1:43110/
[21:34:27] Ui.UiServer --------------------------------------
[21:34:27] TorManager Connecting to Tor Controller 127.0.0.1:9051
[21:34:30] PeerPortchecker Checking port 15441 (ipv4) using checkPortchecker result: {'ip': '185.220.101.31', 'opened': False} in 2.436s
[21:34:30] PeerPortchecker Checking port 15441 (ipv6) using checkMyaddr result: {'ip': '185.220.101.31', 'opened': False} in 3.164s
[21:34:31] ConnServer Server port opened ipv4: False, ipv6: False
[21:34:32] Ui.UiServer Added 127.0.0.1:43110 as allowed host

It's sys-whonix:

user@host:~$ sudo journalctl | grep filtered
May 05 21:04:46 host onion-grater[9401]: 10.137.0.38:36782 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=25419
May 05 21:04:46 host onion-grater[9401]: 10.137.0.38:36782 (filter: 30_autogenerated): <- 510 Command filtered
May 05 21:07:50 host qubes.StartApp+org.kde.konsole-dom0[15592]: org.kde.kurifilter-ikws: "user@host:~$ sudo journalctl | grep filtered May 05 21:04:46 host onion-grater[9401]: 10.137.0.38:36782 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=25419 May 05 21:04:46 host onion-grater[9401]: 10.137.0.38:36782 (filter: 30_autogenerated): <- 510 Command filtered user@host:~$ date Sun May 5 21:06:15 UTC 2019 user@host:~$ ls /usr/local/etc/onion-grater-merger.d/40_zeronet.yml /usr/local/etc/onion-grater-merger.d/40_zeronet.yml user@host:~$ cat /usr/local/etc/onion-grater-merger.d/40_zeronet.yml ## Copyright (C) 2016 - 2018 ENCRYPTED SUPPORT LP <adrelanos@riseup.net> ## See the file COPYING for copying conditions --- - exe-paths: - '*' users: - '*' hosts: - '*' commands: ADD_ONION: - pattern: 'NEW:(\\S+) Port=15441,15441' replacement: 'NEW:{} Port=15441,{client-address}:15441' DEL_ONION: - '.+' GETCONF: - 'hiddenservicesinglehopmode'"
May 05 21:11:27 host onion-grater[9401]: 10.137.0.38:51896 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=15441
May 05 21:11:27 host onion-grater[9401]: 10.137.0.38:51896 (filter: 30_autogenerated): <- 510 Command filtered
May 05 21:12:18 host onion-grater[9401]: 10.137.0.38:51942 (filter: 30_autogenerated): command filtered: setevents stream
May 05 21:12:18 host onion-grater[9401]: 10.137.0.38:51942 (filter: 30_autogenerated): <- 510 Command filtered
May 05 21:15:42 host onion-grater[9401]: 10.137.0.38:51976 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=15441
May 05 21:15:42 host onion-grater[9401]: 10.137.0.38:51976 (filter: 30_autogenerated): <- 510 Command filtered
May 05 21:19:15 host onion-grater[9401]: 10.137.0.22:50018 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=33750
May 05 21:19:15 host onion-grater[9401]: 10.137.0.22:50018 (filter: 30_autogenerated): <- 510 Command filtered
May 05 21:19:52 host onion-grater[9401]: 10.137.0.22:50028 (filter: 30_autogenerated): command filtered: setevents stream
May 05 21:19:52 host onion-grater[9401]: 10.137.0.22:50028 (filter: 30_autogenerated): <- 510 Command filtered
May 05 21:22:07 host onion-grater[9401]: 10.137.0.22:50088 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=15441
May 05 21:22:07 host onion-grater[9401]: 10.137.0.22:50088 (filter: 30_autogenerated): <- 510 Command filtered
May 05 21:24:46 host qubes.StartApp+org.kde.konsole-dom0[15592]: org.kde.kurifilter-ikws: "user@host:~$ sudo journalctl | grep filtered May 05 21:04:46 host onion-grater[9401]: 10.137.0.38:36782 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=25419 May 05 21:04:46 host onion-grater[9401]: 10.137.0.38:36782 (filter: 30_autogenerated): <- 510 Command filtered May 05 21:07:50 host qubes.StartApp+org.kde.konsole-dom0[15592]: org.kde.kurifilter-ikws: \"user@host:~$ sudo journalctl | grep filtered May 05 21:04:46 host onion-grater[9401]: 10.137.0.38:36782 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=25419 May 05 21:04:46 host onion-grater[9401]: 10.137.0.38:36782 (filter: 30_autogenerated): <- 510 Command filtered user@host:~$ date Sun May 5 21:06:15 UTC 2019 user@host:~$ ls /usr/local/etc/onion-grater-merger.d/40_zeronet.yml /usr/local/etc/onion-grater-merger.d/40_zeronet.yml user@host:~$ cat /usr/local/etc/onion-grater-merger.d/40_zeronet.yml ## Copyright (C) 2016 - 20
May 05 21:24:46 host qubes.StartApp+org.kde.konsole-dom0[15592]: 18 ENCRYPTED SUPPORT LP <adrelanos@riseup.net> ## See the file COPYING for copying conditions --- - exe-paths: - '*' users: - '*' hosts: - '*' commands: ADD_ONION: - pattern: 'NEW:(\\\\S+) Port=15441,15441' replacement: 'NEW:{} Port=15441,{client-address}:15441' DEL_ONION: - '.+' GETCONF: - 'hiddenservicesinglehopmode'\" May 05 21:11:27 host onion-grater[9401]: 10.137.0.38:51896 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=15441 May 05 21:11:27 host onion-grater[9401]: 10.137.0.38:51896 (filter: 30_autogenerated): <- 510 Command filtered May 05 21:12:18 host onion-grater[9401]: 10.137.0.38:51942 (filter: 30_autogenerated): command filtered: setevents stream May 05 21:12:18 host onion-grater[9401]: 10.137.0.38:51942 (filter: 30_autogenerated): <- 510 Command filtered May 05 21:15:42 host onion-grater[9401]: 10.137.0.38:51976 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=15441 May 05 21:15:42 host oni
May 05 21:24:46 host qubes.StartApp+org.kde.konsole-dom0[15592]: on-grater[9401]: 10.137.0.38:51976 (filter: 30_autogenerated): <- 510 Command filtered May 05 21:19:15 host onion-grater[9401]: 10.137.0.22:50018 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=33750 May 05 21:19:15 host onion-grater[9401]: 10.137.0.22:50018 (filter: 30_autogenerated): <- 510 Command filtered May 05 21:19:52 host onion-grater[9401]: 10.137.0.22:50028 (filter: 30_autogenerated): command filtered: setevents stream May 05 21:19:52 host onion-grater[9401]: 10.137.0.22:50028 (filter: 30_autogenerated): <- 510 Command filtered May 05 21:22:07 host onion-grater[9401]: 10.137.0.22:50088 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=15441 May 05 21:22:07 host onion-grater[9401]: 10.137.0.22:50088 (filter: 30_autogenerated): <- 510 Command filtered"
May 05 21:35:12 host onion-grater[9401]: 10.137.0.22:50390 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=15441
May 05 21:35:12 host onion-grater[9401]: 10.137.0.22:50390 (filter: 30_autogenerated): <- 510 Command filtered

Client:

user@host:~$ cd ~/ZeroNet/ && git pull origin && ./zeronet.py --tor always --fileserver_ip $(qubesdb-read /qubes-ip)
Already up-to-date.
- Starting ZeroNet...
[21:32:08] - OpenSSL loaded, version: 01000212F
[21:32:08] - Patching sockets to tor socks proxy: 127.0.0.1:9050
[21:32:08] - Version: 0.6.5 r3864, Python 2.7.13 (default, Sep 26 2018, 18:42:22) 
[GCC 6.3.0 20170516], Gevent: 1.1.2
[21:32:08] - Creating FileServer....
[21:32:08] - Creating UiServer....
[21:32:08] SiteManager Deleting orphan site from content.db: 1DMb3CV66qZPwJqkgm4z12nu8BrAwDoD4g
[21:32:08] - Removing old SSL certs...
[21:32:08] - Starting servers....
[21:32:09] Ui.UiServer --------------------------------------
[21:32:09] Ui.UiServer Web interface: http://127.0.0.1:43110/
[21:32:09] Ui.UiServer --------------------------------------
[21:32:09] TorManager Connecting to Tor Controller 127.0.0.1:9051                                                                                                                               
[21:32:15] PeerPortchecker Checking port 15441 (ipv4) using checkPortchecker result: {'ip': '77.247.181.165', 'opened': False} in 5.426s                                                        
[21:32:15] PeerPortchecker Checking port 15441 (ipv6) using checkMyaddr result: {'ip': '77.247.181.165', 'opened': False} in 5.664s                                                             
[21:32:15] ConnServer Server port opened ipv4: False, ipv6: False                                                                                                                               
[21:33:39] Ui.UiServer Added 127.0.0.1:43110 as allowed host                                                                                                                                    
[21:35:08] ChartCollector Collector connection_ping_min error: min() arg is an empty sequence                                                                                                   
[21:40:08] ChartCollector Collector connection_ping_min error: min() arg is an empty sequence         

It's sys-whonix

user@host:~$ sudo journalctl | grep filtered
May 05 21:32:14 host onion-grater[2475]: 10.137.0.38:54428 (filter: 30_autogenerated): command filtered: ADD_ONION NEW:RSA1024 port=15441
May 05 21:32:14 host onion-grater[2475]: 10.137.0.38:54428 (filter: 30_autogenerated): <- 510 Command filtered
May 05 21:33:33 host onion-grater[2475]: 10.137.0.38:54530 (filter: 30_autogenerated): command filtered: setevents stream
May 05 21:33:33 host onion-grater[2475]: 10.137.0.38:54530 (filter: 30_autogenerated): <- 510 Command filtered

Config of both sys-whonix:

user@host:~$ ls /usr/local/etc/onion-grater-merger.d/40_zeronet.yml 
/usr/local/etc/onion-grater-merger.d/40_zeronet.yml
user@host:~$ cat /usr/local/etc/onion-grater-merger.d/40_zeronet.yml
## Copyright (C) 2016 - 2018 ENCRYPTED SUPPORT LP <adrelanos@riseup.net>
## See the file COPYING for copying conditions

---
- exe-paths:
    - '*'
  users:                                                                                                                                                                                        
    - '*'                                                                                                                                                                                       
  hosts:                                                                                                                                                                                        
    - '*'                                                                                                                                                                                       
  commands:                                                                                                                                                                                     
    ADD_ONION:                                                                                                                                                                                  
      - pattern:     'NEW:(\S+) Port=15441,15441'                                                                                                                                               
        replacement: 'NEW:{} Port=15441,{client-address}:15441'
    DEL_ONION:
      - '.+'
    GETCONF:
      - 'hiddenservicesinglehopmode'

@adrelanos
Copy link
Copy Markdown
Contributor

Command filtered messages will interfere very likely with publishing.

This could be it.

ADD_ONION NEW:RSA1024 port=15441

does not match the profile anymore

`NEW:(\S+) Port=15441,15441`

I don't follow ZeroNet development. Any changes to Tor implementation or underlying libs?


Attempted a quick untested fix:

Whonix/onion-grater@e994509

You could try the updated profile from git:

https://github.com/Whonix/onion-grater/blob/master/usr/share/doc/onion-grater-merger/examples/40_zeronet.yml


Perhaps also either:

    SETEVENTS:
      - 'stream'

or

    SETEVENTS:
      - 'STREAM'

is required.

Also, perhaps also either:

  events:
    stream:
      suppress: true

or

  events:
    STREAM:
      suppress: true

Out commented code for that is already in the profile.


Don't forget

sudo service onion-grater restart

after profile changes.


To prevent another source of confusion from happening for any reader, the path has changed Whonix 14 vs Whonix 15 and above:

Whonix 14:

/usr/share/onion-grater-merger/examples/

Whonix 15 and above:

/usr/share/doc/onion-grater-merger/examples/

@tlaurion
Copy link
Copy Markdown

tlaurion commented May 6, 2019

@adrelanos : commented in Whonix/onion-grater@e994509

@tlaurion
Copy link
Copy Markdown

tlaurion commented May 6, 2019

I don't follow ZeroNet development. Any changes to Tor implementation or underlying libs?

@HelloZeroNet ?

adrelanos pushed a commit to adrelanos/onion-grater that referenced this pull request May 6, 2019
@adrelanos
Copy link
Copy Markdown
Contributor

Another attempt to fix:

Whonix/onion-grater@afdff5b

This time palatially tested: No more filtered messages.

Same location as before.

https://github.com/Whonix/onion-grater/blob/master/usr/share/doc/onion-grater-merger/examples/40_zeronet.yml

sudo service onion-grater restart

Let me know how that goes.

@adrelanos
Copy link
Copy Markdown
Contributor

Compared to similar applications using onion-grater...

https://www.whonix.org/wiki/ZeroNet lacks the Modify Firewall Settings chapter.

Just now added.

https://www.whonix.org/w/index.php?title=ZeroNet&type=revision&diff=47067&oldid=46740

Consider it optional for now - if it works without - then leave it out. But if publishing doesn't work - try if that helps.

@tlaurion
Copy link
Copy Markdown

tlaurion commented May 6, 2019

@adrelanos : Works!

The firewall part is required on both client and publisher to be able to interact with sites. (In my test scenario of only 2 peers, a client and the original site publisher, only reachable through tor.)

To test this, I simply added a post on the publisher with the firewall conf in, and not present on the client side, and the client side failed to update (liking posts never reached original publisher).

When both have firewall conf in, the changes are propagated fluently.

@adrelanos
Copy link
Copy Markdown
Contributor

Great, thanks!

I am a bit but not too much surprised the client needs to do this too. I would guess ZeroNet utilized Tor onion services in both, publisher and client mode.

Instructions https://www.whonix.org/wiki/ZeroNet were updated too just now. These instructions don't mention publisher vs client mode. They're the same for everyone. So should work for anyone following these instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants