Post Exploitationnetworkingtunnelingfirewallnatsecurerelaytlstor

gsocket

gsocket enables communication between programs on machines behind firewalls or NAT using a shared secret instead of IP addresses and ports. It connects through the Global Socket Relay Network (GSRN) with end-to-end TLS encryption.

Description

The Global Socket library allows two programs to communicate securely regardless of their IP addresses or locations by using a shared secret. It derives temporary session keys and IDs locally and routes connections through the free GSRN cloud service, which only sees encrypted traffic. The secret never leaves the workstation, ensuring privacy.

gsocket is the core tool that makes existing programs accessible worldwide by replacing the IP layer with the Gsocket layer. Client connections to hostnames ending in '*.gsocket' are redirected via GSRN to the target program. This is ideal for accessing services behind firewalls or NAT.

The toolkit includes complementary tools like gs-netcat for encrypted shells and proxies, gs-sftp for secure file transfers, gs-mount for remote filesystems, and blitz for fast file copying between workstations.

How It Works

gsocket locally generates session keys and IDs from a shared secret, connecting programs via the GSRN relay network independent of IP or location. Once linked, it negotiates a secure end-to-end TLS connection. The GSRN handles routing but cannot decrypt traffic as the secret stays local. Tools like gs-netcat enhance this with features like AES-256 encryption, TOR support, and protocol forwarding.

Installation

bash
sudo apt install gsocket

Flags

-p <ports>Range of listening ports to redirect [default=all]
-TUse TOR.
-k <file>Read Secret from file.
-s <secret>Secret (e.g. password).

Examples

Server mode: Makes SSH daemon accessible via gsocket with secret MySecret in debug mode.
gsocket -s MySecret /usr/bin/sshd -d
Client mode: Connects SSH to a gsocket hostname using secret MySecret.
gsocket -s MySecret ssh root@gsocket
Server: Forwards traffic from port 2222 to 192.168.6.7:22.
gs-netcat -l -d 192.168.6.7 -p 22
Client: Connects to forward traffic to server on port 2222.
gs-netcat -p 2222
Server: Acts as a SOCKS proxy.
gs-netcat -l -S
Client: Connects to SOCKS proxy server on port 1080.
gs-netcat -p 1080
Server: Receives file transfer and saves to warez.tar.gz.
gs-netcat -l -r >warez.tar.gz
Client: Sends warez.tar.gz file to server.
gs-netcat <warez.tar.gz
Updated 2026-04-16kali.org ↗