Skip to content

Bug in SOCKS5 connections - port written to wire incorrect #447

Closed
@chrismasters

Description

@chrismasters

I was trying to connect to a host on port 10022 and this was consistently not working.

When I looked in our SOCKS logs, I saw the connection was being attempted on port 10061

I believe the code in question is
https://github.com/sshnet/SSH.NET/blob/develop/src/Renci.SshNet/Session.cs#L2150

10022 / 255 = 0x27
10022 % 255 = 0x4D

0x274D == 10061 != 10022

If I change the port to 9983, then I can trick it into working

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions