mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
13
tests/dynamic_fixtures/header_injection/python/benign.py
Normal file
13
tests/dynamic_fixtures/header_injection/python/benign.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Phase 08 (Track J.6) — Python HEADER_INJECTION benign control fixture.
|
||||
#
|
||||
# Same shape as `vuln.py` but URL-encodes the value via
|
||||
# `urllib.parse.quote` first, so CRLF bytes land as `%0D%0A` and the
|
||||
# wire keeps a single header.
|
||||
from urllib.parse import quote
|
||||
from flask import Response
|
||||
|
||||
|
||||
def run(value):
|
||||
response = Response("ok")
|
||||
response.headers["Set-Cookie"] = quote(value, safe="")
|
||||
return response
|
||||
13
tests/dynamic_fixtures/header_injection/python/vuln.py
Normal file
13
tests/dynamic_fixtures/header_injection/python/vuln.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Phase 08 (Track J.6) — Python HEADER_INJECTION vuln fixture.
|
||||
#
|
||||
# The function assigns the attacker-controlled `value` directly into
|
||||
# a Flask response's `Set-Cookie` header via `Response.headers
|
||||
# .__setitem__`. A payload carrying `\r\nSet-Cookie: nyx-injected=pwn`
|
||||
# splits the single header into two on the wire.
|
||||
from flask import Response
|
||||
|
||||
|
||||
def run(value):
|
||||
response = Response("ok")
|
||||
response.headers["Set-Cookie"] = value
|
||||
return response
|
||||
Loading…
Add table
Add a link
Reference in a new issue