-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpy_error_20190801040806.py
More file actions
49 lines (41 loc) · 1.2 KB
/
Copy pathpy_error_20190801040806.py
File metadata and controls
49 lines (41 loc) · 1.2 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#import lxml
class C20190801040806():
"This is an example class"
a = 10
@classmethod
def func(self):
print('Hello Example')
@classmethod
def calc(self,number,times):
return number*times
# Output: 10
print(C20190801040806.a)
# Output: <function MyClass.func at 0x0000000003079BF8>
print(C20190801040806.func)
# Output: 'This is my second class'
print(C20190801040806.__doc__)
# Code Injection
def GET(self):
get_input = web.input()
param1 = get_input['param1'] if 'param1' in get_input else None
if (param1):
x = ast.literal_eval(param1)
return "I'm not vulnerable"+x
# CWE-759
def storePassword(userName,Password):
hasher = hashlib.new('md5')
hasher.update(Password)
hashedPassword = hasher.digest()
# UpdateUserLogin returns True on success, False otherwise
return updateUserLogin(userName,hashedPassword)
def calc(number,times):
print("Sum =", number+times)
#no need for exec
for x in range(0, 3):
print("We're on time %d" % (x))
y = 1
while True:
if(y%2 ==0):
print("To infinity and beyond! We're getting close, on %d now!" % (y))
y += 1
return number*times