subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def get_existing_windows_tasks(): """获取Windows现有任务""" try: result = subprocess.run( ['schtasks', '/query', '/fo', 'LIST', '/v'], capture_output=True, text=True,- Confidence
- 93% confidence
- Finding
- The Windows task query uses `subprocess.run(..., shell=True)` even though it passes a fixed command list. On Windows, enabling the shell unnecessarily expands the attack surface and can cause command execution semantics to depend on `cmd.exe` and environment/path resolution, which is risky in an installer that sets up persistence.
