forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCode_Injection.py
More file actions
45 lines (30 loc) · 757 Bytes
/
Code_Injection.py
File metadata and controls
45 lines (30 loc) · 757 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from flask import Flask, request
app = Flask(__name__)
@app.route("/flow1")
def flow1():
code = request.args["code"]
eval(code)
@app.route("/flow2")
def flow2():
email = request.args["email"]
eval("./send_email {email}".format(email=email))
def flow3_extra(text):
return text.split("\n")
@app.route("/flow3")
def flow3():
text = request.args["text"]
eval(flow3_extra(text))
@app.route("/flow4")
def flow4():
text = request.args["text"]
tixt = text
toxt = flow3_extra(tixt)
tuxt = toxt
eval(tuxt)
@app.route("/flow1_good")
def flow1_good():
code = request.args["code"]
if code == "print('Hello, Wo... CodeQL!')":
eval(code)
# if __name__ == "__main__":
# app.run(debug=True)