mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-15 20:05:13 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
22
tests/dynamic_fixtures/php/cmdi_negative.php
Normal file
22
tests/dynamic_fixtures/php/cmdi_negative.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
// Command injection — negative fixture.
|
||||
// Safe: uses escapeshellarg() and discards the captured output.
|
||||
// Entry: runPing($host) Cap: CODE_EXEC
|
||||
// Expected verdict: NotConfirmed
|
||||
//
|
||||
// Pairs with cmdi_positive.php for differential confirmation. The
|
||||
// captured output is intentionally discarded so a literal payload such
|
||||
// as "; echo NYX_PWN_CMDI" (which escapeshellarg already neutralises
|
||||
// against the shell parser) cannot leak through stdout and trip the
|
||||
// OutputContains oracle.
|
||||
|
||||
function runPing($host) {
|
||||
// Sink-reachability probe: we did reach the shell_exec call site.
|
||||
echo "__NYX_SINK_HIT__\n";
|
||||
// escapeshellarg wraps in single quotes and escapes internal quotes.
|
||||
$safe = escapeshellarg($host);
|
||||
// Capture but discard: command runs under the sanitiser, output is
|
||||
// not surfaced to the oracle.
|
||||
$output = shell_exec('echo hello ' . $safe);
|
||||
unset($output);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue