We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e24fb58 commit 492ad54Copy full SHA for 492ad54
main.py
@@ -1,5 +1,6 @@
1
import requests
2
import subprocess
3
+import shlex
4
5
def func_calls():
6
formats.get_format()
@@ -20,7 +21,7 @@ def func_calls():
20
21
22
# Introduce a command injection vulnerability
23
user_input = input("Enter a command to execute: ")
- command = "ping " + user_input
24
- subprocess.call(command, shell=True)
+ command = ["ping"] + shlex.split(user_input)
25
+ subprocess.call(command, shell=False)
26
- print("Command executed!")
27
+ print("Command executed!")
0 commit comments