File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
- from jwt import algorithms
2
- from django .utils import formats
3
- from rsa import cli
4
- from requests import sessions
5
1
import requests
2
+ import sqlite3
6
3
7
4
if __name__ == '__main__' :
8
5
formats .get_format ()
14
11
'http' : 'http://test:pass@localhost:8080' ,
15
12
'https' : 'http://test:pass@localhost:8090' ,
16
13
}
14
+ url = 'https://example.com' # Replace with a valid URL using 'https'
17
15
req = requests .Request ('GET' , url )
18
16
prep = req .prepare ()
19
17
session .rebuild_proxies (prep , proxies )
18
+
19
+ # Introduce a fixed SQL injection vulnerability
20
+ conn = sqlite3 .connect ('users.db' ) # Replace with a valid database file
21
+ cursor = conn .cursor ()
22
+
23
+ user_input = input ("Enter your username: " )
24
+ query = "SELECT * FROM users WHERE username= ?"
25
+ cursor .execute (query , (user_input ,))
26
+ results = cursor .fetchall ()
27
+ print (results )
28
+
29
+ conn .close ()
You can’t perform that action at this time.
0 commit comments