subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
#subprocess.call("cls", shell=True) print(result) print(subprocess.check_output("python bazi.py -b " + result, shell=True).decode('gbk'))- Confidence
- 99% confidence
- Finding
- The code builds a shell command by concatenating user-controlled command-line input into a string and executes it with shell=True. This enables command injection if an attacker supplies shell metacharacters through gans/zhis, allowing arbitrary OS command execution under the script's privileges.
