mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-24 20:28:06 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
18
tests/dynamic_fixtures/php/ssrf_negative.php
Normal file
18
tests/dynamic_fixtures/php/ssrf_negative.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
// SSRF — negative fixture.
|
||||
// Safe: only allows http/https scheme; file:// and others rejected.
|
||||
// Entry: fetchUrl($url) Cap: SSRF
|
||||
// Expected verdict: NotConfirmed
|
||||
|
||||
function fetchUrl($url) {
|
||||
$parsed = parse_url($url);
|
||||
$scheme = $parsed['scheme'] ?? '';
|
||||
if ($scheme !== 'http' && $scheme !== 'https') {
|
||||
echo "Scheme not allowed: " . $scheme . "\n";
|
||||
return;
|
||||
}
|
||||
$content = @file_get_contents($url);
|
||||
if ($content !== false) {
|
||||
echo substr($content, 0, 64);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue