Skip to content

Commit e0e5f6a

Browse files
vulnerability
1 parent ade85b8 commit e0e5f6a

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

vulnerability.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (c) 2025 Intel Corporation
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
12+
import os
13+
import sqlite3
14+
15+
16+
def execute_command(command):
17+
os.system(command)
18+
19+
20+
user_command = input("Enter shell command: ")
21+
execute_command(user_command)
22+
23+
24+
def get_user_data(user_id):
25+
conn = sqlite3.connect("example.db")
26+
cursor = conn.cursor()
27+
28+
query = f"SELECT * FROM users WHERE id = {user_id}"
29+
cursor.execute(query)
30+
31+
result = cursor.fetchall()
32+
conn.close()
33+
return result
34+
35+
36+
user_input = input("Enter user ID: ")
37+
print(get_user_data(user_input))

0 commit comments

Comments
 (0)