Skip to content

Commit

Permalink
edited error handling in flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Revenant40 authored Apr 19, 2020
1 parent a1cc744 commit df286fa
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions 2tearsinabucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)
}
Expand Down

0 comments on commit df286fa

Please sign in to comment.