-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheval.dsml
More file actions
56 lines (49 loc) · 1.38 KB
/
eval.dsml
File metadata and controls
56 lines (49 loc) · 1.38 KB
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
# This is a DSML file for our tiny evaluation.
# Its goal is to find a web request that corresponds to an HTTP 404 Error.
start variables
request_page_name = "None"
requests_tracked = 0
my_log_file = "four_oh_four.txt"
start filters
of_filter("10.1.1.2", "10.1.1.5", None, None)
of_filter("10.1.1.5", "10.1.1.2", None, None)
start state waitingForRequest
define state waitingForRequest
matching
match_string("Raw", "load", "GET", False)
do
set_to_regex_match(request_page_name, "Raw", "load", "GET (.*?) HTTP", 1)
print("Request found: ")
print(request_page_name)
inc(requests_tracked)
goto
waitingForResponse request_page_name
define state waitingForResponse page_name
matching
match_string("Raw", "load", "HTTP/1.1 200 OK", False)
do
print("Response was OK for page: ")
print(page_name)
goto
waitingForRequest
matching
match_string("Raw", "load", "HTTP/1.1 404", False)
do
print("Repsonse was 404 for page: ")
print(page_name)
print("Total requests tracked: ")
print(requests_tracked)
print_stacktrace()
log(my_log_file, "Response was 404 for page: ")
log(my_log_file, page_name)
log(my_log_file, "Total requests tracked: ")
log(my_log_file, requests_tracked)
log_stacktrace(my_log_file)
goto
exit
timeout
20
do
print("Response timed out!")
goto
waitingForRequest