Update README and CHANGELOG with latest improvements; enhance logo assets and...

Update README and CHANGELOG with latest improvements; enhance logo assets and C implementations; add clean script; update .gitignore to ignore videos
parent 49ce709d
...@@ -54,3 +54,6 @@ Thumbs.db ...@@ -54,3 +54,6 @@ Thumbs.db
# Temporary files # Temporary files
*.tmp *.tmp
*.bak *.bak
# Videos and temporary media
*.mp4
\ No newline at end of file
...@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. ...@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.2.0] - 2025-09-13
### Changed
- Improved quality and resolution of all logo and icon assets in the `logos/` directory
- Minor enhancements and optimizations to `wssshtools/wsssh.c` and `wssshtools/wssshc.c` implementations
### Added
- `clean` script for comprehensive cleanup of build artifacts (renamed from clean.sh for consistency)
## [1.1.0] - 2024-09-12 ## [1.1.0] - 2024-09-12
### Added ### Added
......
...@@ -439,4 +439,10 @@ Your support helps us continue developing and maintaining this open-source proje ...@@ -439,4 +439,10 @@ Your support helps us continue developing and maintaining this open-source proje
## Changelog ## Changelog
### Latest Updates
- Enhanced logo assets with higher quality versions for better visual presentation
- Improved C implementation files for better performance and reliability
- Added dedicated clean script for easier project maintenance
See [CHANGELOG.md](CHANGELOG.md) for version history and changes. See [CHANGELOG.md](CHANGELOG.md) for version history and changes.
\ No newline at end of file
#!/bin/bash
# WebSocket SSH Tools Clean Script
# Clean script for removing build artifacts from WebSocket SSH tools
#
# Copyright (C) 2024 Stefy Lanza <stefy@nexlab.net> and SexHack.me
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Remove PyInstaller build artifacts
rm -rf build/
rm -rf dist/
rm -f *.spec
# Remove C version build artifacts
if [ -d "wssshtools" ]; then
cd wssshtools
make clean 2>/dev/null || true
rm -f Makefile
rm -f configure.sh.stamp
rm -f man/*.1.gz 2>/dev/null || true
cd ..
fi
# Remove Debian packaging artifacts
rm -f dist/wsssh-tools*.deb
rm -f dist/wsssh-tools*.dsc
rm -f dist/wsssh-tools*.tar.gz
rm -f dist/wsssh-tools*.changes
rm -f dist/wsssh-tools*.buildinfo
rm -f wsssh-tools*.deb
rm -f wsssh-tools*.dsc
rm -f wsssh-tools*.tar.gz
rm -f wsssh-tools*.changes
rm -f wsssh-tools*.buildinfo
# Remove Debian build directory and artifacts
if [ -d "wssshtools" ]; then
rm -rf wssshtools/debian/wsssh-tools/
rm -f wssshtools/debian/files
rm -f wssshtools/debian/*.debhelper*
rm -f wssshtools/debian/*.substvars
rm -f wssshtools/debian/debhelper-build-stamp
fi
# Optionally remove SSL certificates (uncomment if needed)
# rm -f cert.pem key.pem
echo "Clean complete. Build artifacts removed."
echo "Note: SSL certificates (cert.pem, key.pem) preserved. Uncomment lines in clean.sh to remove them."
\ No newline at end of file
logos/banner-800x200.png

52.7 KB | W: | H:

logos/banner-800x200.png

52.8 KB | W: | H:

logos/banner-800x200.png
logos/banner-800x200.png
logos/banner-800x200.png
logos/banner-800x200.png
  • 2-up
  • Swipe
  • Onion skin
logos/icon-128.png

23.2 KB | W: | H:

logos/icon-128.png

23.3 KB | W: | H:

logos/icon-128.png
logos/icon-128.png
logos/icon-128.png
logos/icon-128.png
  • 2-up
  • Swipe
  • Onion skin
logos/icon-16.png

2.34 KB | W: | H:

logos/icon-16.png

2.43 KB | W: | H:

logos/icon-16.png
logos/icon-16.png
logos/icon-16.png
logos/icon-16.png
  • 2-up
  • Swipe
  • Onion skin
logos/icon-256.png

84.6 KB | W: | H:

logos/icon-256.png

84.7 KB | W: | H:

logos/icon-256.png
logos/icon-256.png
logos/icon-256.png
logos/icon-256.png
  • 2-up
  • Swipe
  • Onion skin
logos/icon-32.png

3.24 KB | W: | H:

logos/icon-32.png

3.33 KB | W: | H:

logos/icon-32.png
logos/icon-32.png
logos/icon-32.png
logos/icon-32.png
  • 2-up
  • Swipe
  • Onion skin
logos/icon-48.png

4.91 KB | W: | H:

logos/icon-48.png

5.01 KB | W: | H:

logos/icon-48.png
logos/icon-48.png
logos/icon-48.png
logos/icon-48.png
  • 2-up
  • Swipe
  • Onion skin
logos/icon-64.png

7.23 KB | W: | H:

logos/icon-64.png

7.33 KB | W: | H:

logos/icon-64.png
logos/icon-64.png
logos/icon-64.png
logos/icon-64.png
  • 2-up
  • Swipe
  • Onion skin
logos/logo-128.png

23.2 KB | W: | H:

logos/logo-128.png

23.3 KB | W: | H:

logos/logo-128.png
logos/logo-128.png
logos/logo-128.png
logos/logo-128.png
  • 2-up
  • Swipe
  • Onion skin
logos/logo-256.png

84.6 KB | W: | H:

logos/logo-256.png

84.7 KB | W: | H:

logos/logo-256.png
logos/logo-256.png
logos/logo-256.png
logos/logo-256.png
  • 2-up
  • Swipe
  • Onion skin
logos/logo-512.png

307 KB | W: | H:

logos/logo-512.png

307 KB | W: | H:

logos/logo-512.png
logos/logo-512.png
logos/logo-512.png
logos/logo-512.png
  • 2-up
  • Swipe
  • Onion skin
logos/logo-64.png

7.23 KB | W: | H:

logos/logo-64.png

7.33 KB | W: | H:

logos/logo-64.png
logos/logo-64.png
logos/logo-64.png
logos/logo-64.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -357,7 +357,7 @@ int websocket_handshake(SSL *ssl, const char *host, int port, const char *path) ...@@ -357,7 +357,7 @@ int websocket_handshake(SSL *ssl, const char *host, int port, const char *path)
"GET %s HTTP/1.1\r\n" "GET %s HTTP/1.1\r\n"
"Host: %s:%d\r\n" "Host: %s:%d\r\n"
"Upgrade: websocket\r\n" "Upgrade: websocket\r\n"
"Connection: Upgrade\r\n" "Connection: upgrade\r\n"
"Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n" "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n"
"Sec-WebSocket-Version: 13\r\n" "Sec-WebSocket-Version: 13\r\n"
"\r\n", "\r\n",
...@@ -405,19 +405,45 @@ int send_json_message(SSL *ssl, const char *type, const char *client_id, const c ...@@ -405,19 +405,45 @@ int send_json_message(SSL *ssl, const char *type, const char *client_id, const c
return send_websocket_frame(ssl, message); return send_websocket_frame(ssl, message);
} }
int send_all(SSL *ssl, const char *data, int len) {
int total_sent = 0;
while (total_sent < len) {
int sent = SSL_write(ssl, data + total_sent, len - total_sent);
if (sent <= 0) {
ERR_print_errors_fp(stderr);
return 0;
}
total_sent += sent;
}
return 1;
}
int send_websocket_frame(SSL *ssl, const char *data) { int send_websocket_frame(SSL *ssl, const char *data) {
char frame[BUFFER_SIZE];
frame[0] = 0x81; // FIN + text opcode
int msg_len = strlen(data); int msg_len = strlen(data);
int header_len = 2; int header_len = 2;
if (msg_len <= 125) {
header_len = 6; // 2 + 4 for mask
} else if (msg_len <= 65535) {
header_len = 8; // 4 + 4 for mask
} else {
header_len = 14; // 10 + 4 for mask
}
char *frame = malloc(header_len + msg_len);
if (!frame) {
perror("Memory allocation failed for frame");
return 0;
}
frame[0] = 0x81; // FIN + text opcode
if (msg_len <= 125) { if (msg_len <= 125) {
frame[1] = 0x80 | msg_len; // MASK + length frame[1] = 0x80 | msg_len; // MASK + length
} else if (msg_len <= 65535) { } else if (msg_len <= 65535) {
frame[1] = 0x80 | 126; // MASK + extended length frame[1] = 0x80 | 126; // MASK + extended length
frame[2] = (msg_len >> 8) & 0xFF; frame[2] = (msg_len >> 8) & 0xFF;
frame[3] = msg_len & 0xFF; frame[3] = msg_len & 0xFF;
header_len = 4;
} else { } else {
frame[1] = 0x80 | 127; // MASK + extended length frame[1] = 0x80 | 127; // MASK + extended length
frame[2] = 0; frame[2] = 0;
...@@ -428,16 +454,14 @@ int send_websocket_frame(SSL *ssl, const char *data) { ...@@ -428,16 +454,14 @@ int send_websocket_frame(SSL *ssl, const char *data) {
frame[7] = (msg_len >> 16) & 0xFF; frame[7] = (msg_len >> 16) & 0xFF;
frame[8] = (msg_len >> 8) & 0xFF; frame[8] = (msg_len >> 8) & 0xFF;
frame[9] = msg_len & 0xFF; frame[9] = msg_len & 0xFF;
header_len = 10;
} }
// Add mask key // Add mask key
char mask_key[4]; char mask_key[4];
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
mask_key[i] = rand() % 256; mask_key[i] = rand() % 256;
frame[header_len + i] = mask_key[i]; frame[header_len - 4 + i] = mask_key[i];
} }
header_len += 4;
// Mask payload // Mask payload
for (int i = 0; i < msg_len; i++) { for (int i = 0; i < msg_len; i++) {
...@@ -445,7 +469,9 @@ int send_websocket_frame(SSL *ssl, const char *data) { ...@@ -445,7 +469,9 @@ int send_websocket_frame(SSL *ssl, const char *data) {
} }
int frame_len = header_len + msg_len; int frame_len = header_len + msg_len;
return SSL_write(ssl, frame, frame_len) > 0; int result = send_all(ssl, frame, frame_len);
free(frame);
return result;
} }
int parse_websocket_frame(const char *buffer, int bytes_read, char **payload, int *payload_len) { int parse_websocket_frame(const char *buffer, int bytes_read, char **payload, int *payload_len) {
......
...@@ -252,25 +252,20 @@ void *tunnel_thread(void *arg) { ...@@ -252,25 +252,20 @@ void *tunnel_thread(void *arg) {
printf("[DEBUG] Sending tunnel_response, hex len: %zu, hex: %.100s...\n", strlen(hex_data), hex_data); printf("[DEBUG] Sending tunnel_response, hex len: %zu, hex: %.100s...\n", strlen(hex_data), hex_data);
} }
size_t response_size = 48 + strlen(request_id) + strlen(hex_data) + 1; char response[9000];
char *response = malloc(response_size); int response_len = snprintf(response, sizeof(response), "{\"type\":\"tunnel_response\",\"request_id\":\"%s\",\"data\":\"%s\"}", request_id, hex_data);
if (!response) { if (response_len < 0 || (size_t)response_len >= sizeof(response)) {
perror("Memory allocation failed for response"); perror("JSON construction failed");
free(hex_data); free(hex_data);
break; break;
} }
strcpy(response, "{\"type\":\"tunnel_response\",\"request_id\":\"");
strcat(response, request_id);
strcat(response, "\",\"data\":\"");
strcat(response, hex_data);
strcat(response, "\"}");
if (global_debug) { if (global_debug) {
printf("[DEBUG] Sending tunnel_response, len: %zu\n", strlen(response)); printf("[DEBUG] Sending tunnel_response, len: %d\n", response_len);
} }
// Send as WebSocket frame with proper length encoding // Send as WebSocket frame with proper length encoding
int msg_len = strlen(response); int msg_len = response_len;
int header_len = 2; int header_len = 2;
char mask_key[4]; char mask_key[4];
...@@ -285,7 +280,6 @@ void *tunnel_thread(void *arg) { ...@@ -285,7 +280,6 @@ void *tunnel_thread(void *arg) {
char *frame = malloc(header_len + msg_len); char *frame = malloc(header_len + msg_len);
if (!frame) { if (!frame) {
perror("Memory allocation failed for frame"); perror("Memory allocation failed for frame");
free(response);
free(hex_data); free(hex_data);
break; break;
} }
...@@ -328,7 +322,6 @@ void *tunnel_thread(void *arg) { ...@@ -328,7 +322,6 @@ void *tunnel_thread(void *arg) {
} }
free(frame); free(frame);
free(response);
free(hex_data); free(hex_data);
} }
......
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