Skip to content

Instantly share code, notes, and snippets.

@x0root
Created December 27, 2025 02:19
Show Gist options
  • Select an option

  • Save x0root/10ceb91f4753acca630cc12e422858bb to your computer and use it in GitHub Desktop.

Select an option

Save x0root/10ceb91f4753acca630cc12e422858bb to your computer and use it in GitHub Desktop.
from flask import Flask, make_response
app = Flask(__name__)
@app.route("/")
def index():
html = """
<!DOCTYPE html>
<html>
<head>
<title>XSS Demo</title>
</head>
<body>
<h2>XSS Proof of Concept</h2>
<script>
alert("Domain: " + document.domain);
alert("Cookies: " + document.cookie);
</script>
</body>
</html>
"""
resp = make_response(html)
resp.set_cookie("session_id", "xss_demo_cookie")
return resp
if __name__ == "__main__":
app.run(host="127.0.0.1", port=5000, debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment