File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -10,17 +10,17 @@ def func_calls():
10
10
if __name__ == '__main__' :
11
11
session = requests .Session ()
12
12
proxies = {
13
- 'http' : 'http ://test:pass@localhost:8080' ,
14
- 'https' : 'http ://test:pass@localhost:8090' ,
13
+ 'http' : 'https ://test:pass@localhost:8080' ,
14
+ 'https' : 'https ://test:pass@localhost:8090' ,
15
15
}
16
- url = 'http ://example.com' # Replace with a valid URL
16
+ url = 'https ://example.com' # Replace with a valid URL
17
17
req = requests .Request ('GET' , url )
18
18
prep = req .prepare ()
19
19
session .rebuild_proxies (prep , proxies )
20
20
21
- # Introduce a command injection vulnerability
22
21
user_input = input ("Enter a command to execute: " )
23
- command = "ping " + user_input
24
- subprocess .call (command , shell = True )
25
-
26
- print ("Command executed!" )
22
+ executable = "ping"
23
+ args = ["-t" , 1 ]
24
+ subprocess .run ([executable ] + args , capture_output = True , text = True , check = False )
25
+
26
+ print ("Command executed!" )
You can’t perform that action at this time.
0 commit comments