Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run on Whonix #2

Open
felipedau opened this issue Jan 25, 2017 · 16 comments
Open

Run on Whonix #2

felipedau opened this issue Jan 25, 2017 · 16 comments

Comments

@felipedau
Copy link
Contributor

The unmessage-cli supports the following options:

  • --no-tor-socks prevents unMessage's own Tor process to open a SOCKS port
  • --no-onion-service prevents unMessage's own Tor process to open an onion service port

When these two options are provided, unMessage will not even start its own Tor process. It is assumed there is a Tor SOCKS port open (9054 by default, overridden with -t), as well as there is a system's onion service mapping to the local server port (50000 by default, overriden with -l) and ~/.config/unMessage/<peer>/tor/onion-service/hostname contains its domain name, to properly compose the peer's identity (name@domain.onion:port) in order to send requests.

The approach currently works for a regular OS, with a Tor process using those configs. To use on Whonix, another option must also be used:

  • --no-tor-proxy prevents unMessage to use the Tor SOCKS port (or the one provided with -t) and connects to the address with a regular Twisted Endpoint

Whonix handles the onion service address and properly connects to the peer (I am not sure how stream-isolation works when connecting to an onion service). What is not currently working is its own server. Following the Hidden Services wiki page did not work and all connections to that workstation's server port result in ConnectionRefused errors (tested on Qubes-Whonix).It looks like the gateway is receiving the connection and the issue seems to be the mapping to the workstation that is not allowed.

@adrelanos
Copy link

  • (easy) Using SocksPort 127.0.0.1 9050 should work in Whonix. (Gets automatically redirected to the gateway by anon-ws-disable-stacked-tor.)
  • (a bit harder) Point directly to Whonix-Gateway. (As per https://www.whonix.org/wiki/Stream_Isolation. We can do that later.)
  • Are you sure unMessage's server is not only listening on localhost? For the gateway being able to reach it, it needs to listen on it's external network interface (eth0`s IP).
  • If that does not help, do Whonix's Tor hidden web server example instructions work for you? Would be good to have that running first before trying other Tor hidden server software like unMessage.

Thank you for your interest of running unMessage in Whonix! Much appreciated!

Related:

@felipedau
Copy link
Contributor Author

(easy) Using SocksPort 127.0.0.1 9050 should work in Whonix. (Gets automatically redirected to the gateway by anon-ws-disable-stacked-tor.)
(a bit harder) Point directly to Whonix-Gateway. (As per https://www.whonix.org/wiki/Stream_Isolation. We can do that later.)

To run on Whonix, I used the --no-tor-proxy flag to not use any SOCKS port. It then creates a regular Twisted TCP4ClientEndpoint and connects to the onion address. This outbound traffic (initiating the connection to a hidden service) is working, just like telnet domain.onion port "magically" works, for example.

What is not clear to me is the need of using a specific SOCKS port because unMessage always connects to another hidden service. From the link above: "Different Tor Hidden Services are automatically stream isolated". Can you clarify?

Are you sure unMessage's server is not only listening on localhost? For the gateway being able to reach it, it needs to listen on it's external network interface (eth0`s IP).
If that does not help, do Whonix's Tor hidden web server example instructions work for you? Would be good to have that running first before trying other Tor hidden server software like unMessage.

That's it! I did follow those instructions, but unMessage actually only listens on localhost. Do you think we should forward connections from the gateway's IP to localhost, or directly listen on the external interface? The former might require some action from the user, while the latter might be easier because unMessage can automatically do that when starting the server. I think we just need a way to find out the address to use for both Whonix and Qubes-Whonix.

Thank you for your interest of running unMessage in Whonix! Much appreciated!

Related:

port to ephemeral Tor hidden services / python-stem - #4
Run unMessage on Whonix - https://phabricator.whonix.org/T622

Thank you very much Patrick!

@adrelanos
Copy link

adrelanos commented Feb 3, 2017 via email

@felipedau
Copy link
Contributor Author

felipedau commented Feb 3, 2017 via email

@adrelanos
Copy link

adrelanos commented Feb 3, 2017 via email

@felipedau
Copy link
Contributor Author

felipedau commented Feb 3, 2017 via email

@adrelanos
Copy link

adrelanos commented Feb 3, 2017 via email

@felipedau
Copy link
Contributor Author

felipedau commented Feb 3, 2017 via email

@adrelanos
Copy link

adrelanos commented Feb 4, 2017 via email

@felipedau
Copy link
Contributor Author

felipedau commented Feb 9, 2017 via email

@felipedau
Copy link
Contributor Author

It is sad to see that after two weeks, no commented :/

I would say that you should go ahead and post to the debian-devel mailing list, where someone may be able to contribute. What do you think?

Thanks!

@adrelanos
Copy link

Yes. Draft writing in progress.

write draft for local listener standard on debian-devel
https://phabricator.whonix.org/T635

I'll notify you once semi-finished. Suggestions on any step on the way here or on Whonix phabricator appreciated.

@felipedau
Copy link
Contributor Author

felipedau commented Feb 19, 2017 via email

@adrelanos
Copy link

Initial draft is done. Please have a look https://phabricator.whonix.org/T635 when you have a chance.

@felipedau
Copy link
Contributor Author

felipedau commented Apr 13, 2017

Remaining tasks to make unMessage run on Whonix:

  • Pick a port different from 50000, in the 1024~49151 range and that does not conflict with other apps/services/etc
  • Create an onion-grater profile (T654)
  • Write guides for both Whonix and unMessage's docs
    • Open port and restart firewall
    • Copy profile and restart onion-grater

For now, launching will require:

  • --local-server-ip to bind on the right interface. Once Proposal 635 is finished (as well as the config parser), then that should be done automatically.
  • --connect-to-tor, --tor-control-port, --tor-socks-port to use the system's Tor with the right ports. Once Be smart when deciding to launch/connect to Tor #31 is implemented, that should be done automatically.

Is there anything I am missing?

@adrelanos
Copy link

Looks great!

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

No branches or pull requests

2 participants