Closed jm33-m0 closed 4 years ago
Here https://github.com/jm33-m0/emp3r0r/blob/9198b20be68a362ef2fa5e9cb2b984db698931b2/core/internal/agent/proxy.go#L105 The agent establishes one connection to target service, no matter how many connections the target can handle, therefore when multiple clients are using the port-mapping, they all get messed up.
Here CC's TCP server is concurrent https://github.com/jm33-m0/emp3r0r/blob/9198b20be68a362ef2fa5e9cb2b984db698931b2/core/internal/cc/proxy.go#L181 But on agent, it's not https://github.com/jm33-m0/emp3r0r/blob/9198b20be68a362ef2fa5e9cb2b984db698931b2/core/internal/agent/proxy.go#L183 I can't think of a better solution, so I temporarily disallow concurrency.
https://github.com/jm33-m0/emp3r0r/commit/191af4b48d62d289b96d977dc465530096d8c640 kinda fixes this issue
Now since port-fwd is finally working for single client, I am going to implement concurrency support on CC side
There's still an issue: Target TCP service on agent can't send its response to correct receiver when there're more than one clients connected. All clients can send anything to target service without issue, though.