John-Mark Gurney 1a77fc8067 | 5 years ago | |
---|---|---|
.gitignore | 5 years ago | |
LICENSE.txt | 5 years ago | |
Makefile | 5 years ago | |
NOTES.md | 5 years ago | |
README.md | 5 years ago | |
makemessagelengths.py | 5 years ago | |
ntunnel.py | 5 years ago | |
requirements.txt | 5 years ago | |
twistednoise.py | 5 years ago |
The ntunnel program is designed to tunnel Unix domain sockets over TCP, using the Noise Protocol. The goal is to be secure and simple to use and setup. Due to the flexibility, it can forward any standard stream socket to another stream socket, including TCP sockets.
Generate the keys:
python ntunnel.py genkey serverkey
python ntunnel.py genkey clientkey
Create the target for the pass through:
nc -lU finalsock
Start the server and client:
python ntunnel.py server serverkey unix:$(pwd)/servsock unix:$(pwd)/finalsock
python ntunnel.py client clientkey serverkey.pub unix:$(pwd)/clientsock unix:$(pwd)/servsock
Attach to the client:
nc -U clientsock
Now when you type text into either of the nc windows, you should see the same text come out the other side.
Currently ntunnel requires Python 3.7 or later. If the default
virtualenv is not 3.7 or later, you can set the VIRTUALENV variable to specify
which one to use, such as:
make env VIRTUALENV=virtualenv-3.7
If you want to use an alternate version of python, you can specify
VIRTUALENVARGS, such as:
make env VIRTUALENV=virtualenv-3.7 VIRTUALENVARGS="-p $(which pypy3)"
Note that I have not been able to test this w/ pypy3, as when compiling the cryptography libraries, it would pick the wrong ones, despite setting CFLAGS and LDFLAGS.