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

[Feature Request]Netcat multi-user chat PoC and future use of WS for self-destruct chatrooms on demand #3626

Open
gyrusdentatus opened this issue Jun 30, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@gyrusdentatus
Copy link

Is your feature request related to a problem? Please describe.

This is WIP and I wanted to get your opinion on it and perhaps test it yourself.
Please, make sure to see for yourself on screenshots attached.
Note: if there are any typos then I’m sorry, I have to catch a flight… :)

Problem:

Nym does not have any native and fun hacky chat, like the good old times when GUI was not a thing.

This allows multiple users to connect without revealing anything, SP can only see itself talking to itself and the port is only accessible over mixnet (firewall blocks the port to WAN).

Additional details and concept idea

This is a quick proposal for a pretty awesome thing I proposed back in early 2021. Multiuser chat over mixnet.
Not only it works really damn well because of the super small data being transmitted, it is also great that in theory you can create an Akash template that would spawn this chat (with both web and cli-app interconnected!) and just send an IP addr to that server, which would act as an SP and then get destroyed.

PoC multiuser chat over netcat using socks5 and raw TCP

  1. Install ncat on your local machine and on a server running network-requester and firewall enabled.
    First allow ufw for ssh and our netcat port 13370 or any other of your choosing (this is to demonstrate that you can’t connect to the chat without connecting to the service-provider)
    ufw allow 22/tcp
    ufw allow 13370/tcp
    ufw enable

Then install netcat on both your local

apt install ncat or brew install ncat on MacOS (if pkg not found then install nmap - ncat is a part of the suite, enhanced nc with more capabilities and is slightly different)

  1. run it on the server:
  • sp init example:
nym-network-requester init --id dialout_sp1 --gateway Bkq5KLDMRiL9vAaHqwCN7LJ16ecvhU7WsJoeWqk6PYjG  --enabled-credentials-mode false
  • run it as open-proxy
nym-network-requester run --id dialout_sp1 --open-proxy
  • run netcat server chat that allows multiple connections
 ncat -lvv 13370 --chat --broker

# in my case netstat shows this 0.0.0.0:13370 but because it is behind firewall, it is filtered
# -l … listen on port
# -vv … verbose verbose, but feel free to add even more vees :) 
# —chat … chat mode where each new connections gets assigned a name <user><number> - ie <user1>
# —broker … iirc from man pages it needs to be set to allow multiple simul connections kept alive 
  1. how to run on local machine that has nym-socks5-client running and connected to the same SP as set up on server

  2. if you really have no time to set things up, you can use this:


# using curl:
curl -o nym-socks5-client -sSL https://github.com/nymtech/nym/releases/download/nym-binaries-v1.1.22/nym-socks5-client
using
# using wget:
wget https://github.com/nymtech/nym/releases/download/nym-binaries-v1.1.22/nym-socks5-client

# Make the binaries executable chmod 755 nym-socks5-client
for convenience, move the binary to for example #/usrl/local/bin/ so they are in your PATH (check with echo $PATH)
Make sure to init your nym-socks5-client first.

##
## init the socks5 client to connect to my SP 
nym-socks5-client init --id email --provider 4V8euNmD7oBtvQ9RaVGBLK9s2jVDLT7vxkg4iHWfFqza.HGMiWr7zPFohiyFGLzP82jDnVXodLvpjvjKyVvNJ33Uv@Bkq5KLDMRiL9vAaHqwCN7LJ16ecvhU7WsJoeWqk6PYjG

Or you can use your own of course :)

  • fire it up - open two, three, four …terminals and chat ! I suggest you keep the socks5 client open in a vertical window on the top and check the logs for fun
ncat  dialout.net 13370  --proxy-type socks5 --proxy 127.0.0.1
# or switch the hostname to another of your choosing if you set up your own service provider
# i am almost certain socks5 has to run at 1080 because it is not possible to change this with a flag

Is your request a feature not related to an existing problem? A new feature.
This is a new feature, that I want to have working both over web and cli, raw TCP and Websockets but still able to talk to each other - this is possible with websocat and other tools.

Reason I am suggesting this is because I want you guys to test it and see for yourself and I think it is pretty damn cool and fast.
If you think this is a good idea, I will start developing this with proper nym-client using websockets and perhaps wasm. This chat will work potentially with all 3 clients simultaneously (how the heck do you spell that one?)

You can say the netcat is not encrypted by default but socat and websocat are a different type of beast and even with ncat you can use TLS if you do not control the server and do not want admin to be snooping on your conversations :)) (haven’t tried if this is possible to avoid though, because obviously the cert is on the server so I guess my logic is flawwed anyway … but running this as a container on Akash would prevent this.)

  • multi-user chat that is accessible over socks5, web or any websocket over nym-mixnet
  • multi-user chat that is super-low bandwidth and therefore suitable for fast comms over mixnet
  • deploy on demand on any random Akash server and then destroy it
  • or deploy on an SP server that creates docker container or other that cannot access WAN at all.
  • destroy after use. No logs, no history, no knowledge of who is who.

Where does the feature fit in the Nym real estate?

  • Application / UI

What is this solving?

  • speed of communication compared to the common apps that are available.
  • self destructi chat.
  • zero logs (if containerized and deployed on Akash you can make sure of it)
  • raw TCP over socks5 or WS using nym-client both being able to chat together.
  • no one can tell who is talking to whom, not even god himself as G.Danezis said.
  • it is super l33t and old schoool cool
  • easy to set up if I provide a shell script for client and server and Akash deployment yml

Describe alternatives you've considered
This has a certain niche of use and the user audience is endless. It is not a killer app but so what?

Additional context
Will turn this into a repo if @mfahampshire @futurechimp @mmsinclair can test this and tell me it is a good approach

Screenshots:

two chats and socks5 client on top, sorry. for the language on all pics
image

real users from the community:
image

Experimental websocket with plain html and nginx wss:// proxying to ws://dialout.net:11111 >> tcp://dialout.net:13370 netcat:
image

And here is the message from above:
image

Getting translated from websocket with tls to websocket to tcp netcat session and appearing for everyone else in netcat :D … I think this is pretty cool stuff.

@gyrusdentatus gyrusdentatus added the enhancement New feature or request label Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant