forked from veracode/example-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
26 lines (22 loc) · 784 Bytes
/
main.py
File metadata and controls
26 lines (22 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import requests
import subprocess
def func_calls():
formats.get_format()
algorithms.HMACAlgorithm.prepare_key()
cli.VerifyOperation.perform_operation()
sessions.SessionRedirectMixin.resolve_redirects()
if __name__ == '__main__':
session = requests.Session()
proxies = {
'http': 'http://test:pass@localhost:8080',
'https': 'http://test:pass@localhost:8090',
}
url = 'http://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)
print("Command executed!")