-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UDP mode not working in background on GNU/Linux #119
Comments
It does work on my machine. Can you try to do the same in foreground and see if it somehow quits? |
Hmm. In foreground it works. I tried it with Python versions 2.7.18, 3.9.2, and 3.10.8, and it does not work in background. More info: I tried on Debian Stable (bullseye) and with Debian Unstable.
------------------------------------8<------------------------------------ Just to let you know, I'm working on Debian packaging [1] of pwncat, and I |
Thanks for the details 👍, I will look into this |
The issue seems to be the stdin file descriptor, when it is not attached to a terminal anymore:
This happens both in TCP and also UDP mode as it is not connected to any mode. It is trying to read from stdin, but stdin does not exist. It can therefore (atm) not put into background mode. I will need to do a little digging if this is possible somehow. |
I can reproduce it with a very simple script:
import sys
print(sys.stdin.readline()) And then run it with nohup: $ nohup python test.py
$ cat nohup.out
Traceback (most recent call last):
File "test.py", line 3, in <module>
print(sys.stdin.readline())
IOError: [Errno 9] Bad file descriptor
|
What you can do for now is the following command for a server: TCP
UDP nohup ./pwncat -l --no-shutdown -u 127.0.0.1 9998 > log.log 2>&1 |
@cytopia For me, the problem occurs only in UDP mode, TCP runs OK in background mode. |
@cytopia Hi there! Any news about this issue? |
Hi there,
When running the pwncat with option -u (for UDP mode) it does not work in background on GNU/Linux.
Example:
$ ./bin/pwncat -u -l 127.0.0.1 9999 &
[1]+ Stopped ./bin/pwncat -u -l 127.0.0.1 9999
A few seconds after starting it stops listening on the specified UDP port.
Best Regards,
mt
The text was updated successfully, but these errors were encountered: