subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_command(cmd): """执行 shell 命令并返回结果""" try: result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=30) return result.stdout.strip() except Exception as e: return f"Error: {e}"- Confidence
- 97% confidence
- Finding
- result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=30)
