-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathBloatedHammer.rs
51 lines (47 loc) · 1.36 KB
/
BloatedHammer.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
BloatedHammer (API Hammering) in Rust
By @5mukx
Original Credit Goes to rad9800: https://github.com/rad9800/BloatedHammer/tree/master
References i looked while i code:
* https://unit42.paloaltonetworks.com/api-hammering-malware-families/
* https://github.com/rad9800/BloatedHammer/tree/master
*/
macro_rules! bloat {
($size:expr, $fn:expr) => {
(0..$size).for_each(|i| $fn(i));
};
}
fn main() {
bloat!(512, |val: usize| {
let mod_val = val % 4;
match mod_val {
0 => {
bloat!(256, |_| {
println!("Case 0 recursive.");
});
},
1 => {
bloat!(32, |_| {
println!("Case 1 recursive.");
bloat!(32, |_| {
println!("Case 1 double recursive.");
bloat!(32, |_| {
println!("Case 1 triple recursive.");
});
});
});
},
2 => {
bloat!(256, |_| {
println!("Case 2 recursive.");
});
},
3 => {
bloat!(256, |_| {
println!("Case 3 recursive.");
});
},
_ => {}
}
});
}