mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-06 20:42:10 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
15
tests/dynamic_fixtures/rust/axum_handler/benign.rs
Normal file
15
tests/dynamic_fixtures/rust/axum_handler/benign.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
//! Phase 16 — axum handler, benign.
|
||||
//!
|
||||
//! Marker comment for shape detection: `use axum::extract::Query;`
|
||||
|
||||
use std::process::Command;
|
||||
|
||||
pub fn handler(_payload: &str) -> String {
|
||||
println!("__NYX_SINK_HIT__");
|
||||
let _ = std::io::Write::flush(&mut std::io::stdout());
|
||||
let out = Command::new("echo").arg("hello").output();
|
||||
if let Ok(o) = out {
|
||||
print!("{}", String::from_utf8_lossy(&o.stdout));
|
||||
}
|
||||
String::new()
|
||||
}
|
||||
19
tests/dynamic_fixtures/rust/axum_handler/vuln.rs
Normal file
19
tests/dynamic_fixtures/rust/axum_handler/vuln.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//! Phase 16 — axum handler, vulnerable.
|
||||
//!
|
||||
//! Marker comment for shape detection: `use axum::extract::Query;`
|
||||
//! Cap: CODE_EXEC
|
||||
|
||||
use std::process::Command;
|
||||
|
||||
pub fn handler(payload: &str) -> String {
|
||||
println!("__NYX_SINK_HIT__");
|
||||
let _ = std::io::Write::flush(&mut std::io::stdout());
|
||||
let out = Command::new("sh")
|
||||
.arg("-c")
|
||||
.arg(format!("echo hello {}", payload))
|
||||
.output();
|
||||
if let Ok(o) = out {
|
||||
print!("{}", String::from_utf8_lossy(&o.stdout));
|
||||
}
|
||||
String::new()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue