sockstlsproxy icon indicating copy to clipboard operation
sockstlsproxy copied to clipboard

Breaking Exception Thrown

Open Frogsecurity opened this issue 2 years ago • 1 comments

Could you help me hunt down the location of where this exception would be thrown?

The TCP client throw a breaking exception when a port is not open or times out on a specific destination.

I am a noob to async C# so this has been a doozy lol

Unhandled Exception: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 192.168.53.2:135 at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port) at Proxy.SocksProxy.<HandleClient>d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Proxy.SocksProxy.<>c__DisplayClass8_0.<<Start>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_1(Object state) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Frogsecurity avatar Oct 17 '23 05:10 Frogsecurity

Hi @Frogsecurity,

Firstly, I do apologize for the significant delay is respoding to the open issue.

Not sure if you eventually managed to resolve the issue?

Judging by the posted error message, it would seem that the error originates from the connection being established between the SOCKS proxy and the destination host:

https://github.com/sensepost/sockstlsproxy/blob/main/Proxy/SocksProxy.cs#L112

It might be something as simple as a firewall rule blocking connectivity on the destination host or a wrongly typed IP address.

Tripex48 avatar Mar 11 '25 09:03 Tripex48