From 551d62b89d7fb3112a4a7984d628e1e84e54fd1b Mon Sep 17 00:00:00 2001 From: "Eduardo Barbosa (an4kein)" <37910997+an4kein@users.noreply.github.com> Date: Mon, 7 Jun 2021 09:07:53 -0700 Subject: [PATCH] Update crt_v2.go adding a menu --- crt_v2.go | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/crt_v2.go b/crt_v2.go index 6d9be20..b7d0714 100644 --- a/crt_v2.go +++ b/crt_v2.go @@ -9,8 +9,22 @@ import ( "fmt" "io/ioutil" "net/http" + "os" ) +var banner = ` + _ + ___ _ __| |_ __ _ ___ + / __| '__| __| / _ |/ _ \ +| (__| | | |_ | (_| | (_) | + \___ |_| \__(_)__, |\___/ + |___/ + + [+] by @anakein + [+] https://github.com/an4kein + [-] Usage: crt.go +` + type Crtsr struct { CommonName string `json:"common_name"` } @@ -33,10 +47,20 @@ func GetJsonFromCrt(domain string) { fmt.Println("error:", err) } for _, subdomain := range subdomains { - fmt.Println("Found:", subdomain.CommonName) + fmt.Println(subdomain.CommonName) } + fmt.Println("FOUND", len(subdomains), "SUBDOMAINS") + } func main() { - GetJsonFromCrt("facebook.com") + fmt.Println(banner) + if os.Args != nil && len(os.Args) > 1 { + domain := os.Args[1] + if domain != "" { + fmt.Println("+---------------------=[Gathering Certificate Subdomains]=------------------------+") + GetJsonFromCrt(domain) + fmt.Println("+--------------------------------=[Done!]=----------------------------------------+") + } + } }