From 6f28d22f9e5809fe7ed9bf484a14b214af46e8c0 Mon Sep 17 00:00:00 2001 From: "patched.codes[bot]" <298395+patched.codes[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 18:35:58 +0800 Subject: [PATCH] Patched /Users/codelion/Documents/GitHub/example-python/main.py --- main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 468f8c0..540faf6 100644 --- a/main.py +++ b/main.py @@ -10,17 +10,17 @@ def func_calls(): if __name__ == '__main__': session = requests.Session() proxies = { - 'http': 'http://test:pass@localhost:8080', - 'https': 'http://test:pass@localhost:8090', + 'http': 'https://test:pass@localhost:8080', + 'https': 'https://test:pass@localhost:8090', } - url = 'http://example.com' # Replace with a valid URL + url = 'https://example.com' # Replace with a valid URL req = requests.Request('GET', url) prep = req.prepare() session.rebuild_proxies(prep, proxies) # Introduce a command injection vulnerability user_input = input("Enter a command to execute: ") - command = "ping " + user_input - subprocess.call(command, shell=True) + command = ["ping", user_input] + subprocess.call(command) - print("Command executed!") \ No newline at end of file + print("Command executed!")