Closed Miracles666 closed 8 months ago
I got the same issue, had you fixed it?
@ananan @Miracles666 using -no-stdin
option should resolve this issue.
need add shell=False to subprocess.run too
Unfortunately it's related to the particular way the os buffers stdin. All the tools attempt to collect all the targets from various input sources and deduplicate them. Shell=True
implies that the command is executed as a child process of the default shell, which indirectly connects stdin/stdout/stderr to it via Popen.communicate
, hence httpx detects the presence of potential data via stdin. Since you are using an absolute path, as @ananan mentioned, you could set Shell=False
, additionally I think you can remove sudo since httpx really doesn't need elevated privileges.
I'm closing the issue due to inactivity - Feel free to reopen in case you are still facing troubles
I encountered a very strange bug. I want to use Python to call a Golang compiled httpx program by running test.py script. Here's the code:
java Copy code import subprocess
cmd = "sudo /home/miracles/xxxx/client/subdomain/thirdparty/httpx/httpx -t 30 -rl 60 -fr -ec -sc -cl -title -td -l /home/miracles/jx-scan/client/subdomain/results/temp/domains_tmp_1681376467_XpFhcHfcOJ.txt "
subprocess.run(cmd, shell=True) When I run the program by right-clicking on it in PyCharm and selecting 'run', it gets stuck and doesn't work, like this:
It doesn't return any results. However, when I run the code using the command python3 test.py, it successfully returns the expected results:
I noticed that this issue only occurs with binaries from Project Discovery, as their other products like naabu also have the same problem."