Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Commented Unassigned: SOCKS Proxy - Port is wrongly written to socket [2680]

$
0
0
Hi,

The port to write to socket should be masked and bit shift instead of dividing and modulus.

// Send port
//SocketWriteByte((byte)(ConnectionInfo.Port / 0xFF));
//SocketWriteByte((byte)(ConnectionInfo.Port % 0xFF));
// Mask & bit shift, not divide or modulus
SocketWriteByte((byte)((ConnectionInfo.Port & 0xFF00) >> 8));
SocketWriteByte((byte)(ConnectionInfo.Port & 0xFF));

Thanks.
Comments: ** Comment from web user: ShienIkiru **

This should be treated as URGENT.
I realize this when using port 443, and sending 444 instead and so I use 256 instead of 0xff. But your code seem the proper way.


Viewing all articles
Browse latest Browse all 1026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>