-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathconfig
59 lines (41 loc) · 3.03 KB
/
config
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
# Required. The URL address for each target.
config.target_urls = ["http://localhost:10001/", "http://localhost:10002/","http://localhost:10003/", "http://localhost:10004/", "http://localhost:10005/", "http://localhost:10006/", "http://localhost:10007/", "http://localhost:10008/"]
# Required. The 'Host' header value for each target.
config.target_host_headers = ["localhost", "localhost","localhost", "localhost", "localhost", "localhost", "localhost", "localhost"]
# Required. The input grammar for describing the input structure.
config.grammar = {
'<start>':
['<request>'],
'<request>':
['(<request-line><base><the-body>, opt(prob=0.9))', '<request-line><newline>'],
'<request-line>':
['<method-name><space><uri><space><protocol><separator><version><newline>'],
'<method-name>':
['(GET, opt(prob=0.99))', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'],
'<space>':
[' '],
'<uri>':
['/_URI_'],
'<protocol>':
['HTTP'],
'<separator>':
['/'],
'<version>':
['0.9', '1.0', '1.1'],
'<newline>':
['\r\n'],
'<base>':
['Host: _HOST_\r\nConnection:close\r\nX-Request-ID: _REQUEST_ID_\r\nContent-Length: _CONTENT_LENGTH_\r\n\r\n'],
'<the-body>':
['BBBBBBBBBB'],
}
# Required. Minimum number of mutations to be done
config.min_num_mutations = 1
# Required. Maximum number of mutations to be done
config.max_num_mutations = 1
# Required. The mutation type for each symbol to be mutated. Two mutation types are supported: tree (0) and string (1).
config.symbol_mutation_types = {'<request-line>': 0, '<method-name>': 1, '<space>': 1, '<protocol>': 1, '<separator>': 1, '<version>': 1, '<newline>': 1}
# Required if string mutations are used. The character pool to choose from for insert_random_char and replace_random_char operations.
config.char_pool = ['\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\t', '\n', '\x0b', '\x0c', '\r', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', ' ', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', '\x7f']
# Not required. If not specified, the set of children nodes will be used as the pool.
config.symbol_pool = ['(<request-line>, opt(prob=0.9))', '<method-name>', '<space>', '<protocol>', '<separator>', '<version>', '<newline>']