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
21
tests/dynamic_fixtures/data_exfil/java/Benign.java
Normal file
21
tests/dynamic_fixtures/data_exfil/java/Benign.java
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Phase 11 (Track J.9) — Java DATA_EXFIL benign control fixture.
|
||||
//
|
||||
// Models a hardened outbound HTTP call that gates the destination host
|
||||
// through a loopback allowlist before issuing the request. The harness
|
||||
// reflectively invokes `run(payload)`; non-allowlist payloads (e.g.
|
||||
// `attacker.test`) short-circuit before `NyxMockHttp.get(url)` so the
|
||||
// captured-hosts list stays empty for the differential runner and no
|
||||
// probe is emitted, clearing `OutboundHostNotIn` for the attacker
|
||||
// payload. Loopback payloads (e.g. `127.0.0.1`) reach the helper but
|
||||
// the captured host is inside the allowlist so the predicate stays
|
||||
// clear there too.
|
||||
import java.util.Set;
|
||||
|
||||
public class Benign {
|
||||
private static final Set<String> ALLOWLIST = Set.of("127.0.0.1", "localhost");
|
||||
|
||||
public static void run(String host) throws Exception {
|
||||
if (!ALLOWLIST.contains(host)) return;
|
||||
NyxMockHttp.get("http://" + host + "/exfil?token=alice-creds");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue