From df286fa33f64309fb679892567f946fb06cb84d8 Mon Sep 17 00:00:00 2001 From: Revenant40 <63933724+Revenant40@users.noreply.github.com> Date: Sun, 19 Apr 2020 18:37:47 -0400 Subject: [PATCH] edited error handling in flags --- 2tearsinabucket.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/2tearsinabucket.go b/2tearsinabucket.go index 4ad9012..491f7d4 100644 --- a/2tearsinabucket.go +++ b/2tearsinabucket.go @@ -42,10 +42,8 @@ func getStatusCode(url string) string { func main() { - target := flag.String("t"," ", "target") - wordlist := flag.String("w","bucket-names.txt", "wordlist") - - var words = fmt.Sprintf("%s", *wordlist) + target := flag.String("t","foo", "Please set the -t flag with the name or your target") + wordlist := flag.String("w","foo", "Please set the -w flag with your wordlist ") flag.Parse() @@ -58,13 +56,8 @@ func main() { fmt.Println(" ++ Target Set To:", *target) fmt.Println(" ++ Wordlist Set To:", *wordlist) fmt.Println("\n+++ Only checking for buckets with a 200 or 403 response code +++\n") - - if *target == " " { - fmt.Println("Use the -t flag to set your target (e.g ./2tearsinabucket -t 'targets name')\n") - os.Exit(1) - } - readFile, err := os.Open(words) + readFile, err := os.Open(*wordlist) if err != nil { log.Fatalf("failed to open file: %s", err) }