File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,15 @@ def func_calls():
1111 session = requests .Session ()
1212 proxies = {
1313 'http' : 'http://test:pass@localhost:8080' ,
14- 'https' : 'http ://test:pass@localhost:8090' ,
14+ 'https' : 'https ://test:pass@localhost:8090' , # Changed to https
1515 }
1616 url = 'http://example.com' # Replace with a valid URL
1717 req = requests .Request ('GET' , url )
1818 prep = req .prepare ()
1919 session .rebuild_proxies (prep , proxies )
2020
21- # Introduce a command injection vulnerability
2221 user_input = input ("Enter a command to execute: " )
23- command = "ping " + user_input
24- subprocess .call (command , shell = True )
22+ command = [ "ping" , user_input ] # Changed to use list syntax
23+ subprocess .run (command , shell = False ) # Changed to not use shell=True
2524
26- print ("Command executed!" )
25+ print ("Command executed!" )
You can’t perform that action at this time.
0 commit comments