use super::{is_deny, AttackTest};
use serde_json::json;
pub fn tests() -> Vec<AttackTest> {
vec![
AttackTest {
id: "A9.1",
name: "Cloud metadata SSRF",
class: "SSRF & Domain Bypass",
payload: json!({
"tool": "http", "function": "request",
"parameters": {"url": "http://169.254.169.254/latest/meta-data/"}
}),
check_fn: is_deny,
},
AttackTest {
id: "A9.2",
name: "Userinfo bypass",
class: "SSRF & Domain Bypass",
payload: json!({
"tool": "http", "function": "request",
"parameters": {"url": "http://allowed.com@169.254.169.254/path"}
}),
check_fn: is_deny,
},
AttackTest {
id: "A9.3",
name: "Percent-encoded userinfo bypass",
class: "SSRF & Domain Bypass",
payload: json!({
"tool": "http", "function": "request",
"parameters": {"url": "http://allowed%2Ecom%40169.254.169.254@evil.com/"}
}),
check_fn: is_deny,
},
AttackTest {
id: "A9.4",
name: "Trailing dot bypass",
class: "SSRF & Domain Bypass",
payload: json!({
"tool": "http", "function": "request",
"parameters": {"url": "https://evil.com./path"}
}),
check_fn: is_deny,
},
AttackTest {
id: "A9.5",
name: "IPv6 loopback",
class: "SSRF & Domain Bypass",
payload: json!({
"tool": "http", "function": "request",
"parameters": {"url": "http://[::1]/admin"}
}),
check_fn: is_deny,
},
AttackTest {
id: "A9.6",
name: "Port smuggling",
class: "SSRF & Domain Bypass",
payload: json!({
"tool": "http", "function": "request",
"parameters": {"url": "https://evil.com:8080/exfiltrate"}
}),
check_fn: is_deny,
},
]
}