ESPReverseTCP icon indicating copy to clipboard operation
ESPReverseTCP copied to clipboard

[Errno 104] Connection reset by peer

Open kakopappa opened this issue 2 years ago • 4 comments

First of all, thanks for sharing this project. It's a great idea!

I am seeing [Errno 104] Connection reset by peer as soon as i do curl http://localhost:8080 I was wonding whether you had the same problem and how did you solve it ?

From the ESP. Looks fine

23:55:09.927 -> WNET xxxx FORWARD TO xxxxxxx 23:55:10.443 -> WLAN_CONN_RETRYWLAN_CONNECTED 23:55:10.443 -> IP: xxxx MAC: xxx 23:55:10.443 -> CONN_LISTENER 23:55:10.443 -> CONN_TCP 23:55:10.770 -> RECV_FROM_LISTENER 23:55:11.049 -> RECV_NOP 23:55:11.049 -> RECV_NOP 23:55:11.049 -> RECV_NOP 23:55:11.049 -> RECV_NOP 23:55:11.563 -> 23:55:11.563 -> 23:55:11.563 -> RECV_AUTH

Python

Waiting for ESP-32 to connect to us... ('Got connection from ESP32:', ('xxxxx', 52826)) Starting local input socket on 127.0.0.1 port 8080... ('Got local connection from:', ('127.0.0.1', 42714)) Sending 78 bytes to the target... [Errno 104] Connection reset by peer Waiting for ESP-32 to connect to us...

kakopappa avatar Jan 10 '23 17:01 kakopappa

I think I have some flaws in the protocol design that need fixing and I’ll look into this in the coming days. Thanks for reporting these bugs!

userlandkernel avatar Feb 12 '23 00:02 userlandkernel

What I expect is that perhaps a buffer overflow vulnerability is causing this issue on the ESP side

userlandkernel avatar Feb 12 '23 00:02 userlandkernel

Great let me know if you need help testing

kakopappa avatar Feb 13 '23 12:02 kakopappa

I identified a flaw in the protocol where I was sending a DWORD from the client instead of a byte. Nevertheless I think this project needs a redesign so I’ll be busy rewriting it and then push the fix

userlandkernel avatar Feb 14 '23 22:02 userlandkernel