File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed
Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change 11import requests
22import subprocess
3+ from django .http import JsonResponse
34
45def func_calls ():
56 formats .get_format ()
@@ -8,19 +9,14 @@ def func_calls():
89 sessions .SessionRedirectMixin .resolve_redirects ()
910
1011if __name__ == '__main__' :
11- session = requests .Session ()
12- proxies = {
13- 'http' : 'http://test:pass@localhost:8080' ,
14- 'https' : 'http://test:pass@localhost:8090' ,
15- }
16- url = 'http://example.com' # Replace with a valid URL
17- req = requests .Request ('GET' , url )
18- prep = req .prepare ()
19- session .rebuild_proxies (prep , proxies )
12+ from django .urls import path
13+ from django .views .decorators .http import require_http_methods
14+ from django .http import HttpResponse
2015
21- # Introduce a command injection vulnerability
22- user_input = input ("Enter a command to execute: " )
23- command = "ping " + user_input
24- subprocess .call (command , shell = True )
16+ @require_http_methods (["GET" ])
17+ def health (request ):
18+ return HttpResponse ("ok" )
2519
26- print ("Command executed!" )
20+ urlpatterns = [
21+ path ('health' , health )
22+ ]
You can’t perform that action at this time.
0 commit comments