Skip to content

Commit 022175d

Browse files
author
patched.codes[bot]
committed
Patched main.py
1 parent 9e553e4 commit 022175d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

main.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
sessions.SessionRedirectMixin.resolve_redirects()
99
session = requests.Session()
1010
proxies = {
11-
'http': 'http://test:pass@localhost:8080',
12-
'https': 'http://test:pass@localhost:8090',
11+
'http': 'https://test:pass@localhost:8080',
12+
'https': 'https://test:pass@localhost:8090',
1313
}
14-
url = 'http://example.com' # Replace with a valid URL
14+
url = 'https://example.com' # Replace with a valid URL
1515
req = requests.Request('GET', url)
1616
prep = req.prepare()
1717
session.rebuild_proxies(prep, proxies)
1818

19-
# Introduce a command injection vulnerability
19+
# Safe subprocess call
2020
user_input = input("Enter a command to execute: ")
21-
command = "ping " + user_input
22-
subprocess.call(command, shell=True)
21+
command = ["ping", user_input]
22+
subprocess.call(command, shell=False)
2323

24-
print("Command executed!")
24+
print("Command executed!")

0 commit comments

Comments
 (0)