Skip to content

Commit ce3e591

Browse files
author
patched.codes[bot]
committed
Patched /Users/codelion/Documents/GitHub/example-python/main.py
1 parent e24fb58 commit ce3e591

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

main.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ def func_calls():
1010
if __name__ == '__main__':
1111
session = requests.Session()
1212
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',
1515
}
16-
url = 'http://example.com' # Replace with a valid URL
16+
url = 'https://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)
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!")

0 commit comments

Comments
 (0)