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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#![allow(clippy::use_self)] // clippy false-positive on Action, doesn't want to apply directly to the enums that derive Serialize
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
/// represents directives of which pieces of a [`Request`] should be fuzzed
///
/// [`Request`]: crate::requests::Request
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[non_exhaustive]
pub enum ShouldFuzz<'a> {
/// directive associated with a fuzzable HTTP request's body
RequestBody(&'a [u8]),
/// directive associated with a fuzzable HTTP method, i.e. GET/POST/etc...
HTTPMethod(&'a [u8]),
/// directive associated with a fuzzable HTTP method, ex: HTTP/1.1
HTTPVersion(&'a [u8]),
/// directive associated with a fuzzable URL scheme, ex: http/https
///
/// # Note
///
/// this variant doesn't accept a starting value due to the fact that a [`Request`]
/// can only be instantiated through its `from_url` method. In order to provide
/// an initial value to the `Request`'s `host` field, simply use the first
/// parameter of the [`Request::from_url`] method
///
/// [`Request::from_url`]: crate::requests::Request::from_url
/// [`Request`]: crate::requests::Request
URLScheme,
/// directive associated with a fuzzable URL username
///
/// # Note
///
/// this variant doesn't accept a starting value due to the fact that a [`Request`]
/// can only be instantiated through its `from_url` method. In order to provide
/// an initial value to the `Request`'s `host` field, simply use the first
/// parameter of the [`Request::from_url`] method
///
/// [`Request::from_url`]: crate::requests::Request::from_url
/// [`Request`]: crate::requests::Request
URLUsername,
/// directive associated with a fuzzable URL password
///
/// # Note
///
/// this variant doesn't accept a starting value due to the fact that a [`Request`]
/// can only be instantiated through its `from_url` method. In order to provide
/// an initial value to the `Request`'s `host` field, simply use the first
/// parameter of the [`Request::from_url`] method
///
/// [`Request::from_url`]: crate::requests::Request::from_url
/// [`Request`]: crate::requests::Request
URLPassword,
/// directive associated with a fuzzable URL ip address/domain
///
/// # Note
///
/// this variant doesn't accept a starting value due to the fact that a [`Request`]
/// can only be instantiated through its `from_url` method. In order to provide
/// an initial value to the `Request`'s `host` field, simply use the first
/// parameter of the [`Request::from_url`] method
///
/// [`Request::from_url`]: crate::requests::Request::from_url
/// [`Request`]: crate::requests::Request
URLHost,
/// directive associated with a fuzzable URL port
///
/// # Note
///
/// this variant doesn't accept a starting value due to the fact that a [`Request`]
/// can only be instantiated through its `from_url` method. In order to provide
/// an initial value to the `Request`'s `host` field, simply use the first
/// parameter of the [`Request::from_url`] method
///
/// [`Request::from_url`]: crate::requests::Request::from_url
/// [`Request`]: crate::requests::Request
URLPort,
/// directive associated with a fuzzable URL path
///
/// # Note
///
/// this variant doesn't accept a starting value due to the fact that a [`Request`]
/// can only be instantiated through its `from_url` method. In order to provide
/// an initial value to the `Request`'s `host` field, simply use the first
/// parameter of the [`Request::from_url`] method
///
/// [`Request::from_url`]: crate::requests::Request::from_url
/// [`Request`]: crate::requests::Request
URLPath,
/// directive associated with a fuzzable URL fragment
///
/// # Note
///
/// this variant doesn't accept a starting value due to the fact that a [`Request`]
/// can only be instantiated through its `from_url` method. In order to provide
/// an initial value to the `Request`'s `host` field, simply use the first
/// parameter of the [`Request::from_url`] method
///
/// [`Request::from_url`]: crate::requests::Request::from_url
/// [`Request`]: crate::requests::Request
URLFragment,
/// directive associated with a fuzzable User-Agent header where only the
/// the value is fuzzable; the `User-Agent` key is static and does not
/// need to be specified
UserAgent(&'a [u8]),
/// directive associated with a URL query where only the key is fuzzable; the
/// value is static
URLParameterKey(&'a [u8], &'a [u8]),
/// directive associated with a URL query where only the value is fuzzable; the
/// key is static
URLParameterValue(&'a [u8], &'a [u8]),
/// directive associated with a URL query where both the key and value are fuzzable
URLParameterKeyAndValue(&'a [u8], &'a [u8]),
/// directive associated with all URL queries where all query keys are marked
/// fuzzable; unmarked values remain static
///
/// # Note
///
/// this variant can be used when specifying parameters in the `url` field of
/// the [`Request::from_url`] method.
///
/// [`Request::from_url`]: crate::requests::Request::from_url
///
/// ex: `Request::from_url("http://example.com/stuff.php?FUZZ=derp", &[ShouldFuzz::URLParameterKeys])`
URLParameterKeys,
/// directive associated with all URL queries where all query values are marked
/// fuzzable; unmarked keys remain static
///
/// # Note
///
/// this variant can be used when specifying parameters in the `url` field of
/// the [`Request::from_url`] method.
///
/// [`Request::from_url`]: crate::requests::Request::from_url
///
/// ex: `Request::from_url("http://example.com/stuff.php?derp=FUZZ", &[ShouldFuzz::URLParameterValues])`
URLParameterValues,
/// directive associated with all URL queries where both all keys and values are fuzzable
///
/// # Note
///
/// this variant can be used when specifying parameters in the `url` field of
/// the [`Request::from_url`] method.
///
/// [`Request::from_url`]: crate::requests::Request::from_url
///
/// ex: `Request::from_url("http://example.com/stuff.php?FUZZ1=FUZZ2", &[ShouldFuzz::URLParameterKeysAndValues])`
URLParameterKeysAndValues,
/// directive associated with an http header where only the key is fuzzable; the
/// value is static
HeaderKey(&'a [u8], &'a [u8]),
/// directive associated with an http header where only the value is fuzzable; the
/// key is static
HeaderValue(&'a [u8], &'a [u8]),
/// directive associated with an http header where both the key and value are fuzzable
HeaderKeyAndValue(&'a [u8], &'a [u8]),
/// directive associated with a fuzzable header/query-param key
Key,
/// directive associated with a fuzzable header/query-param value
Value,
/// directive associated with a fuzzable header/query-param key and value
KeyAndValue,
}