【发布时间】:2021-06-08 16:53:39
【问题描述】:
我正在尝试运行 bash 命令来启动 Nikto 并在终端中显示输出,但是程序没有返回任何内容。任何帮助将不胜感激,谢谢。
在输入到python程序之前,该命令在终端中运行良好
import subprocess
import os
def bash(command):
return subprocess.check_output(['bash', '-c', command])
def niktoScan():
res = bash('nikto -Display 1234EP -o report.html -Format htm -Tuning 123bde -host 127.0.0.1').splitlines()
print(res)
【问题讨论】:
标签: python bash python-2.7 subprocess