-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
55 lines (48 loc) · 1.06 KB
/
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
48
49
50
51
52
53
54
55
package main
import (
"flag"
"fmt"
"log"
"os"
"gopkg.in/yaml.v2"
)
type yamlData struct {
Method string `yaml:"method"`
Headers string `yaml:"headers"`
}
func bypass(d string) {
// req, err := http.NewRequest()
// client := &http.Client{}
yamlMap := make(map[string]interface{})
yamlFile, err := os.ReadFile("/home/hunter/.config/fbypass/config.yaml")
if err != nil {
log.Fatal(err)
}
err = yaml.Unmarshal(yamlFile, yamlMap)
if err != nil {
fmt.Println("err during unmarshaling $HOME/.config/fbypass/config.yaml:\n", err)
os.Exit(0)
}
for _, item := range yamlMap {
fmt.Println(item)
}
}
func main() {
var (
host string
hosts string
concurrency int
)
flag.StringVar(&host, "host", "", "single host to check")
flag.StringVar(&hosts, "hosts", "", "file path contains hosts to check")
flag.IntVar(&concurrency, "c", 10, "number of concurrency")
flag.Parse()
if host != "" && hosts == "" {
bypass(host)
}
if hosts == "" && host == "" {
fmt.Println("you must provide a host or list of hosts.")
flag.Usage()
os.Exit(0)
}
}