-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.go
47 lines (39 loc) · 986 Bytes
/
main.go
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
package main
import (
"fmt"
"os"
"github.com/mattiasgrenfeldt/bachelors-thesis-http-request-smuggling/test-harness/harness"
)
func main() {
if len(os.Args) < 2 {
fmt.Printf("usage: %s <.req-files>\n", os.Args[0])
os.Exit(1)
}
fmt.Println("Loading Requests...")
reqs, err := harness.LoadRequests(os.Args[1:])
if err != nil {
panic(err)
}
fmt.Println("Building containers...")
proxies, servers, err := harness.BuildAll()
if err != nil {
panic(err)
}
fmt.Println("Running servers...")
serverResult, err := harness.RunServices("server", servers, reqs)
if err != nil {
panic(err)
}
fmt.Println("Running proxies...")
proxyResult, err := harness.RunServices("proxy", proxies, reqs)
if err != nil {
panic(err)
}
fmt.Println("Reporting...")
if err := harness.GenerateReport("full", serverResult, proxyResult, reqs); err != nil {
panic(err)
}
if err := harness.GenerateReport("mini", serverResult, proxyResult, reqs); err != nil {
panic(err)
}
}