jm33-m0 / emp3r0r

Linux/Windows post-exploitation framework made by linux user
https://infosec.exchange/@jm33
MIT License
1.26k stars 232 forks source link

Port-Fwd packet loss #3

Closed jm33-m0 closed 4 years ago

jm33-m0 commented 4 years ago

Using ncat to test, the port-mapping works okay, most messages get sent and received, but sometimes messages sent from CC are not displayed on agent's side.

If take ssh port as an example, ssh doesn't even work as it complains about bad packet or something.

jm33-m0 commented 4 years ago

https://github.com/jm33-m0/emp3r0r/blob/7d978a3c87d3ee3af63d6036cbb0a6e2f69386ce/core/internal/agent/proxy.go#L121-L138

This goroutine reads from h2conn, stealing bytes from https://github.com/jm33-m0/emp3r0r/blob/7d978a3c87d3ee3af63d6036cbb0a6e2f69386ce/core/internal/agent/proxy.go#L149

jm33-m0 commented 4 years ago

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.