|
NAMEgsocket —
connect like there is no firewall. Securely.
SYNOPSIS
DESCRIPTIONThegsocket tool can be used to enable a program to
communicate through a firewall in situations where it would not be possible to
establish a direct connection to another host/workstation (NATed/firewalled).
The typical scenario is two workstations that are on separate private networks
and behind separate firewalls. The gsocket tool
hijacks the network library functions (such as connect() and accept()) of the
program and encrypts and redirects the traffic through the Global Socket Relay
Network (GSRN).
Neither workstation needs to open a port in their firewall nor accept incoming TCP connections. The connection is end-2-end encrypted using SRP (RFC 5054) with AES-256 and a 4096 Prime. The GSRN sees only the encrypted traffic. Common uses include:
Abandon the thought of IP addresses and port numbers: Two programs
should be able to communicate with each other as long as they know the same
secret (rather than each other´s IP address and port number). The
The typical scenario is a client/server arrangement such as ssh and sshd: Connections by ssh to any hostname ending in ´.gsocket´ are redirected (through the GSRN) to the (firewalled) sshd server. The redirection is done per program (and limited to that program
only). The OPTIONS
Connections to any hostname ending in ´*.gsocket´ or to the IP Address ´127.31.33.7´ are redirected through the GSRN. Connections to any hostname ending in ´*.thc´ or to the IP Address ´127.31.33.8´ are first redirected through TOR and then through the GSRN. EXAMPLESExample 1 - OpenSSH between two firewalled workstations:
Server: $ gsocket -s MySecret
/usr/sbin/sshd $ gsocket -s MySecret ssh
xaitax@gsocket
Server: $ gsocket -s MySecret nc -lp
31337 $ gsocket -s MySecret nc gsocket
31337
Server: $ gsocket -s MySecret openvpn --dev
tun1 --proto tcp-server --ifconfig 10.9.8.1 10.9.8.2 $ gsocket -s MySecret openvpn --dev
tun1 --proto tcp-client --ifconfig 10.9.8.2 10.9.8.1 --remote
gsocket
Server: $ gsocket -s MySecret inspircd
--nolog --nofork $ gsocket -s MySecret irssi -c
gsocket
Server: $ gsocket -s MySecret socat -
TCP_LISTEN:31337 $ gsocket -s MySecret socat -
TCP:gsocket:31337 SYSTEMCTL INSTALLATIONIt is possible to make any service/daemon accessible through any firewall. The service is then only acessible through the GSRN and only if the client knows the secret. No port or service is exposed to the public Internet and the existence of the service remains hidden. This example makes openssh-server (sshd) accessible through the GSRN. Nobody, not even the GSRN operators, have access to the port, daemon or service (they do not know the secret). The new service coexists with the existing openssh-server and does not interfere with the existing openssh-server.1. Copy /etc/systemd/system/sshd to /etc/systemd/system/gs-sshd 2. Edit /etc/systemd/system/gs-sshd and change this line: ExecStart=/usr/sbin/sshd -D
$SSHD_OPTS ExecStart=gsocket -s MySecret
/usr/sbin/sshd -D $SSHD_OPTS 3. Start the newly created service # systemctl start
gs-sshd 4. Check the status # systemctl status
gs-sshd 5. Connect from any other host to the newly created (hidden) openssh-server: $ gsocket -s MySecret ssh
user@gsocket ENVIRONMENTThe following environment variables can be set to control the behavior ofgsocket
Specify the IP address of the TOR
server (or any other SOCKS server). Default is 127.0.0.1.
The port number of the TOR server (or
any other SOCKS server). Default is 9050.
A string containing additional
command line parameters. First the normal command line parameters are
processed and then the command line parameters from GSOCKET_ARGS. SECURITYPassing the password as command line parameter is not secure. Consider using the -k option or GSOCKET_ARGS or enter the password when prompted:$ gsocket -k
<file> $ export GSOCKET_ARGS="-s
MySecret" $ gs
NOTESThe latest version is available from https://github.com/hackerschoice/gsocket/.SEE ALSOgs-netcat(1), gs-sftp(1), gs-mount(1), blitz(1), nc(1), socat(1)BUGSEfforts have been made to havegsocket "do the
right thing" in all its various modes. If you believe that it is doing
the wrong thing under whatever circumstances, please notify me
(skyper@thc.org) and tell me how you think it should behave.
Visit the GSP FreeBSD Man Page Interface. |