-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmgun.go
54 lines (50 loc) · 1023 Bytes
/
mgun.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
48
49
50
51
52
53
54
package main
import (
"flag"
"fmt"
"github.com/byorty/mgun/lib"
yaml "gopkg.in/yaml.v2"
"io/ioutil"
)
func main() {
var file string
flag.StringVar(&file, "f", "/path/to/config/file.yaml", "configuration yaml file")
flag.Parse()
if len(file) > 0 {
bytes, err := ioutil.ReadFile(file)
if err == nil {
kill := lib.GetKill()
victim := lib.NewVictim()
gun := lib.GetGun()
reporter := lib.GetReporter()
err := yaml.Unmarshal(bytes, kill)
if err == nil {
err = yaml.Unmarshal(bytes, victim)
if err == nil {
err = yaml.Unmarshal(bytes, reporter)
if err == nil {
err = yaml.Unmarshal(bytes, gun)
if err == nil {
kill.SetVictim(victim)
kill.SetGun(gun)
kill.Prepare()
kill.Start()
} else {
fmt.Println(err)
}
} else {
fmt.Println(err)
}
} else {
fmt.Println(err)
}
} else {
fmt.Println(err)
}
} else {
fmt.Println(err)
}
} else {
fmt.Println("config file not found")
}
}