feat: Rebrand project to WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive

- Update project name from 'WebSocket SSH' to 'WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive'
- Update project description to emphasize evolution as universal tunneling utility
- Update README.md, DOCUMENTATION.md, CHANGELOG.md, TODO.md
- Update all man pages (wsssh.1, wsscp.1, wssshc.1, wsssht.1)
- Update Debian control files for both packages
- Update configuration examples and build scripts
- Update source code comments in tunnel and client files
parent 8c867e16
# Changelog # WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive Changelog
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
......
# WebSocket SSH Documentation # WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive Documentation
## Table of Contents ## Table of Contents
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
## Overview ## Overview
WebSocket SSH (wsssh) is a tunneling system that enables secure SSH/SCP access to remote machines through WebSocket-based intermediaries. Unlike traditional SSH jump hosts, wsssh uses WebSocket connections for real-time, bidirectional communication between clients and servers. wsssh is a swiss army's knife server assisted tunnelling system for the win initially born as a websocket ssh tunnelling system and evolved to a universal tunnelling utility
### Key Components ### Key Components
......
# WebSocket SSH (wsssh) # WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive
![WebSocket SSH Logo](logos/logo-256.png) ![WebSocket SSH Logo](logos/logo-256.png)
A modern SSH tunneling system that uses WebSocket connections to securely route SSH/SCP traffic through registered client machines. This allows you to access remote servers through intermediate "jump hosts" using WebSocket-based tunnels. wsssh is a swiss army's knife server assisted tunnelling system for the win initially born as a websocket ssh tunnelling system and evolved to a universal tunnelling utility
## Features ## Features
......
# WebSocket SSH - Future Enhancements Roadmap # WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive - Future Enhancements Roadmap
## Recently Completed (v1.6.1) ## Recently Completed (v1.6.1)
- [x] **Major Code Refactoring**: Complete modularization of `wsssht.c` for improved maintainability - [x] **Major Code Refactoring**: Complete modularization of `wsssht.c` for improved maintainability
......
#!/bin/bash #!/bin/bash
# WebSocket SSH Tools Build Script # WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive Build Script
# Build script for WebSocket SSH tools (wssshd, wssshc, wsscp, etc.) # Build script for WSSSH tools (wssshd, wssshc, wsscp, etc.)
# #
# Copyright (C) 2024 Stefy Lanza <stefy@nexlab.net> and SexHack.me # Copyright (C) 2024 Stefy Lanza <stefy@nexlab.net> and SexHack.me
# #
......
#!/bin/bash #!/bin/bash
# WebSocket SSH Tools Clean Script # WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive Clean Script
# Clean script for removing build artifacts from WebSocket SSH tools # Clean script for removing build artifacts from WSSSH tools
# #
# Copyright (C) 2024 Stefy Lanza <stefy@nexlab.net> and SexHack.me # Copyright (C) 2024 Stefy Lanza <stefy@nexlab.net> and SexHack.me
# #
......
...@@ -11,19 +11,18 @@ Vcs-Git: https://git.nexlab.net/nexlab/wsssh.git ...@@ -11,19 +11,18 @@ Vcs-Git: https://git.nexlab.net/nexlab/wsssh.git
Package: wsssh-server Package: wsssh-server
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, debconf (>= 0.5) | debconf-2.0 Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, debconf (>= 0.5) | debconf-2.0
Description: WebSocket SSH Server (wssshd) Description: WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive Server (wssshd)
A modern SSH tunneling system that provides WebSocket-based SSH/SCP access wsssh is a swiss army's knife server assisted tunnelling system for the win initially born as a websocket ssh tunnelling system and evolved to a universal tunnelling utility. This package contains the server component
to registered client machines. This package contains the server component
that handles WebSocket connections and manages SSH tunnels. that handles WebSocket connections and manages SSH tunnels.
. .
This package includes a standalone PyInstaller binary that bundles all This package includes a standalone PyInstaller binary that bundles all
required dependencies, eliminating the need for external Python packages. required dependencies, eliminating the need for external Python packages.
. .
The wssshd server provides: The wssshd server provides:
- WebSocket SSH tunnel management - WSSSH tunnel management
- Client registration and authentication - Client registration and authentication
- Web-based management interface - Web-based management interface
- Secure tunnel establishment between clients and servers - Secure tunnel establishment between clients and servers
- High availability with watchdog monitoring - High availability with watchdog monitoring
. .
This is the server component of the WebSocket SSH system. This is the server component of the WSSSH system.
\ No newline at end of file \ No newline at end of file
# WebSocket SSH Client (wssshc) Configuration Example # WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive Client (wssshc) Configuration Example
# #
# This is an example configuration file for wssshc. # This is an example configuration file for wssshc.
# Copy this file to /etc/wssshc.conf or ~/.config/wsssh/wssshc.conf # Copy this file to /etc/wssshc.conf or ~/.config/wsssh/wssshc.conf
...@@ -24,3 +24,14 @@ password = my-secret-password ...@@ -24,3 +24,14 @@ password = my-secret-password
# Reconnection interval in seconds (default: 30) # Reconnection interval in seconds (default: 30)
interval = 30 interval = 30
# Default tunnel host and port (can be overridden by service configurations)
# tunnel-host = 127.0.0.1
# tunnel-port = 22
# Directory containing service configuration files (default: /etc/wsssh.d/)
# Multiple directories can be specified with colon separation
services-path = /etc/wsssh.d/
# Default service name for tunnel requests (default: ssh)
service = ssh
\ No newline at end of file
# WebSocket SSH Tunnel (wsssht) Configuration Example # WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive Tunnel (wsssht) Configuration Example
# #
# This is an example configuration file for wsssht. # This is an example configuration file for wsssht.
# Copy this file to ~/.config/wsssh/wsssht.conf and modify the settings as needed. # Copy this file to ~/.config/wsssh/wsssht.conf and modify the settings as needed.
......
...@@ -11,10 +11,9 @@ Vcs-Git: https://git.nexlab.net/nexlab/wsssh.git ...@@ -11,10 +11,9 @@ Vcs-Git: https://git.nexlab.net/nexlab/wsssh.git
Package: wsssh-tools Package: wsssh-tools
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, openssl Depends: ${shlibs:Depends}, ${misc:Depends}, openssl
Description: WebSocket SSH Tools - C implementation Description: WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive - C implementation
A modern SSH tunneling system that uses WebSocket connections to securely wsssh is a swiss army's knife server assisted tunnelling system for the win initially born as a websocket ssh tunnelling system and evolved to a universal tunnelling utility
route SSH/SCP traffic through registered client machines.
. .
This package contains the C implementation of the WebSocket SSH tools: This package contains the C implementation of the WSSSH tools:
wssshc (client registration), wsssht (tunnel setup tool with pipe mode), wssshc (client registration), wsssht (tunnel setup tool with pipe mode),
and wsssh (SSH wrapper with ProxyCommand support). and wsssh (SSH wrapper with ProxyCommand support).
\ No newline at end of file
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <errno.h> #include <errno.h>
#include <sched.h> #include <sched.h>
#include <pthread.h> #include <pthread.h>
#include <sys/wait.h>
#define INITIAL_FRAME_BUFFER_SIZE 8192 #define INITIAL_FRAME_BUFFER_SIZE 8192
...@@ -294,6 +295,182 @@ void handle_tunnel_request(SSL *ssl, const char *request_id, int debug, const ch ...@@ -294,6 +295,182 @@ void handle_tunnel_request(SSL *ssl, const char *request_id, int debug, const ch
} }
} }
// Execute a command before tunnel connection
static int execute_service_command(const char *command, int debug) {
if (!command || strlen(command) == 0) return 0;
if (debug) {
printf("[DEBUG] Executing service command: %s\n", command);
}
pid_t pid = fork();
if (pid == 0) {
// Child process
execl("/bin/sh", "sh", "-c", command, NULL);
_exit(1); // exec failed
} else if (pid > 0) {
// Parent process
int status;
waitpid(pid, &status, 0);
if (debug) {
printf("[DEBUG] Service command exited with status: %d\n", WEXITSTATUS(status));
}
return WEXITSTATUS(status) == 0 ? 0 : -1;
} else {
// Fork failed
perror("Failed to fork for service command");
return -1;
}
}
void handle_tunnel_request_with_service(SSL *ssl, const char *request_id, service_config_t *service, int debug) {
pthread_mutex_lock(&tunnel_mutex);
// Check if tunnel with this request_id already exists
tunnel_t *existing_tunnel = find_tunnel_by_request_id(request_id);
if (existing_tunnel) {
if (debug) {
printf("[DEBUG - Tunnel] Tunnel with request_id %s already exists, ignoring duplicate request\n", request_id);
}
pthread_mutex_unlock(&tunnel_mutex);
return;
}
// Execute service command if specified
if (service && service->command) {
if (execute_service_command(service->command, debug) != 0) {
if (debug) {
printf("[DEBUG - Tunnel] Service command failed, aborting tunnel request\n");
}
pthread_mutex_unlock(&tunnel_mutex);
return;
}
}
tunnel_t *new_tunnel = malloc(sizeof(tunnel_t));
if (!new_tunnel) {
perror("Memory allocation failed");
pthread_mutex_unlock(&tunnel_mutex);
return;
}
// For wssshc: Connect to target TCP endpoint and forward raw TCP data
struct sockaddr_in target_addr;
int target_sock;
// Determine protocol (TCP or UDP)
int use_udp = 0;
if (service && service->proto && strcmp(service->proto, "udp") == 0) {
use_udp = 1;
target_sock = socket(AF_INET, SOCK_DGRAM, 0);
if (debug) {
printf("[DEBUG - Tunnel] Using UDP protocol for service\n");
}
} else {
target_sock = socket(AF_INET, SOCK_STREAM, 0);
}
if (target_sock < 0) {
perror("Target socket creation failed");
free(new_tunnel);
pthread_mutex_unlock(&tunnel_mutex);
return;
}
memset(&target_addr, 0, sizeof(target_addr));
target_addr.sin_family = AF_INET;
// Use service configuration if available
const char *target_host = service && service->tunnel_host ? service->tunnel_host : "127.0.0.1";
int target_port = service && service->tunnel_port ? service->tunnel_port : 22;
target_addr.sin_port = htons(target_port); // Target port
// Resolve target host
struct hostent *target_he;
if ((target_he = gethostbyname(target_host)) == NULL) {
herror("Target host resolution failed");
close(target_sock);
free(new_tunnel);
pthread_mutex_unlock(&tunnel_mutex);
return;
}
target_addr.sin_addr = *((struct in_addr *)target_he->h_addr); // Target host
if (!use_udp) {
// TCP connection
if (connect(target_sock, (struct sockaddr *)&target_addr, sizeof(target_addr)) < 0) {
perror("Connection to target endpoint failed");
close(target_sock);
free(new_tunnel);
pthread_mutex_unlock(&tunnel_mutex);
return;
}
} else {
// For UDP, we don't connect, just set the target address for sending
// The connection will be established when we receive data
}
new_tunnel->sock = target_sock; // TCP/UDP connection to target
new_tunnel->local_sock = -1; // Not used in wssshc
strcpy(new_tunnel->request_id, request_id);
new_tunnel->active = 1;
new_tunnel->broken = 0;
new_tunnel->ssl = ssl;
new_tunnel->outgoing_buffer = NULL; // wssshc doesn't use buffer
new_tunnel->incoming_buffer = NULL; // wssshc doesn't need incoming buffer
new_tunnel->server_version_sent = 0; // Not used for raw TCP/UDP
// Add the new tunnel to the array
if (!add_tunnel(new_tunnel)) {
if (target_sock >= 0) close(target_sock);
free(new_tunnel);
pthread_mutex_unlock(&tunnel_mutex);
return;
}
pthread_mutex_unlock(&tunnel_mutex);
if (debug) {
printf("[DEBUG - Tunnel] wssshc connected to target %s:%d (%s)\n",
target_host, target_port, use_udp ? "UDP" : "TCP");
}
// Send tunnel_ack back to server
char ack_msg[256];
snprintf(ack_msg, sizeof(ack_msg), "{\"type\":\"tunnel_ack\",\"request_id\":\"%s\"}", request_id);
if (debug) {
printf("[DEBUG - WebSockets] Sending tunnel_ack: %s\n", ack_msg);
fflush(stdout);
}
// send_websocket_frame already uses SSL mutex internally
if (!send_websocket_frame(ssl, ack_msg)) {
fprintf(stderr, "Send tunnel_ack failed\n");
return;
}
// Start bidirectional forwarding between WebSocket and target TCP/UDP endpoint
thread_args_t *thread_args = malloc(sizeof(thread_args_t));
if (thread_args) {
thread_args->ssl = ssl;
thread_args->tunnel = new_tunnel;
thread_args->debug = debug;
pthread_t thread;
if (use_udp) {
// For UDP, we need a different forwarding function
// For now, use the TCP version but this should be enhanced for UDP
pthread_create(&thread, NULL, forward_ws_to_ssh_server, thread_args);
} else {
pthread_create(&thread, NULL, forward_ws_to_ssh_server, thread_args);
}
set_thread_cpu_affinity(thread); // Distribute thread across CPU cores
pthread_detach(thread);
}
}
void cleanup_tunnel(int debug) { void cleanup_tunnel(int debug) {
pthread_mutex_lock(&tunnel_mutex); pthread_mutex_lock(&tunnel_mutex);
......
...@@ -44,6 +44,15 @@ typedef struct { ...@@ -44,6 +44,15 @@ typedef struct {
pthread_t forward_thread; // Thread ID for the forwarding thread pthread_t forward_thread; // Thread ID for the forwarding thread
} tunnel_t; } tunnel_t;
// Service configuration structure
typedef struct {
char *name;
int tunnel_port;
char *tunnel_host;
char *command;
char *proto; // "tcp" or "udp", default "tcp"
} service_config_t;
// Thread arguments // Thread arguments
typedef struct { typedef struct {
SSL *ssl; SSL *ssl;
...@@ -77,6 +86,7 @@ void *forward_ws_to_local(void *arg); ...@@ -77,6 +86,7 @@ void *forward_ws_to_local(void *arg);
void *forward_ws_to_ssh_server(void *arg); void *forward_ws_to_ssh_server(void *arg);
void *tunnel_thread(void *arg); void *tunnel_thread(void *arg);
void handle_tunnel_request(SSL *ssl, const char *request_id, int debug, const char *ssh_host, int ssh_port); void handle_tunnel_request(SSL *ssl, const char *request_id, int debug, const char *ssh_host, int ssh_port);
void handle_tunnel_request_with_service(SSL *ssl, const char *request_id, service_config_t *service, int debug);
void handle_tunnel_data(SSL *ssl, const char *request_id, const char *data_hex, int debug); void handle_tunnel_data(SSL *ssl, const char *request_id, const char *data_hex, int debug);
void handle_tunnel_close(SSL *ssl, const char *request_id, int debug); void handle_tunnel_close(SSL *ssl, const char *request_id, int debug);
void send_tunnel_close(SSL *ssl, const char *request_id, int debug); void send_tunnel_close(SSL *ssl, const char *request_id, int debug);
......
.TH WSSCP 1 "September 2024" "wsscp 1.0" "WebSocket SSH Tools" .TH WSSCP 1 "September 2024" "wsscp 1.0" "WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive"
.SH NAME .SH NAME
wsscp \- SCP wrapper with WebSocket ProxyCommand support wsscp \- SCP wrapper with WebSocket ProxyCommand support
.SH SYNOPSIS .SH SYNOPSIS
...@@ -11,7 +11,7 @@ wsscp \- SCP wrapper with WebSocket ProxyCommand support ...@@ -11,7 +11,7 @@ wsscp \- SCP wrapper with WebSocket ProxyCommand support
is an SCP wrapper that automatically configures SCP to use WebSocket tunnels through is an SCP wrapper that automatically configures SCP to use WebSocket tunnels through
.B wsssht .B wsssht
with ProxyCommand. It parses the destination specification and constructs the appropriate with ProxyCommand. It parses the destination specification and constructs the appropriate
SCP command with ProxyCommand to establish secure file transfers through WebSocket relays. SCP command with ProxyCommand to establish secure file transfers through WSSSH relays.
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-\-help .B \-\-help
......
.TH WSSH 1 "September 2024" "wsssh 1.0" "WebSocket SSH Tools" .TH WSSH 1 "September 2024" "wsssh 1.0" "WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive"
.SH NAME .SH NAME
wsssh \- SSH wrapper with WebSocket ProxyCommand support wsssh \- SSH wrapper with WebSocket ProxyCommand support
.SH SYNOPSIS .SH SYNOPSIS
...@@ -12,7 +12,7 @@ wsssh \- SSH wrapper with WebSocket ProxyCommand support ...@@ -12,7 +12,7 @@ wsssh \- SSH wrapper with WebSocket ProxyCommand support
is an SSH wrapper that automatically configures SSH to use WebSocket tunnels through is an SSH wrapper that automatically configures SSH to use WebSocket tunnels through
.B wsssht .B wsssht
with ProxyCommand. It parses the target specification and constructs the appropriate with ProxyCommand. It parses the target specification and constructs the appropriate
SSH command with ProxyCommand to establish secure connections through WebSocket relays. SSH command with ProxyCommand to establish secure connections through WSSSH relays.
.SH OPTIONS .SH OPTIONS
.TP .TP
.B \-\-help .B \-\-help
......
.TH WSSHc 1 "September 2025" "wsssh-tools 1.4.0" "WebSocket SSH Tools" .TH WSSHc 1 "September 2025" "wsssh-tools 1.4.0" "WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive"
.SH NAME .SH NAME
wssshc \- WebSocket SSH Client for registration wssshc \- WebSocket SSH Client for registration
.SH SYNOPSIS .SH SYNOPSIS
...@@ -11,11 +11,17 @@ wssshc \- WebSocket SSH Client for registration ...@@ -11,11 +11,17 @@ wssshc \- WebSocket SSH Client for registration
[\fB\-\-tunnel\fR \fITYPES\fR] [\fB\-\-tunnel\fR \fITYPES\fR]
[\fB\-\-tunnel\-control\fR \fITYPES\fR] [\fB\-\-tunnel\-control\fR \fITYPES\fR]
[\fB\-\-wssshd\-private\-ip\fR \fIIP\fR] [\fB\-\-wssshd\-private\-ip\fR \fIIP\fR]
[\fB\-\-ssh\-host\fR \fIHOST\fR]
[\fB\-\-ssh\-port\fR \fIPORT\fR]
[\fB\-\-tunnel\-host\fR \fIHOST\fR]
[\fB\-\-tunnel\-port\fR \fIPORT\fR]
[\fB\-\-services\-path\fR \fIDIR\fR]
[\fB\-\-service\fR \fINAME\fR]
[\fB\-\-debug\fR] [\fB\-\-debug\fR]
[\fB\-\-help\fR] [\fB\-\-help\fR]
.SH DESCRIPTION .SH DESCRIPTION
.B wssshc .B wssshc
is a lightweight client for registering machines with a WebSocket SSH daemon (wssshd). It establishes a persistent WebSocket connection and maintains registration with the server, allowing SSH/SCP tunneling through the registered machine. is a lightweight client for registering machines with a WSSSH daemon (wssshd). It establishes a persistent WebSocket connection and maintains registration with the server, allowing SSH/SCP tunneling through the registered machine.
.PP .PP
Configuration can be provided via command line options or an optional INI-formatted configuration file at Configuration can be provided via command line options or an optional INI-formatted configuration file at
.B ~/.config/wsssh/wssshc.conf .B ~/.config/wsssh/wssshc.conf
...@@ -48,6 +54,24 @@ Transport types for control channel (comma-separated or 'any', default: any) ...@@ -48,6 +54,24 @@ Transport types for control channel (comma-separated or 'any', default: any)
.BR \-\-wssshd\-private\-ip " \fIIP\fR" .BR \-\-wssshd\-private\-ip " \fIIP\fR"
Private IP address of the wssshd server Private IP address of the wssshd server
.TP .TP
.BR \-\-ssh\-host " \fIHOST\fR"
SSH host to forward tunnel data to (default: 127.0.0.1) [legacy, use --tunnel-host]
.TP
.BR \-\-ssh\-port " \fIPORT\fR"
SSH port to forward tunnel data to (default: 22) [legacy, use --tunnel-port]
.TP
.BR \-\-tunnel\-host " \fIHOST\fR"
Tunnel host to forward tunnel data to (default: 127.0.0.1)
.TP
.BR \-\-tunnel\-port " \fIPORT\fR"
Tunnel port to forward tunnel data to (default: 22)
.TP
.BR \-\-services\-path " \fIDIR\fR"
Directory containing service configuration files (default: /etc/wsssh.d/)
.TP
.BR \-\-service " \fINAME\fR"
Default service name for tunnel requests (default: ssh)
.TP
.B \-\-debug .B \-\-debug
Enable debug output for troubleshooting Enable debug output for troubleshooting
.TP .TP
......
.TH WSSSHT 1 "September 2024" "WebSocket SSH" "User Commands" .TH WSSSHT 1 "September 2024" "WSSSH:: Warp-Powered Stefy's Spatial Secure Hyperdrive" "User Commands"
.SH NAME .SH NAME
wsssht \- WebSocket SSH Tunnel Setup Tool wsssht \- WebSocket SSH Tunnel Setup Tool
.SH SYNOPSIS .SH SYNOPSIS
...@@ -23,7 +23,7 @@ wsssht \- WebSocket SSH Tunnel Setup Tool ...@@ -23,7 +23,7 @@ wsssht \- WebSocket SSH Tunnel Setup Tool
[\fIservice://\fR]\fIclientid\fR[\fI@wssshd-host\fR][\fI:wssshd-port\fR] [\fIservice://\fR]\fIclientid\fR[\fI@wssshd-host\fR][\fI:wssshd-port\fR]
.SH DESCRIPTION .SH DESCRIPTION
.B wsssht .B wsssht
is a WebSocket SSH tunnel setup tool that establishes secure tunnels through WebSocket connections without automatically executing SSH/SCP commands. It provides connection information for manual use with any TCP client. is a WSSSH tunnel setup tool that establishes secure tunnels through WebSocket connections without automatically executing SSH/SCP commands. It provides connection information for manual use with any TCP client.
.PP .PP
Unlike Unlike
.BR wsssh (1) .BR wsssh (1)
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment