test: 补齐C-01未授权文件攻击矩阵

This commit is contained in:
2026-09-12 02:31:44 +08:00
parent 604702e980
commit f6fd6b9ce9
3 changed files with 91 additions and 0 deletions
@@ -3,6 +3,18 @@ use std::net::{SocketAddr, TcpStream, UdpSocket};
use std::time::Duration;
fn main() {
let args: Vec<_> = std::env::args().collect();
if args.get(1).is_some_and(|value| value == "file_denied_100") {
for path in &args[2..] {
for _ in 0..100 {
if std::fs::File::open(path).is_ok()
|| std::fs::OpenOptions::new().write(true).open(path).is_ok()
{
std::process::exit(88);
}
}
}
std::process::exit(0);
}
if args.get(1).is_some_and(|s| s == "cpu_burn") {
std::thread::scope(|scope| {
for _ in 0..8 {