subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: # 执行任意命令 result = subprocess.run( command_str, shell=True, capture_output=True,- Confidence
- 99% confidence
- Finding
- This function executes attacker-controlled strings with shell=True, giving the skill unrestricted arbitrary command execution on the host. In the context of an OS-control agent, that means prompt/tool input can become full shell access, enabling file deletion, malware execution, persistence, credential theft, or lateral movement.
