forked from joanbono/gap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
41 lines (37 loc) · 843 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
package main
import (
"flag"
"fmt"
)
var (
apiFlag string
proxyFlag string
pocFlag bool
quietFlag bool
versionFlag bool
version string
)
func init() {
flag.StringVar(&apiFlag, "api", "", "Google Maps API key")
flag.StringVar(&proxyFlag, "x", "", "Proxy URL. Ex: http://127.0.0.1:8080")
flag.BoolVar(&pocFlag, "poc", false, "Generate PoC for vulnerable ones")
flag.BoolVar(&quietFlag, "quiet", false, "Print only vulnerable APIs")
flag.BoolVar(&versionFlag, "version", false, "Show version")
flag.Parse()
}
func main() {
if versionFlag {
fmt.Printf("\n 🗺 GAP %v\n\n", version)
return
}
if proxyFlag != "" {
validateProxyUrl(proxyFlag)
}
if apiFlag == "" {
flag.PrintDefaults()
return
} else {
validateGoogleMapsApiKey(apiFlag)
ApiChecks(apiFlag, proxyFlag, pocFlag, quietFlag)
}
}