Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
wsssh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
wsssh
Commits
56dae178
Commit
56dae178
authored
Sep 17, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add flag to prevent duplicate server version sends and fix syntax error
parent
cf1fbef9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
59 deletions
+69
-59
tunnel.c
wssshtools/tunnel.c
+68
-59
tunnel.h
wssshtools/tunnel.h
+1
-0
No files found.
wssshtools/tunnel.c
View file @
56dae178
...
@@ -600,6 +600,13 @@ void handle_tunnel_data(SSL *ssl __attribute__((unused)), const char *request_id
...
@@ -600,6 +600,13 @@ void handle_tunnel_data(SSL *ssl __attribute__((unused)), const char *request_id
pthread_mutex_unlock
(
&
tunnel_mutex
);
pthread_mutex_unlock
(
&
tunnel_mutex
);
}
else
{
}
else
{
// wsssh/wssshc: Send directly to target socket
// wsssh/wssshc: Send directly to target socket
// Skip if server version was already sent early
if
(
active_tunnel
->
server_version_sent
&&
strstr
(
data
,
"SSH-2.0-OpenSSH_10.0p2 Debian-8"
))
{
if
(
debug
)
{
printf
(
"[DEBUG] Skipping duplicate server version send
\n
"
);
fflush
(
stdout
);
}
}
else
{
if
(
debug
)
{
if
(
debug
)
{
printf
(
"[DEBUG] Attempting to send %zu bytes to socket %d
\n
"
,
data_len
,
target_sock
);
printf
(
"[DEBUG] Attempting to send %zu bytes to socket %d
\n
"
,
data_len
,
target_sock
);
printf
(
"[DEBUG - TOREMOVE] Target socket is %d
\n
"
,
target_sock
);
printf
(
"[DEBUG - TOREMOVE] Target socket is %d
\n
"
,
target_sock
);
...
@@ -670,6 +677,7 @@ void handle_tunnel_data(SSL *ssl __attribute__((unused)), const char *request_id
...
@@ -670,6 +677,7 @@ void handle_tunnel_data(SSL *ssl __attribute__((unused)), const char *request_id
fflush
(
stdout
);
fflush
(
stdout
);
}
}
}
}
}
free
(
data
);
free
(
data
);
}
}
...
@@ -1062,6 +1070,7 @@ int setup_tunnel(const char *wssshd_host, int wssshd_port, const char *client_id
...
@@ -1062,6 +1070,7 @@ int setup_tunnel(const char *wssshd_host, int wssshd_port, const char *client_id
active_tunnel
->
active
=
1
;
active_tunnel
->
active
=
1
;
active_tunnel
->
broken
=
0
;
active_tunnel
->
broken
=
0
;
active_tunnel
->
ssl
=
ssl
;
active_tunnel
->
ssl
=
ssl
;
active_tunnel
->
server_version_sent
=
0
;
// Start listening on local port
// Start listening on local port
int
listen_sock
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
int
listen_sock
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
...
...
wssshtools/tunnel.h
View file @
56dae178
...
@@ -40,6 +40,7 @@ typedef struct {
...
@@ -40,6 +40,7 @@ typedef struct {
SSL
*
ssl
;
// WebSocket SSL connection
SSL
*
ssl
;
// WebSocket SSL connection
frame_buffer_t
*
outgoing_buffer
;
// Buffer for data to send to local socket (wsscp only)
frame_buffer_t
*
outgoing_buffer
;
// Buffer for data to send to local socket (wsscp only)
frame_buffer_t
*
incoming_buffer
;
// Buffer for incoming data before connection is established
frame_buffer_t
*
incoming_buffer
;
// Buffer for incoming data before connection is established
int
server_version_sent
;
// Flag to indicate if server version was sent early
}
tunnel_t
;
}
tunnel_t
;
// Global variables
// Global variables
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment