mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-21 20:18:06 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
16
tests/dynamic_fixtures/python/ssrf_positive.py
Normal file
16
tests/dynamic_fixtures/python/ssrf_positive.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
"""SSRF — positive fixture.
|
||||
|
||||
Vulnerable function: fetches a user-controlled URL.
|
||||
Expected verdict: Confirmed (file:// payload reads /etc/passwd → "root:").
|
||||
"""
|
||||
import urllib.request
|
||||
|
||||
|
||||
def fetch_url(url):
|
||||
"""Vulnerable: fetches URL provided by user without validation."""
|
||||
try:
|
||||
with urllib.request.urlopen(url, timeout=3) as resp:
|
||||
content = resp.read().decode("utf-8", errors="replace")
|
||||
print(content)
|
||||
except Exception as e:
|
||||
print(f"Fetch error: {e}", end="")
|
||||
Loading…
Add table
Add a link
Reference in a new issue