subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_command(cmd): """Run command and return output""" try: result = subprocess.run(cmd, shell=True, capture_output=True, text=True, check=True) return result.stdout.strip() except subprocess.CalledProcessError as e: return f"Error: {e.stderr.strip()}"- Confidence
- 96% confidence
- Finding
- result = subprocess.run(cmd, shell=True, capture_output=True, text=True, check=True)
